From f63f06da2e7be6b17c72dd6110aae179f42f3700 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 8 Apr 2011 12:44:43 +0100 Subject: general: remove inline qualifiers and move in-header functions to objects * (general) Move functions in headers into files, to be compiled into shared object files. Remove inline qualifier from functions. Let the compiler do the work. --- zebra/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 03e7ff71..933d6425 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -216,7 +216,7 @@ if_subnet_delete (struct interface *ifp, struct connected *ifc) * interface will affect only the primary interface/address on Solaris. ************************End Solaris flags hacks *********************** */ -static inline void +static void if_flags_mangle (struct interface *ifp, uint64_t *newflags) { #ifdef SUNOS_5 -- cgit v1.2.1 From d660f698427277ce695a5b756f3143c8304274ea Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Fri, 30 Dec 2011 21:55:49 +0400 Subject: zebra: justify some IPv6 ND RA timers wrt RFC There was a regression introduced with the previous commit: "ipv6 nd home-agent-lifetime 1800000" appeared by default in every interface section of running-config, although this command is invalid in this context. Troubleshooting and bugfixing of the issue tracked out several bugs in router advertisement procedures, some of which are fixed in this commit. * zebra/interface.c * if_zebra_new_hook(): update to treat -1 as "uninitialized" * nd_dump_vty(): idem * zebra/rtadv.c * rtadv_send_packet(): update processing of "router lifetime" field, "home agent" option and "home agent lifetime" field to conform to RFC6275 better * ipv6_nd_ra_interval_msec(): update MaxRtrAdvInterval range check, make sure it never exceeds (initialized) AdvDefaultLifetime * ipv6_nd_ra_interval(): idem * ipv6_nd_ra_lifetime(): update AdvDefaultLifetime range check, make sure it never falls below MaxRtrAdvInterval * ipv6_nd_homeagent_lifetime(): update HomeAgentLifetime range check * no_ipv6_nd_ra_lifetime(): update to treat -1 as "uninitialized" * no_ipv6_nd_homeagent_lifetime(): idem * rtadv_config_write(): idem --- zebra/interface.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 933d6425..22422594 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -76,9 +76,9 @@ if_zebra_new_hook (struct interface *ifp) rtadv->AdvReachableTime = 0; rtadv->AdvRetransTimer = 0; rtadv->AdvCurHopLimit = 0; - rtadv->AdvDefaultLifetime = RTADV_ADV_DEFAULT_LIFETIME; + rtadv->AdvDefaultLifetime = -1; /* derive from MaxRtrAdvInterval */ rtadv->HomeAgentPreference = 0; - rtadv->HomeAgentLifetime = RTADV_ADV_DEFAULT_LIFETIME; + rtadv->HomeAgentLifetime = -1; /* derive from AdvDefaultLifetime */ rtadv->AdvIntervalOption = 0; rtadv->DefaultPreference = RTADV_PREF_MEDIUM; @@ -630,8 +630,12 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) vty_out (vty, " ND router advertisements are sent every " "%d seconds%s", interval / 1000, VTY_NEWLINE); - vty_out (vty, " ND router advertisements live for %d seconds%s", - rtadv->AdvDefaultLifetime, VTY_NEWLINE); + if (rtadv->AdvDefaultLifetime != -1) + vty_out (vty, " ND router advertisements live for %d seconds%s", + rtadv->AdvDefaultLifetime, VTY_NEWLINE); + else + vty_out (vty, " ND router advertisements lifetime tracks ra-interval%s", + VTY_NEWLINE); vty_out (vty, " ND router advertisement default router preference is " "%s%s", rtadv_pref_strs[rtadv->DefaultPreference], VTY_NEWLINE); @@ -642,9 +646,19 @@ nd_dump_vty (struct vty *vty, struct interface *ifp) vty_out (vty, " Hosts use stateless autoconfig for addresses.%s", VTY_NEWLINE); if (rtadv->AdvHomeAgentFlag) + { vty_out (vty, " ND router advertisements with " "Home Agent flag bit set.%s", VTY_NEWLINE); + if (rtadv->HomeAgentLifetime != -1) + vty_out (vty, " Home Agent lifetime is %u seconds%s", + rtadv->HomeAgentLifetime, VTY_NEWLINE); + else + vty_out (vty, " Home Agent lifetime tracks ra-lifetime%s", + VTY_NEWLINE); + vty_out (vty, " Home Agent preference is %u%s", + rtadv->HomeAgentPreference, VTY_NEWLINE); + } if (rtadv->AdvIntervalOption) vty_out (vty, " ND router advertisements with Adv. Interval option.%s", VTY_NEWLINE); -- cgit v1.2.1