summaryrefslogtreecommitdiffstats
path: root/zebra/rt_socket.c
diff options
context:
space:
mode:
authorgdt <gdt>2007-08-02 14:07:07 +0000
committergdt <gdt>2007-08-02 14:07:07 +0000
commit947156abf7092a4be4cdea37933072469388ea38 (patch)
tree5f2c071f87208137e9d0158b318f2576c21b4180 /zebra/rt_socket.c
parentb39b27d6d5d4fc92c56eafcad655bc06b4a04c58 (diff)
downloadquagga-947156abf7092a4be4cdea37933072469388ea38.tar.bz2
quagga-947156abf7092a4be4cdea37933072469388ea38.tar.xz
Bugzilla #384.
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
Diffstat (limited to 'zebra/rt_socket.c')
-rw-r--r--zebra/rt_socket.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c
index 0182fbd6..0cdb0aca 100644
--- a/zebra/rt_socket.c
+++ b/zebra/rt_socket.c
@@ -99,9 +99,7 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
if ((cmd == RTM_ADD
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
|| (cmd == RTM_DELETE
-#if 0
&& CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)
-#endif
))
{
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)
mask = NULL;
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 */
mask = &sin_mask;
}
- }
error = rtm_write (cmd,
(union sockunion *)&sin_dest,
@@ -169,8 +163,13 @@ kernel_rtm_ipv4 (int cmd, struct prefix *p, struct rib *rib, int family)
nexthop_num, error);
}
#endif
-
- nexthop_num++;
+ if (error == 0)
+ {
+ nexthop_num++;
+ if (cmd == RTM_ADD)
+ SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
+ }
+ }
}
/* If there is no useful nexthop then return. */