-
Notifications
You must be signed in to change notification settings - Fork 530
ziflist selftest fails #1802
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
Comments
Doesn't OSX have getifaddr? Google would suggest it does, which means it should run this block instead: |
You're totally right. That explains why I couldn't see my debugging output from the |
We might have missed something that happens only on OSX in the s_valid_flags function, where it checks the if flags - unfortunately I don't have access to OSX so I cannot test it directly |
I printed the actual flags for each interface being processed (most of them are actually skipped before the call to
And from /usr/include/net/if.h:
|
So if I'm correct, compared to en0, the failing vboxnet2 interface has |
Instead of focusing on the flags, I changed struct ifaddrs *interfaces;
if (getifaddrs (&interfaces) == 0) {
struct ifaddrs *interface = interfaces;
while (interface) {
zsys_info("s_reload(): ifa_name=%s", interface->ifa_name);
// On Solaris, loopback interfaces have a NULL in ifa_broadaddr
if (interface->ifa_addr
&& (interface->ifa_broadaddr
|| (ipv6 && (interface->ifa_addr->sa_family == AF_INET6)))
&&(interface->ifa_addr->sa_family == AF_INET
|| (ipv6 && (interface->ifa_addr->sa_family == AF_INET6)))
+ &&(interface->ifa_netmask->sa_family == AF_INET
+ || (ipv6 && (interface->ifa_netmask->sa_family == AF_INET6)))
&& s_valid_flags (interface->ifa_flags,
ipv6 && (interface->ifa_addr->sa_family == AF_INET6))) {
interface_t *item = s_interface_new (interface->ifa_name,
interface->ifa_addr, interface->ifa_netmask,
interface->ifa_broadaddr);
if (item)
zlistx_add_end (list, item);
}
interface = interface->ifa_next;
}
}
freeifaddrs (interfaces); And the selftest doesn't assert anymore. Does this change make sense? The only interface it really loads now is en0, the only "real" and working interface on my MacBook. Is that what it's supposed to do?
|
It makes sense yes, and feel free to send a PR with that change. On the other hand, its internal details are handled by Virtualbox's code in the kernel module, which is notoriously bad, so it might simply be a bug there. |
Huh, seems like it. I just realized it only crashes while the VM using that adapter (Host-only Adapter) is running. I'll file a PR anyway. If there's no |
I'm running MacOS 10.13.1. When I try to install CZMQ HEAD (with
--enable-drafts
), either with Homebrew or manually, themake check-verbose
step fails with this:I tried to track the problem down and it seems that this assertion happens while reading the netmask information of my interface
vboxnet2
. The functiongetnameinfo(netmask, ...)
returns error codeEAI_FAMILY
. I printednetmask->sa_family
, and it is0
(AF_UNSPEC
according to /usr/include/sys/socket.h). Since thatnetmask
is passed in as an argument, the error seems to be in the calling functions_reload()
, probably in the part that reads the netmask:Now my C/systems programming knowledge is very limited. It seems that for an invalid/unsupported interface, it should simply set
is_valid = false
and thus skip thes_interface_new()
call for that interface, but it doesn't.What might be interesting is the information about my interface:
For this interface, it does not assert:
For this interface, it asserts:
Thanks for any help.
The text was updated successfully, but these errors were encountered: