summaryrefslogtreecommitdiff
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorajs <ajs>2005-01-29 15:52:07 +0000
committerajs <ajs>2005-01-29 15:52:07 +0000
commitc3eab8714368569d25f6dc87f6620528e0d7a118 (patch)
treed6366cef5ff108f6628713e3573eeb72b81847bf /ospfd/ospf_packet.c
parentb1aa147d09b0e06992cdb39ed11b46df0a3b984f (diff)
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.
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index f636e2be..45dabc54 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -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