From 9a158361da249e0eab1e0f7bd2c7dbe9f32eddfa Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 6 May 1999 21:38:11 +0000 Subject: I rewrote the interface handling code, so that it supports multiple addresses per interface (needed for example for IPv6 support). Visible changes: o struct iface now contains a list of all interface addresses (represented by struct ifa), iface->addr points to the primary address (if any). o Interface has IF_UP set iff it's up and it has a primary address. o IF_UP is now independent on IF_IGNORED (i.e., you need to test IF_IGNORED in the protocols; I've added this, but please check). o The if_notify_change hook has been simplified (only one interface pointer etc.). o Introduced a ifa_notify_change hook. (For now, only the Direct protocol does use it -- it's wise to just listen to device routes in all other protocols.) o Removed IF_CHANGE_FLAGS notifier flag (it was meaningless anyway). o Updated all the code except netlink (I'll look at it tomorrow) to match the new semantics (please look at your code to ensure I did it right). Things to fix: o Netlink. o Make krt-iface interpret "eth0:1"-type aliases as secondary addresses. --- sysdep/linux/netlink/netlink.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sysdep/linux/netlink') diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index 31dd608..5a15607 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -407,12 +407,16 @@ krt_if_scan(struct kif_proto *p) * Routes */ -int /* FIXME: Check use of this function in krt.c */ +int krt_capable(rte *e) { rta *a = e->attrs; - if (a->cast != RTC_UNICAST) /* FIXME: For IPv6, we might support anycasts as well */ + if (a->cast != RTC_UNICAST +#ifdef IPV6 + && a->cast != RTC_ANYCAST +#endif + ) return 0; if (a->source == RTS_DEVICE) /* Kernel takes care of device routes itself */ return 0; @@ -597,7 +601,7 @@ nl_parse_route(struct krt_proto *p, struct nlmsghdr *h, int scan) net = net_get(&master_table, dst, i->rtm_dst_len); ra.proto = &p->p; ra.source = RTS_INHERIT; - ra.scope = SCOPE_UNIVERSE; /* FIXME: Use kernel scope? */ + ra.scope = SCOPE_UNIVERSE; ra.cast = RTC_UNICAST; ra.flags = ra.aflags = 0; ra.from = IPA_NONE; -- cgit v1.2.3