]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fixed link-local connections with wildcard local iface
authorMaria Matejka <mq@ucw.cz>
Wed, 16 Jul 2025 08:45:10 +0000 (10:45 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 13 Nov 2025 10:59:33 +0000 (11:59 +0100)
When BGP was configured to accept link-local connections
in combination with interface range, it failed to recognize
that the incoming connection is indeed for that protocol.

proto/bgp/bgp.c

index fb6410ab02b3114615cc13b724e6b9b7cf024487..fea51781c75b45843fdae9f038e8f45dbf70a394 100644 (file)
@@ -1737,7 +1737,7 @@ bgp_find_proto(sock *sk)
        (!p->cf->remote_range || ipa_in_netX(sk->daddr, p->cf->remote_range)) &&
        (p->p.vrf == sk->vrf) &&
        (p->cf->local_port == sk->sport) &&
-       (!link || (p->cf->iface == sk->iface)) &&
+       (!link || (p->cf->iface == sk->iface) || p->cf->ipatt && sk->iface && iface_patt_match(p->cf->ipatt, sk->iface, NULL)) &&
        (ipa_zero(p->cf->local_ip) || ipa_equal(p->cf->local_ip, sk->saddr)))
     {
       best = p;