summaryrefslogtreecommitdiffstats
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorpaul <paul>2005-11-03 12:35:21 +0000
committerpaul <paul>2005-11-03 12:35:21 +0000
commit1cded5becce446c14f1ae51151ea3e3284876a9d (patch)
tree387e7bdd265bdb617dfacb4adc98ce5064584b42 /zebra/interface.c
parent097f8dae4b9e6e5b258ec13afe604a3aab5618f1 (diff)
downloadquagga-1cded5becce446c14f1ae51151ea3e3284876a9d.tar.bz2
quagga-1cded5becce446c14f1ae51151ea3e3284876a9d.tar.xz
2005-11-03 Paul Jakma <paul.jakma@sun.com>
* 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.
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 49fffcf5..5f9c7a23 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -209,6 +209,16 @@ if_addr_wakeup (struct interface *ifp)
{
if (! if_is_up (ifp))
{
+ /* XXX: WTF is it trying to set flags here?
+ * caller has just gotten a new interface, has been
+ * handed the flags already. This code has no business
+ * trying to override administrative status of the interface.
+ * The only call path to here which doesn't originate from
+ * kernel event is irdp - what on earth is it trying to do?
+ *
+ * further RUNNING is not a settable flag on any system
+ * I (paulj) am aware of.
+ */
if_set_flags (ifp, IFF_UP | IFF_RUNNING);
if_refresh (ifp);
}
@@ -236,6 +246,7 @@ if_addr_wakeup (struct interface *ifp)
{
if (! if_is_up (ifp))
{
+ /* XXX: See long comment above */
if_set_flags (ifp, IFF_UP | IFF_RUNNING);
if_refresh (ifp);
}
@@ -1172,7 +1183,7 @@ ip_address_install (struct vty *vty, struct interface *ifp,
/* Label. */
if (label)
- ifc->label = strdup (label);
+ ifc->label = XSTRDUP (MTYPE_CONNECTED_LABEL, label);
/* Add to linked list. */
listnode_add (ifp->connected, ifc);
@@ -1363,7 +1374,7 @@ ipv6_address_install (struct vty *vty, struct interface *ifp,
/* Label. */
if (label)
- ifc->label = strdup (label);
+ ifc->label = XSTRDUP (MTYPE_CONNECTED_LABEL, label);
/* Add to linked list. */
listnode_add (ifp->connected, ifc);