<div style="font-family: Arial, sans-serif; font-size: 14px;">Hello BIRDs! And hello Ondřej.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">As a part of my thesis I've been toying with EVPN in BIRD on the oz-evpn branch and I managed to run into a segfault</div><div style="font-family: Arial, sans-serif; font-size: 14px;">when I add ethernet interface into a bridge. I am using a couple fedora 42 VMs and I have this running in pnetlab</div><div style="font-family: Arial, sans-serif; font-size: 14px;">but I hope virtualization is not a problem here.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I narrowed it down to this very minimal bird.conf:<br><code></code>​```<br><span>log stderr all;</span><div><span>log "/var/log/bird.log" all;</span></div><div><br></div><div><span>router id 10.10.10.3;</span></div><div><br></div><div><span>ipv4 table master4;</span></div><div><span>protocol device {</span></div><div><span>    scan time 10;</span></div><div><span>}</span></div><span></span><code></code>​```</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">and a reproducer is basically what is in the README in <a href="https://gitlab.nic.cz/labs/bird-tools/-/tree/master/netlab/cf-evpn-bgp-tags" title="cf-evpn-bgp-tags">cf-evpn-bgp-tags</a> test:</div><div style="font-family: Arial, sans-serif; font-size: 14px;">```</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>[root@debug ~]# ip link add name br0 type bridge vlan_filtering 1</span><div><span>[root@<span>debug</span> ~]# ip link add name vxlan0 type vxlan id 100 local 10.10.10.3 dstport 4789 nolearning</span></div><div><span>[root@<span>debug</span> ~]# ip link set vxlan0 master br0</span></div><span>[root@<span>debug</span> ~]# bridge link set dev vxlan0 learning off</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span><span>[root@debug ~]# ip link set dev eth1 master br0</span><div><span>[root@debug ~]# bird -f</span></div><span>Segmentation fault (core dumped)</span><br></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;">```</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I spent some time debugging this, although I am not too familiar with netlink I hope my description will be useful :)<br>Segfault happens in "<span>sysdep/linux/netlink.c</span>" because <a href="https://gitlab.nic.cz/labs/bird/-/blob/oz-evpn/sysdep/linux/netlink.c?ref_type=heads#L1037" title="this strcmp">this strcmp</a> on line 1037 gets a NULL in the first parameter "kind" which seems</div><div style="font-family: Arial, sans-serif; font-size: 14px;">expected based on that "kind" is set conditionally. Looking at the <a href="https://gitlab.nic.cz/labs/bird/-/blob/oz-evpn/sysdep/linux/netlink.c?ref_type=heads#L1030" title="array li">array li</a> and its size == 3 and into the "nl_parse_attrs" function</div><div style="font-family: Arial, sans-serif; font-size: 14px;">I understand that you are only trying to get the first three (?) IFLA_INFO_x items which are</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>  IFLA_INFO_UNSPEC, </span><span>IFLA_INFO_KIND, IFLA_INFO_DATA.</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>The first "a->rta_type" that I see on my eth1 interface has a value 4 which is the <span>IFLA_INFO_SLAVE_KIND</span></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>and reading the data from it I indeed get "bridge" as a result.</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>All of these get skipped by the first <a href="https://gitlab.nic.cz/labs/bird/-/blob/oz-evpn/sysdep/linux/netlink.c?ref_type=heads#L538" title="continue">continue</a> so "nl_parse_attrs" does not return anything useful.</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>Is it possible that netlink is just not sending the data you need?</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span><br></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>Bug most likely comes from <a href="https://gitlab.nic.cz/labs/bird/-/commit/66edbe43ce1fec8465577637c359d0294f580055" title="66edbe43"><span>66edbe43</span></a> commit which is specific to the oz-evpn branch so other non-evpn branches are unaffected.</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>I'm also attaching a patch which fixes it for me and I can have EVPN up and running.</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span><br></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span><br></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>Thank you for your time and I hope you'll have a great day!</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span>Tomáš</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;" class="protonmail_signature_block protonmail_signature_block-empty">
    <div class="protonmail_signature_block-user protonmail_signature_block-empty">
        
            </div>
    
            <div class="protonmail_signature_block-proton protonmail_signature_block-empty">
        
            </div>
</div>