Revert "ipv6: disable multicast packet delivery tests on darwin 12 or below"

Looks like using IPv6 options on Darwin 12 kernel is a hard task.

This reverts commit 67a4d4ecbcb395bd234838c7ea5d8a61008ff215.

Change-Id: I1436e4ff7b42f068e09671ebe9c244a641eefdae
Reviewed-on: https://go-review.googlesource.com/33173
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
diff --git a/ipv6/main_test.go b/ipv6/main_test.go
new file mode 100644
index 0000000..6ae53bb
--- /dev/null
+++ b/ipv6/main_test.go
@@ -0,0 +1,27 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ipv6_test
+
+import (
+	"flag"
+	"fmt"
+	"os"
+	"os/exec"
+	"runtime"
+	"strings"
+	"testing"
+)
+
+func TestMain(m *testing.M) {
+	flag.Parse()
+	if runtime.GOOS == "darwin" {
+		vers, _ := exec.Command("sw_vers", "-productVersion").Output()
+		if string(vers) == "10.8" || strings.HasPrefix(string(vers), "10.8.") {
+			fmt.Fprintf(os.Stderr, "# skipping tests on OS X 10.8 to avoid kernel panics; golang.org/issue/17015\n")
+			os.Exit(0)
+		}
+	}
+	os.Exit(m.Run())
+}
diff --git a/ipv6/multicast_test.go b/ipv6/multicast_test.go
index 69a21cd..1647375 100644
--- a/ipv6/multicast_test.go
+++ b/ipv6/multicast_test.go
@@ -29,15 +29,15 @@
 
 func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
 	switch runtime.GOOS {
+	case "freebsd": // due to a bug on loopback marking
+		// See http://www.freebsd.org/cgi/query-pr.cgi?pr=180065.
+		t.Skipf("not supported on %s", runtime.GOOS)
 	case "nacl", "plan9", "windows":
 		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if !supportsIPv6 {
 		t.Skip("ipv6 is not supported")
 	}
-	if !nettest.SupportsIPv6MulticastDeliveryOnLoopback() {
-		t.Skipf("multicast delivery doesn't work correctly on %s", runtime.GOOS)
-	}
 	ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	if ifi == nil {
 		t.Skipf("not available on %s", runtime.GOOS)
@@ -129,15 +129,15 @@
 
 func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
 	switch runtime.GOOS {
+	case "freebsd": // due to a bug on loopback marking
+		// See http://www.freebsd.org/cgi/query-pr.cgi?pr=180065.
+		t.Skipf("not supported on %s", runtime.GOOS)
 	case "nacl", "plan9", "windows":
 		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	if !supportsIPv6 {
 		t.Skip("ipv6 is not supported")
 	}
-	if !nettest.SupportsIPv6MulticastDeliveryOnLoopback() {
-		t.Skipf("multicast delivery doesn't work correctly on %s", runtime.GOOS)
-	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)
 	}