Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1572)

Delta Between Two Patch Sets: ipv4/sys_darwin.go

Issue 97800043: code review 97800043: go.net/ipv4: add support for dragonfly (Closed)
Left Patch Set: diff -r 88fa30947066 https://code.google.com/p/go.net Created 9 years, 11 months ago
Right Patch Set: diff -r 9c33002573cb https://code.google.com/p/go.net Created 9 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « ipv4/sys_bsd.go ('k') | ipv4/sys_linux.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2014 The Go Authors. All rights reserved. 1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package ipv4 5 package ipv4
6 6
7 const ( 7 import "syscall"
8 » // See /usr/include/netinet/in.h. 8
9 » sysSockoptReceiveTTL = 0x18 9 func init() {
10 » sysSockoptReceiveDst = 0x7 10 » // Seems like kern.osreldate is veiled on latest OS X. We use
11 » sysSockoptReceiveInterface = 0x14 11 » // kern.osrelease instead.
12 » sysSockoptPacketInfo = 0x1a 12 » osver, err := syscall.Sysctl("kern.osrelease")
13 ) 13 » if err != nil {
14 » » return
15 » }
16 » var i int
17 » for i = range osver {
18 » » if osver[i] != '.' {
19 » » » continue
20 » » }
21 » }
22 » // The IP_PKTINFO was introduced in OS X 10.7 (Darwin
23 » // 11.0.0). See http://support.apple.com/kb/HT1633.
24 » if i > 2 || i == 2 && osver[0] >= '1' && osver[1] >= '1' {
25 » » supportsPacketInfo = true
26 » }
27 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b