New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: TestInterfaces fails on FreeBSD 11-CURRENT #11641
Comments
Please take a look at https://github.com/golang/go/blob/master/CONTRIBUTING.md. |
What version of Go are you using (go version)? go version go1.5beta1 freebsd/amd64 What operating system and processor architecture are you using? FreeBSD amd64 What did you do? tar -xzvf go1.5beta1.src.tar.gz What did you expect to see? Test pass What did you see instead? --- FAIL: TestInterfaces (0.00s) |
Thanks. Please let us know your kernel version in next time. The root cause is simply go's routing message parsers still use NET_RT_IFLIST+if_msghdr instead of NET_RT_IFLISTL+if_msghdrl, and seems like the under-development kernel doesn't return correct RTM_IFINFO messages like the following:
|
Ah, I see. Kernel versions is |
I'm not sure whether FreeBSD net subsystem guys want to drop NET_RT_IFLIST in 11-CURRENT. If so, go's routing message parser will use NET_RT_IFLISTL eventually. According to https://www.freebsd.org/releng/index.html, July 2016 is the current scheduled date. So it may happen in go1.7. |
For go1.5 The problem is types_freebsd.go Earlier versions of func (any *anyMessage) parseInterfaceMessage(b []byte) *InterfaceMessage {
p := (*InterfaceMessage)(unsafe.Pointer(any))
return &InterfaceMessage{Header: p.Header, Data: b[SizeofIfMsghdr:any.Msglen]}
} where as 1.5 does (referencing p.Header.Data.Datalen) return &InterfaceMessage{Header: p.Header,
Data: b[int(unsafe.Offsetof(p.Header.Data))+int(p.Header.Data.Datalen) : any.Msglen]} types_freebsd.go: // this needs:
#undef ifi_epoch
// and
#undef ifi_lastchange to work also.
struct if_data8 {
u_char ifi_type;
u_char ifi_physical;
u_char ifi_addrlen;
u_char ifi_hdrlen;
u_char ifi_link_state;
u_char ifi_spare_char1;
u_char ifi_spare_char2;
u_char ifi_datalen;
u_long ifi_mtu;
...
}; FreeBSD if.h: struct if_data {
/* generic interface information */
uint8_t ifi_type; /* ethernet, tokenring, etc */
uint8_t ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */
uint8_t ifi_addrlen; /* media address length */
uint8_t ifi_hdrlen; /* media header length */
uint8_t ifi_link_state; /* current link state */
uint8_t ifi_vhid; /* carp vhid */
uint16_t ifi_datalen; /* length of this data struct */
uint32_t ifi_mtu; /* maximum transmission unit */
....
}; |
CL https://golang.org/cl/14757 mentions this issue. |
…ISTL Switch IfMsghdr and IfaMsghdr to their 'l' variants, make the IfData layout to be based on FreeBSD-11.0 (freebsdVersion >= 1100011). Using freebsdVersion, detect the appropriate layout at runtime and decode routing socket messages into the new IfData layout. Fixes #11641 Change-Id: Ic7ec550f00c0d15f46a36f560d835e4f138f61e1 Reviewed-on: https://go-review.googlesource.com/14757 Reviewed-by: Russ Cox <rsc@golang.org>
This was reverted for breaking the build. |
This is a duplicate of #7849. Also release-11 branch is not created yet. No need to rush adapting heavily under development kernels because freebee net guys still have a chance to modify abis. |
CL https://golang.org/cl/17473 mentions this issue. |
Full error is:
--- FAIL: TestInterfaces (0.00s)
interface_test.go:74: route ip+net: invalid network interface name
The text was updated successfully, but these errors were encountered: