]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
IP header test added.
authorOndrej Filip <feela@network.cz>
Mon, 24 May 1999 17:29:05 +0000 (17:29 +0000)
committerOndrej Filip <feela@network.cz>
Mon, 24 May 1999 17:29:05 +0000 (17:29 +0000)
proto/ospf/ospf.c

index 954df8e422a6b6b4b8d40d62d5bd046a88d6990f..de164881235e671eef62f0eacab6f8be6f0836b0 100644 (file)
@@ -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);
   }