From d34b8991b4c156ff3281558dd8252d3787ae8d8b Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 17 Jan 2006 18:03:04 +0000 Subject: [zebra] Record NEWADDR metric on PF_ROUTE, print CACHEINFO debug on netlink 2006-01-17 Paul Jakma * kernel_socket.c: (ifam_read) Read metric from RTM_NEWADDR. If interface is an alias, pass the alias as a label for connected_add_ipv{4,6}. * rt_netlink.c: (netlink_interface_addr) print out IFA_CACHEINFO info, if present, when debugging kernel messages. --- zebra/kernel_socket.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'zebra/kernel_socket.c') diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index c4c1f2c62..ae19ef8fe 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -544,6 +544,8 @@ ifam_read (struct ifa_msghdr *ifam) if (ifnlen && strncmp (ifp->name, ifname, INTERFACE_NAMSIZ)) isalias = 1; + ifp->metric = ifam->ifam_metric; + /* Check interface flag for implicit up of the interface. */ if_refresh (ifp); @@ -554,7 +556,8 @@ ifam_read (struct ifa_msghdr *ifam) if (ifam->ifam_type == RTM_NEWADDR) connected_add_ipv4 (ifp, 0, &addr.sin.sin_addr, ip_masklen (mask.sin.sin_addr), - &brd.sin.sin_addr, NULL); + &brd.sin.sin_addr, + (isalias ? ifname : NULL)); else connected_delete_ipv4 (ifp, 0, &addr.sin.sin_addr, ip_masklen (mask.sin.sin_addr), @@ -571,7 +574,8 @@ ifam_read (struct ifa_msghdr *ifam) connected_add_ipv6 (ifp, &addr.sin6.sin6_addr, ip6_masklen (mask.sin6.sin6_addr), - &brd.sin6.sin6_addr, NULL); + &brd.sin6.sin6_addr, + (isalias ? ifname : NULL)); else connected_delete_ipv6 (ifp, &addr.sin6.sin6_addr, -- cgit v1.2.3