diff options
Diffstat (limited to 'ospfd')
| -rw-r--r-- | ospfd/ChangeLog | 9 | ||||
| -rw-r--r-- | ospfd/ospf_interface.c | 19 | ||||
| -rw-r--r-- | ospfd/ospf_interface.h | 3 | ||||
| -rw-r--r-- | ospfd/ospf_zebra.c | 12 | 
4 files changed, 42 insertions, 1 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index fbffe6a2..98cabbd6 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,5 +1,14 @@  2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu> +	* ospf_zebra.c: (ospf_interface_state_up) If the MTU of an operative +	  interface changes, print a debug message and call ospf_if_reset() +	  to simulate down/up on the interface. +	* ospf_interface.h: Declare new function ospf_if_reset(). +	* ospf_interface.c: (ospf_if_reset) New function to call ospf_if_down +	  and ospf_if_up for all ospf interfaces attached to an interface. + +2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu> +  	* ospf_packet.c: (ospf_write_frags) Enhance error message to  	  show MTU.  Also make function static.  	  (ospf_write) Enhance error message to show interface name and MTU. diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index df71fad6..b76abe58 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -102,6 +102,25 @@ ospf_if_recalculate_output_cost (struct interface *ifp)      }  } +/* Simulate down/up on the interface.  This is needed, for example, when  +   the MTU changes. */ +void +ospf_if_reset(struct interface *ifp) +{ +  struct route_node *rn; +   +  for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn)) +    { +      struct ospf_interface *oi; +       +      if ( (oi = rn->info) == NULL) +	continue; + +      ospf_if_down(oi); +      ospf_if_up(oi); +    } +} +  void  ospf_if_reset_variables (struct ospf_interface *oi)  { diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h index b49a3517..b3fb3ba3 100644 --- a/ospfd/ospf_interface.h +++ b/ospfd/ospf_interface.h @@ -234,6 +234,9 @@ int ospf_if_is_enable (struct ospf_interface *);  int ospf_if_get_output_cost (struct ospf_interface *);  void ospf_if_recalculate_output_cost (struct interface *); +/* Simulate down/up on the interface. */ +extern void ospf_if_reset (struct interface *); +  struct ospf_interface *ospf_vl_new (struct ospf *, struct ospf_vl_data *);  struct ospf_vl_data *ospf_vl_data_new (struct ospf_area *, struct in_addr);  struct ospf_vl_data *ospf_vl_lookup (struct ospf_area *, struct in_addr); diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 8468aed9..300103e1 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -168,7 +168,6 @@ ospf_interface_state_up (int command, struct zclient *zclient,                           zebra_size_t length)  {    struct interface *ifp; -  struct interface if_tmp;    struct ospf_interface *oi;    struct route_node *rn; @@ -181,6 +180,7 @@ ospf_interface_state_up (int command, struct zclient *zclient,    if (if_is_operative (ifp))      {        /* Temporarily keep ifp values. */ +      struct interface if_tmp;        memcpy (&if_tmp, ifp, sizeof (struct interface));        zebra_interface_if_set_value (zclient->ibuf, ifp); @@ -196,6 +196,16 @@ ospf_interface_state_up (int command, struct zclient *zclient,            ospf_if_recalculate_output_cost (ifp);          } + +      if (if_tmp.mtu != ifp->mtu) +        { +          if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE)) +            zlog_debug ("Zebra: Interface[%s] MTU change %u -> %u.", +                       ifp->name, if_tmp.mtu, ifp->mtu); + +	  /* Must reset the interface (simulate down/up) when MTU changes. */ +          ospf_if_reset(ifp); +	}        return 0;      }  | 
