2007-08-02  Denis Ovsienko

	* rt_socket.c (kernel_rtm_ipv4): Only call rtm_write when changes
	are intended.  Don't set FIB flag on failed additions (such as
	occur with multiple paths.


http://bugzilla.quagga.net/attachment.cgi?id=235&action=view
This commit is contained in:
Greg Troxel 2007-08-02 14:07:07 +00:00
parent 14838194d6
commit f76594a2e3
2 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2007-08-02 Denis Ovsienko
* rt_socket.c (kernel_rtm_ipv4): Only call rtm_write when changes
are intended. Don't set FIB flag on failed additions (such as
occur with multiple paths.
2007-06-25 Denis Ovsienko 2007-06-25 Denis Ovsienko
* zebra_rib.c: (rib_add_ipv4_multipath) Loop through RIB * zebra_rib.c: (rib_add_ipv4_multipath) Loop through RIB

View File

@ -99,9 +99,7 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
if ((cmd == RTM_ADD if ((cmd == RTM_ADD
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE)) && CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|| (cmd == RTM_DELETE || (cmd == RTM_DELETE
#if 0
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) && CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
#endif
)) ))
{ {
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE)) if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
@ -138,9 +136,6 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
} }
} }
if (cmd == RTM_ADD)
SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
if (gate && p->prefixlen == 32) if (gate && p->prefixlen == 32)
mask = NULL; mask = NULL;
else else
@ -152,7 +147,6 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ #endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
mask = &sin_mask; mask = &sin_mask;
} }
}
error = rtm_write (cmd, error = rtm_write (cmd,
(union sockunion *)&sin_dest, (union sockunion *)&sin_dest,
@ -169,8 +163,13 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
nexthop_num, error); nexthop_num, error);
} }
#endif #endif
if (error == 0)
nexthop_num++; {
nexthop_num++;
if (cmd == RTM_ADD)
SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
}
}
} }
/* If there is no useful nexthop then return. */ /* If there is no useful nexthop then return. */