1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Added ip_skip_header() and modified OSPF to use it.

This commit is contained in:
Martin Mares
1999-05-14 18:03:09 +00:00
parent 11ce4490fa
commit b23c5e0ff4
4 changed files with 23 additions and 4 deletions

View File

@@ -80,16 +80,15 @@ ospf_rx_hook(sock *sk, int size)
DBG(sk->iface->name);
DBG(".\n");
ps=(struct ospf_packet *)(sk->rbuf+5*4);
if(size<=(20+sizeof(struct ospf_packet)))
ps = (struct ospf_packet *) ipv4_skip_header(sk->rbuf, &size);
if(!ps || size < sizeof(struct ospf_packet))
{
log("%s: Bad packet received: too short", p->name);
log("%s: Discarding",p->name);
return(1);
}
if((ntohs(ps->length))!=(size-20))
if(ntohs(ps->length) != size)
{
log("%s: Bad packet received: size fields does not match", p->name);
log("%s: Discarding",p->name);