mdlayher / raw

Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed.
MIT License
425 stars 71 forks source link

Pointer variable used as pointer in raw.go #30

Closed JoseIgnacioTamayo closed 6 years ago

JoseIgnacioTamayo commented 6 years ago

While getting the library:

go get github.com/mdlayher/raw

github.com\mdlayher\raw\raw.go:136:37: cannot use *cfg (type Config) as type *Config in argument to listenPacket
corny commented 6 years ago

Which version of Go are you using? Do you have all dependencies up to date?

JoseIgnacioTamayo commented 6 years ago

Hi @corny I am using go 1.9.7 on a windows machine. All depencies are ok.

I just changed p, err := listenPacket(ifi, proto, *cfg) to p, err := listenPacket(ifi, proto, cfg) in raw.go:136, it worked.

Could it be that there is a difference between the different implementations of listenPacket():

/raw_others.go has func listenPacket(ifi *net.Interface, proto uint16, cfg *Config) while the other files have func listenPacket(ifi *net.Interface, proto uint16, _ Config)

Thanks for your attention.

I would have preferred to make a Pull Request, but such a minor change might not be worth it.

mdlayher commented 6 years ago

Fixed in master. This code won't run on Windows at the moment but it should always compile.