google / netstack

IPv4 and IPv6 userland network stack
Apache License 2.0
3.08k stars 278 forks source link

Not able to complile sample #24

Closed poonai closed 5 years ago

poonai commented 5 years ago

Getting the following error

[schoolboy@schoolgirl tun_tcp_echo]$ go build main.go 
# github.com/google/netstack/tcpip/link/fdbased
../../link/fdbased/endpoint.go:252:26: constant 2147483649 overflows int
../../link/fdbased/endpoint.go:260:27: cannot assign *tcpip.Error to err (type error) in multiple assignment:
        *tcpip.Error does not implement error (missing Error method)
../../link/fdbased/packet_dispatchers.go:72:4: cannot use uint64(virtioNetHdrSize) (type uint64) as type uint32 in field value
../../link/fdbased/packet_dispatchers.go:84:4: cannot use uint64(len(b)) (type uint64) as type uint32 in field value
../../link/fdbased/packet_dispatchers.go:207:27: cannot use uint64(iovLen) (type uint64) as type uint32 in assignment
../../link/fdbased/packet_dispatchers.go:234:5: cannot use uint64(virtioNetHdrSize) (type uint64) as type uint32 in field value
../../link/fdbased/packet_dispatchers.go:246:5: cannot use uint64(len(b)) (type uint64) as type uint32 in field value
# github.com/google/netstack/tcpip/transport/tcp
../../transport/tcp/snd.go:198:3: constant 9223372036854775807 overflows int

My go version

[schoolboy@schoolgirl tun_tcp_echo]$ go version
go version go1.12 linux/386
hbhasker commented 5 years ago

Apologies. Looks like some recent refactor broke it. Will take a look.

poonai commented 5 years ago

Got it working on go 1.12.1

hbhasker commented 5 years ago

Curious what version were you using earlier. Looking at those errors it looks like an integer overflow error.

hbhasker commented 5 years ago

Were you by any chance compiling to a 32 bit linux binary target? Netstack is part of gVisor as a result the only platform we really target is a x86_64.

poonai commented 5 years ago

yeah, I targeted 32 bit.

Thanks for the help.

Closing this.