IP header test added.
This commit is contained in:
parent
4b0d57e531
commit
b9f8590025
1 changed files with 9 additions and 2 deletions
|
@ -81,9 +81,16 @@ ospf_rx_hook(sock *sk, int size)
|
||||||
DBG(".\n");
|
DBG(".\n");
|
||||||
|
|
||||||
ps = (struct ospf_packet *) ipv4_skip_header(sk->rbuf, &size);
|
ps = (struct ospf_packet *) ipv4_skip_header(sk->rbuf, &size);
|
||||||
if(!ps || size < sizeof(struct ospf_packet))
|
if(ps==NULL)
|
||||||
{
|
{
|
||||||
log("%s: Bad packet received: too short", p->name);
|
log("%s: Bad packet received: bad header", p->name);
|
||||||
|
log("%s: Discarding",p->name);
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(size < sizeof(struct ospf_packet))
|
||||||
|
{
|
||||||
|
log("%s: Bad packet received: too short (%d bytes)", p->name, size);
|
||||||
log("%s: Discarding",p->name);
|
log("%s: Discarding",p->name);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue