fixe remote panic on short packet
Obtained from: KAME
This commit is contained in:
parent
aaaad65dcd
commit
7a1413f972
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121779
@ -1126,6 +1126,11 @@ riprecv()
|
|||||||
if (idx && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
|
if (idx && IN6_IS_ADDR_LINKLOCAL(&fsock.sin6_addr))
|
||||||
SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, idx);
|
SET_IN6_LINKLOCAL_IFINDEX(fsock.sin6_addr, idx);
|
||||||
|
|
||||||
|
if (len < sizeof(struct rip6)) {
|
||||||
|
trace(1, "Packet too short\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nh = fsock.sin6_addr;
|
nh = fsock.sin6_addr;
|
||||||
nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
nn = (len - sizeof(struct rip6) + sizeof(struct netinfo6)) /
|
||||||
sizeof(struct netinfo6);
|
sizeof(struct netinfo6);
|
||||||
|
Loading…
Reference in New Issue
Block a user