]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Sat, 29 Jan 2005 15:52:07 +0000 (15:52 +0000)
committerajs <ajs>
Sat, 29 Jan 2005 15:52:07 +0000 (15:52 +0000)
* ospf_packet.c: (ospf_packet_add) If oi->obuf is NULL, print
an error message and return.
(ospf_read) If the interface state is ISM_InterfaceDown, issue
a warning message and ignore the packet.

ospfd/ChangeLog
ospfd/ospf_packet.c

index df87b11e071a8d4a2b529425b9a3e7a0f6534557..1ff7c6dc87f51546addb0e592982faa412e180ef 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * ospf_packet.c: (ospf_packet_add) If oi->obuf is NULL, print
+       an error message and return.
+       (ospf_read) If the interface state is ISM_InterfaceDown, issue
+       a warning message and ignore the packet.
+
 2005-01-10  Greg Troxel  <gdt@fnord.ir.bbn.com>
 
        * ospf_packet.h: Remove commented out definition of
index f636e2be6d4e52b06471cded183b3c5069efba1e..45dabc54f4bd5864662c0ab2a99aa6c3829856ed 100644 (file)
@@ -192,6 +192,17 @@ ospf_fifo_free (struct ospf_fifo *fifo)
 void
 ospf_packet_add (struct ospf_interface *oi, struct ospf_packet *op)
 {
+  if (!oi->obuf)
+    {
+      zlog_err("ospf_packet_add(interface %s in state %d [%s], packet type %s, "
+              "destination %s) called with NULL obuf, ignoring "
+              "(please report this bug)!\n",
+              IF_NAME(oi), oi->state, LOOKUP (ospf_ism_state_msg, oi->state),
+              ospf_packet_type_str[stream_getc_from(op->s, 1)],
+              inet_ntoa (op->dst));
+      return;
+    }
+
   /* Add packet to end of queue. */
   ospf_fifo_push (oi->obuf, op);
 
@@ -2419,6 +2430,14 @@ ospf_read (struct thread *thread)
       stream_free (ibuf);
       return 0;
     }
+  else if (oi->state == ISM_InterfaceDown)
+    {
+      zlog_warn ("Ignoring packet from [%s] received on interface that is "
+                "down [%s]",
+                 inet_ntoa (iph->ip_src), ifp->name); 
+      stream_free (ibuf);
+      return 0;
+    }
 
   /*
    * If the received packet is destined for AllDRouters, the packet