summaryrefslogtreecommitdiffstats
path: root/proto/ospf/ospf.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>1999-05-24 19:29:05 +0200
committerOndrej Filip <feela@network.cz>1999-05-24 19:29:05 +0200
commitb9f8590025fd5d6dd360f759c5a219d69b975123 (patch)
tree5ee0804d8b51756f02ed66e8fbca0af0205934b8 /proto/ospf/ospf.c
parent4b0d57e53120e404e00f7d252119e45288ceeb71 (diff)
downloadbird-b9f8590025fd5d6dd360f759c5a219d69b975123.tar
bird-b9f8590025fd5d6dd360f759c5a219d69b975123.zip
IP header test added.
Diffstat (limited to 'proto/ospf/ospf.c')
-rw-r--r--proto/ospf/ospf.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 954df8e..de16488 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -81,9 +81,16 @@ ospf_rx_hook(sock *sk, int size)
DBG(".\n");
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);
return(1);
}