Multicast group 224.0.0.1 membership drops when adding interface alias twice
Sergey Akhmatov
sergey at akhmatov.ru
Fri Aug 3 16:29:33 UTC 2018
Hello,
I've hit some strange behavior and not sure if its a bug and where it
is, kernel or ifconfig. Tested on 11.1-REALESE and 11-STABLE
When I add first IP to interface it automatically joins multicast group
224.0.0.1 (All hosts), for example:
# ifconfig lo1 create
# ifconfig lo1 inet 127.1.0.1/24
# ifconfig lo1
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.1.0.1 netmask 0xffffff00
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
groups: lo
# ifmcstat -i lo1
lo1:
inet 127.1.0.1
igmpv3 rv 2 qi 125 qri 10 uri 3
group 224.0.0.1 mode exclude
When I run ifconfig with the same IP and "alias" keyword, nothing
changes on the interface, which is expectable. But interface leave
multicast group:
# ifconfig lo1
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.1.0.1 netmask 0xffffff00
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
groups: lo
# ifmcstat -i lo1
<empty>
The same works for ethernet interfaces, I chose lo1 for example as the
easiest way to reproduce without breaking things.
A few words why am I doing this:
It's not me, It's /etc/network.subr and /sbin/dhclient-script always add
IP to interface with "alias" keyword whether it's the first IP or not.
I use reroot frunction (reboot -r) for diskless network-bootable
systems. They boot minimal memory-disk root via tftp, obtain IP DHCP,
create and populate another memory disk with full-system and reroot into
it. Such reboot doesn't change kernel state, meaning interfaces are
already configured, and when /etc/rc.d/netif hits, it adds IPs which
are already there wiping default 224.0.0.1 multicast membership, which
breaks some site-specific things for me.
I've found workaround, just wiping IPs from interfaces before reroot,
but the whole situation took some time to investigate and looks like a
bug to me. My skills are not enough to find out if it's ifconfig or
kernel internals.
Any thoughts if it deserves bug-report?
More information about the freebsd-net
mailing list