Skip to content

Commit

Permalink
Hardcode AF_INET for windows ndt7-client builds (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-soltesz authored Sep 23, 2020
1 parent c5977c8 commit a8ccc2c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions inetdiag/inetdiag.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ https://pdfs.semanticscholar.org/6efd/e161a2582ba5846e4b8fea5a53bc305a64f3.pdf
expressed in host-byte order"
*/

import (
"golang.org/x/sys/unix"
)

// inet_diag.h

// NOTE: darwin unix.AF_INET6 and syscall.AF_INET6 are incorrect for
// our purposes (0x1e), so, we set this explicitly.
const AF_INET6 = 0x0a

// NOTE: windows does not have unix.AF_INET available.
const AF_INET = 0x02

const (
INET_DIAG_NONE = iota
INET_DIAG_MEMINFO
Expand Down Expand Up @@ -85,8 +84,8 @@ var InetDiagType = map[int32]string{
}

var diagFamilyMap = map[uint8]string{
unix.AF_INET: "tcp",
AF_INET6: "tcp6", // because darwin values for AF_INET6 are incorrect.
AF_INET: "tcp",
AF_INET6: "tcp6", // because darwin values for AF_INET6 are incorrect.
}

// Protocol defines the type corresponding to INET_DIAG_PROTOCOL 8 bit field.
Expand Down

0 comments on commit a8ccc2c

Please sign in to comment.