You need fix delete_entry() function also. Jiangxin
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Tuesday, June 12, 2012 8:27 AM To: [email protected] Subject: [Xorp-hackers] [PATCH] xorp: fea: data_plane: fibconfig: Fix usingof rtmsg scope parameter From: Igor Maravic <[email protected]> When the route doesn't have the specified gateway or nexthop it's scope should be link(RT_SCOPE_LINK). Otherwise it should be global(RT_SCOPE_UNIVERSE). Referenced from iproute2. Signed-off-by: Igor Maravic <[email protected]> --- .../fibconfig_entry_set_netlink_socket.cc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/xorp/fea/data_plane/fibconfig/fibconfig_entry_set_netlink_socket.cc b/xorp/fea/data_plane/fibconfig/fibconfig_entry_set_netlink_socket.cc index 5437cf0..b367469 100644 --- a/xorp/fea/data_plane/fibconfig/fibconfig_entry_set_netlink_socket.cc +++ b/xorp/fea/data_plane/fibconfig/fibconfig_entry_set_netlink_socket.c +++ c @@ -201,7 +201,7 @@ FibConfigEntrySetNetlinkSocket::add_entry(const FteX& fte) rtmsg->rtm_src_len = 0; rtmsg->rtm_tos = 0; rtmsg->rtm_protocol = RTPROT_XORP; // Mark this as a XORP route - rtmsg->rtm_scope = RT_SCOPE_UNIVERSE; + rtmsg->rtm_scope = RT_SCOPE_LINK; rtmsg->rtm_type = RTN_UNICAST; rtmsg->rtm_flags = RTM_F_NOTIFY; @@ -248,6 +248,7 @@ FibConfigEntrySetNetlinkSocket::add_entry(const FteX& fte) data = static_cast<uint8_t*>(RTA_DATA(rtattr)); fte.nexthop().copy_out(data); nlh->nlmsg_len = NLMSG_ALIGN(nlh->nlmsg_len) + rta_len; + rtmsg->rtm_scope = RT_SCOPE_UNIVERSE; } // Get the interface index, if it exists -- 1.7.5.4 _______________________________________________ Xorp-hackers mailing list [email protected] http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers _______________________________________________ Xorp-hackers mailing list [email protected] http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
