[Xorp-hackers] [PATCH] xorp: fea: data_plane: fibconfig: Fix usingof rtmsg scope parameter

Jiangxin Hu jiangxin.hu at crc.gc.ca
Tue Jun 12 07:23:45 PDT 2012


You need fix delete_entry() function also.

Jiangxin 

-----Original Message-----
From: xorp-hackers-bounces at icir.org [mailto:xorp-hackers-bounces at icir.org]
On Behalf Of igorm at etf.rs
Sent: Tuesday, June 12, 2012 8:27 AM
To: xorp-hackers at icir.org
Subject: [Xorp-hackers] [PATCH] xorp: fea: data_plane: fibconfig: Fix
usingof rtmsg scope parameter

From: Igor Maravic <igorm at etf.rs>

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 <igorm at etf.rs>
---
 .../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
Xorp-hackers at icir.org
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers



More information about the Xorp-hackers mailing list