summaryrefslogtreecommitdiffstats
path: root/proto/ospf/packet.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-03-29 01:41:46 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-03-29 01:41:46 +0200
commitab164971891c64126097eedca11d2f5586f1d8e7 (patch)
tree46fdb499c0ede22595e97dbb7af82d1c42ed8292 /proto/ospf/packet.c
parent52a43ae3b76f86b697537bc3ad8afdb3b421cf2c (diff)
downloadbird-ab164971891c64126097eedca11d2f5586f1d8e7.tar
bird-ab164971891c64126097eedca11d2f5586f1d8e7.zip
Fixes a nasty bug in OSPF.
Sending malformed network prefixes in LSAs causes OSPF to crash just after the LSA is propagated to the other routers.
Diffstat (limited to 'proto/ospf/packet.c')
-rw-r--r--proto/ospf/packet.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index ae9f862..3cda384 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -269,9 +269,10 @@ ospf_rx_hook(sock *sk, int size)
struct proto_ospf *po = ifa->oa->po;
// struct proto *p = &po->proto;
- int src_local = ipa_in_net(sk->faddr, ifa->addr->prefix, ifa->addr->pxlen);
- int dst_local = ipa_equal(sk->laddr, ifa->addr->ip);
- int dst_mcast = ipa_equal(sk->laddr, AllSPFRouters) || ipa_equal(sk->laddr, AllDRouters);
+ int src_local, dst_local UNUSED, dst_mcast;
+ src_local = ipa_in_net(sk->faddr, ifa->addr->prefix, ifa->addr->pxlen);
+ dst_local = ipa_equal(sk->laddr, ifa->addr->ip);
+ dst_mcast = ipa_equal(sk->laddr, AllSPFRouters) || ipa_equal(sk->laddr, AllDRouters);
#ifdef OSPFv2
/* First, we eliminate packets with strange address combinations.