From 0752ef0b2e9bbf6c7ab20ed0fe87840b3bd1b7f4 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 3 Nov 2005 12:35:21 +0000 Subject: 2005-11-03 Paul Jakma * connected.{c,h}: Include memory.h (connected_add_ipv4) Use MTYPE for ifc label. (connected_add_ipv6) Also should accept label. Store it in ifp. (connected_del_ipv4) Taking label as argument is pointless. * rt_netlink.c: (netlink_interface_addr) update label usage for connected_{add,delete} functions. * if_ioctl.c: (if_getaddrs) NULL label for connected_add_ipv6. * if_ioctl_solaris.c: (interface_list_ioctl) Pass LIFC_NOXMIT so we also find out about NOXMIT interfaces like VNI. Bit of hackery to turn interface names into the primary interface name, later with routing socket messages we only will about primary interfaces anyway, so we must normalise the name. (if_get_addr) take label as argument, so it can be passed to connected_add. If label is provided, then it is interface name to issue the ioctl for address information on, not the ifp name. (interface_list) List AF_UNSPEC too, just in case. * if_proc.c: (ifaddr_proc_ipv6) label for connected_add_ipv6. * interface.c: (if_addr_wakeup) Some very bogus code - sets IFF_RUNNING - add comment. (if_refresh) (ip_address_install) Use MTYPE for ifc label. * ioctl_solaris.c: (if_mangle_up) New function. Hackery to make IFF_UP reflect whether any addresses are left on the interface, as we get signalled for IFF_UP flags change on the primary interface only. Logical interfaces dont generate IFINFO, but we do get an RTM_DELADDR. (if_get_flags) Call if_mangle_up before return. * kernel_socket.c: (ifam_read) Fixup calls to connected_{add,delete} to match above changes. Rename gate variable to brd, less confusing. Pass the interface name as a label, if it is not same name as ifp->name. --- zebra/kernel_socket.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'zebra/kernel_socket.c') diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index f391d53a..c264437d 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -465,7 +465,7 @@ int ifam_read (struct ifa_msghdr *ifam) { struct interface *ifp; - union sockunion addr, mask, gate; + union sockunion addr, mask, brd; /* Check does this interface exist or not. */ ifp = if_lookup_by_index (ifam->ifam_index); @@ -476,7 +476,7 @@ ifam_read (struct ifa_msghdr *ifam) } /* Allocate and read address information. */ - ifam_read_mesg (ifam, &addr, &mask, &gate); + ifam_read_mesg (ifam, &addr, &mask, &brd); /* Check interface flag for implicit up of the interface. */ if_refresh (ifp); @@ -488,11 +488,12 @@ 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), - &gate.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), - &gate.sin.sin_addr, NULL); + &brd.sin.sin_addr); break; #ifdef HAVE_IPV6 case AF_INET6: @@ -505,12 +506,13 @@ ifam_read (struct ifa_msghdr *ifam) connected_add_ipv6 (ifp, &addr.sin6.sin6_addr, ip6_masklen (mask.sin6.sin6_addr), - &gate.sin6.sin6_addr); + &brd.sin6.sin6_addr, + (isalias ? ifname : NULL) ); else connected_delete_ipv6 (ifp, &addr.sin6.sin6_addr, ip6_masklen (mask.sin6.sin6_addr), - &gate.sin6.sin6_addr); + &brd.sin6.sin6_addr); break; #endif /* HAVE_IPV6 */ default: -- cgit v1.2.1