Commit 2a8eb911 authored by Mikio Hara's avatar Mikio Hara

x/net/ipv6: fix build on older darwin kernels

A few adjustments for test cases will come in a following CL.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/176830043
parent 724ab9af
......@@ -21,7 +21,6 @@ var (
}
sockOpts = [ssoMax]sockOpt{
ssoTrafficClass: {iana.ProtocolIPv6, sysIPV6_TCLASS, ssoTypeInt},
ssoHopLimit: {iana.ProtocolIPv6, sysIPV6_UNICAST_HOPS, ssoTypeInt},
ssoMulticastInterface: {iana.ProtocolIPv6, sysIPV6_MULTICAST_IF, ssoTypeInterface},
ssoMulticastHopLimit: {iana.ProtocolIPv6, sysIPV6_MULTICAST_HOPS, ssoTypeInt},
......@@ -44,8 +43,8 @@ func init() {
}
var i int
for i = range osver {
if osver[i] != '.' {
continue
if osver[i] == '.' {
break
}
}
// The IP_PKTINFO and protocol-independent multicast API were
......@@ -61,6 +60,9 @@ func init() {
ctlOpts[ctlHopLimit].marshal = marshalHopLimit
ctlOpts[ctlPacketInfo].name = sysIPV6_PKTINFO
ctlOpts[ctlPacketInfo].marshal = marshalPacketInfo
sockOpts[ssoTrafficClass].level = iana.ProtocolIPv6
sockOpts[ssoTrafficClass].name = sysIPV6_TCLASS
sockOpts[ssoTrafficClass].typ = ssoTypeInt
sockOpts[ssoReceiveTrafficClass].level = iana.ProtocolIPv6
sockOpts[ssoReceiveTrafficClass].name = sysIPV6_RECVTCLASS
sockOpts[ssoReceiveTrafficClass].typ = ssoTypeInt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment