zeromq / czmq

High-level C binding for ØMQ
czmq.zeromq.org
Mozilla Public License 2.0
1.18k stars 525 forks source link

ziflist crashes when there are 'alias' net devices #2271

Closed Mathsoum closed 7 months ago

Mathsoum commented 1 year ago

I came across something called a network interface aliasing (debian doc about that) which allows a single interface to have multiple IP addresses.
I did not setup this network configuration but had to deploy software on it.

$ ifconfig -a
ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.178.63  netmask 255.255.255.0  broadcast 172.16.178.255
        ether 00:50:56:b4:7c:80  txqueuelen 1000  (Ethernet)
        RX packets 5990441  bytes 5565928432 (5.1 GiB)
        RX errors 0  dropped 740  overruns 0  frame 0
        TX packets 5343926  bytes 6800868251 (6.3 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens192:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.178.163  netmask 255.255.255.0  broadcast 172.16.178.255
        ether 00:50:56:b4:7c:80  txqueuelen 1000  (Ethernet)

I had crashes from ziflist when it tried to retrieve the mac address of the ens192:0 iface.
I created a PR (#2270) regarding this issue that simply NULL-check the mac variable before using it.
Since I didn't know that concept, maybe there are other changes to make to properly take alias ifaces into account and maybe that could be the object of another issue.

sphaero commented 7 months ago

I guess this was resolved through the PR? Otherwise send a new issue or better PR?