summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-04-29 22:08:05 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2013-04-29 22:08:05 +0200
commit572c6440432e3138ea622cfb5a4ef7580d77ef4a (patch)
tree8eb1eb383e10eab15009e2dcca1dd0e64afc1cd6
parent32622d0ea366406f3afa14bb9edb4855d6979786 (diff)
Fixes a crash when mrtdump is enabled and interface goes away.
Thanks to Peter Christensen for the bugfix.
-rw-r--r--proto/bgp/packets.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index f2e03f87..bf52c8cd 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -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);