fixe remote panic on short packet

Obtained from: KAME
This commit is contained in:
suz 2003-10-31 03:18:45 +00:00
parent 30ac6eb1d4
commit cbca8b58aa

View File

@ -1126,6 +1126,11 @@ riprecv()
if (idx && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, idx);
if (len < sizeof(struct rip6)) {
trace(1, "Packet too short\n");
return;
}
nh = fsock.sin6_addr;
nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) /
sizeof(struct netinfo6);