summaryrefslogtreecommitdiffstats
path: root/proto/ospf/ospf.h
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/ospf.h
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/ospf.h')
-rw-r--r--proto/ospf/ospf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index 74a8e31..664bc48 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -587,6 +587,10 @@ lsa_get_ipv6_prefix(u32 *buf, ip_addr *addr, int *pxlen, u8 *pxopts, u16 *rest)
if (pxl > 96)
_I3(*addr) = *buf++;
+ /* Clean up remaining bits */
+ if (pxl < 128)
+ addr->addr[pxl / 32] &= u32_mkmask(pxl % 32);
+
return buf;
}