summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-07-12 17:39:39 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-07-12 17:39:39 +0200
commit9be9a264137cdd881f339c37d1a1918527924254 (patch)
tree0b815a7ac09fb59a3e72aad6ce713c7a77ed0662 /proto/bgp/packets.c
parentcfe34a316e35a209fcd814ccf3523c262e8d4b0a (diff)
Implements proper multihop BGP.
Also does some incompatible changes to config file syntax, like removing 'via IP' from multihop option.
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 514e878d..ee2c1b05 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->iface->index);
+ put_u16(buf+0, p->neigh ? 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);
@@ -402,7 +402,7 @@ bgp_create_update(struct bgp_conn *conn, byte *buf)
*/
n = neigh_find(&p->p, &ip, 0);
- if (n && n->iface == p->neigh->iface)
+ if (n && p->neigh && n->iface == p->neigh->iface)
{
if (second && ipa_nonzero(ipp[1]))
ip_ll = ipp[1];