]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes a crash when mrtdump is enabled and interface goes away.
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 29 Apr 2013 20:08:05 +0000 (22:08 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 29 Apr 2013 20:08:05 +0000 (22:08 +0200)
Thanks to Peter Christensen for the bugfix.

proto/bgp/packets.c

index f2e03f8759cf24660e5a38962547382d54824ea5..bf52c8cdf686532afc9944030160a257b64d5627 100644 (file)
@@ -58,7 +58,7 @@ mrt_put_bgp4_hdr(byte *buf, struct bgp_conn *conn, int as4)
       buf+=4;
     }
 
-  put_u16(buf+0, p->neigh ? p->neigh->iface->index : 0);
+  put_u16(buf+0, (p->neigh && p->neigh->iface) ? p->neigh->iface->index : 0);
   put_u16(buf+2, BGP_AF);
   buf+=4;
   buf = ipa_put_addr(buf, conn->sk ? conn->sk->daddr : IPA_NONE);