From ab164971891c64126097eedca11d2f5586f1d8e7 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 29 Mar 2011 01:41:46 +0200 Subject: 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. --- proto/ospf/ospf.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'proto/ospf/ospf.h') 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; } -- cgit v1.2.3