Skip to content

Commit

Permalink
lif: use IFT_* consts from x/sys/unix
Browse files Browse the repository at this point in the history
Use the the IFT_* constants already defined in the golang.org/x/sys/unix
package instead of locally duplicating them.

Change-Id: Ifdcedae547f909535f4b447968712c7c1495c821
Reviewed-on: https://go-review.googlesource.com/c/net/+/413275
Auto-Submit: Tobias Klauser <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Run-TryBot: Tobias Klauser <[email protected]>
Reviewed-by: Carlos Amedee <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
tklauser authored and gopherbot committed Jun 24, 2022
1 parent 263ec57 commit 1bab6f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
6 changes: 0 additions & 6 deletions lif/defs_solaris.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,3 @@ type lifreq C.struct_lifreq
type lifconf C.struct_lifconf

type lifIfinfoReq C.struct_lif_ifinfo_req

const (
sysIFT_IPV4 = C.IFT_IPV4
sysIFT_IPV6 = C.IFT_IPV6
sysIFT_6TO4 = C.IFT_6TO4
)
8 changes: 6 additions & 2 deletions lif/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

package lif

import "unsafe"
import (
"unsafe"

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

// A Link represents logical data link information.
//
Expand Down Expand Up @@ -43,7 +47,7 @@ func (ll *Link) fetch(s uintptr) {
ll.MTU = int(nativeEndian.Uint32(lifr.Lifru[:4]))
}
switch ll.Type {
case sysIFT_IPV4, sysIFT_IPV6, sysIFT_6TO4:
case unix.IFT_IPV4, unix.IFT_IPV6, unix.IFT_6TO4:
default:
ioc = int64(sysSIOCGLIFHWADDR)
if err := ioctl(s, uintptr(ioc), unsafe.Pointer(&lifr)); err == nil {
Expand Down
6 changes: 0 additions & 6 deletions lif/zsys_solaris_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1bab6f3

Please sign in to comment.