Search code examples
gocoreosflannelflanneld

golang error: reference to undefined identifier ‘syscall.TUNSETIFF’


So, I have been trying to build flannel (https://github.com/coreos/flannel) with gccgo. Here is the error I am getting while building:

$ ./build 
Building flanneld...
# github.com/coreos/flannel/pkg/ip
gopath/src/github.com/coreos/flannel/pkg/ip/tun.go:57:37: error: reference to undefined identifier ‘syscall.TUNSETIFF’
  err = ioctl(int(tun.Fd()), syscall.TUNSETIFF, uintptr(unsafe.Pointer(&ifr)))
                                     ^

I am using gccgo-5 and gcc-5. Can anyone please help me figure out what exactly is the issue here? TIA


Solution

  • So, I found the answer. The problem was that gccgo didn't define TUNSETIFF for my arch. I defined the value accordingly and I was able to make it work. Thanks @JimB