From owner-freebsd-net@freebsd.org Fri Aug 3 16:29:33 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D7E3106E3CA for ; Fri, 3 Aug 2018 16:29:33 +0000 (UTC) (envelope-from sergey@akhmatov.ru) Received: from dutch.chaklun.ru (dutch.chaklun.ru [IPv6:2a01:7c8:aab0:135::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13E058B0C5 for ; Fri, 3 Aug 2018 16:29:32 +0000 (UTC) (envelope-from sergey@akhmatov.ru) Received: from [212.65.69.61] (helo=[127.0.0.1]) by dutch.chaklun.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1flcxG-000Axf-Dq for freebsd-net@freebsd.org; Fri, 03 Aug 2018 19:29:30 +0300 From: Sergey Akhmatov Subject: Multicast group 224.0.0.1 membership drops when adding interface alias twice To: freebsd-net Message-ID: <9b2c592b-a93f-f2d7-c586-c927279f246e@akhmatov.ru> Date: Fri, 3 Aug 2018 19:29:28 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2018 16:29:33 -0000 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 metric 0 mtu 16384 options=680003         inet 127.1.0.1 netmask 0xffffff00         nd6 options=29         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 metric 0 mtu 16384 options=680003         inet 127.1.0.1 netmask 0xffffff00         nd6 options=29         groups: lo # ifmcstat -i lo1 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?