From 31a476c7e9014aa81dc0d50b4100431ab111bf3f Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 29 Sep 2003 19:54:53 +0000 Subject: 2003-09-29 Paul Jakma * zebra/connected.c: revert the 'generic PtP' patch as it causes far too many problems. People who use FreeSWAN should investigate native linux ipsec. * zebra/rt_netlink.c: ditto * lib/if.c: ditto * ripd/ripd.h: ditto * ripd/ripd.c: ditto * ripd/rip_interface.c: ditto * ospfd/ospfd.c: ditto * ospfd/ospf_snmp.c: ditto * bgpd/bgp_nexthop.c: ditto --- zebra/connected.c | 8 ++++---- zebra/rt_netlink.c | 60 +++++++++++++++++++++++++++--------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) (limited to 'zebra') diff --git a/zebra/connected.c b/zebra/connected.c index 280e423e..1d19258f 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -69,7 +69,7 @@ connected_up_ipv4 (struct interface *ifp, struct connected *ifc) p.prefixlen = addr->prefixlen; /* Point-to-point check. */ - if (ifc_pointopoint (ifc) && dest) + if (if_is_pointopoint (ifc) && dest) p.prefix = dest->prefix; else p.prefix = addr->prefix; @@ -163,7 +163,7 @@ connected_down_ipv4 (struct interface *ifp, struct connected *ifc) p.prefixlen = addr->prefixlen; /* Point-to-point check. */ - if (dest && ifc_pointopoint (ifc)) + if (dest && if_is_pointopoint (ifc)) p.prefix = dest->prefix; else p.prefix = addr->prefix; @@ -250,7 +250,7 @@ connected_up_ipv6 (struct interface *ifp, struct connected *ifc) p.family = AF_INET6; p.prefixlen = addr->prefixlen; - if (ifc_pointopoint (ifc) && dest) + if (if_is_pointopoint (ifp) && dest) { if (IN6_IS_ADDR_UNSPECIFIED (&dest->prefix)) p.prefix = addr->prefix; @@ -343,7 +343,7 @@ connected_down_ipv6 (struct interface *ifp, struct connected *ifc) p.family = AF_INET6; p.prefixlen = addr->prefixlen; - if (ifc_pointopoint (ifc) && dest) + if (if_is_pointopoint (ifp) && dest) { if (IN6_IS_ADDR_UNSPECIFIED (&dest->prefix)) p.prefix = addr->prefix; diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index a2efa17a..02cae6ee 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -487,7 +487,6 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h) void *broad = NULL; u_char flags = 0; char *label = NULL; - int peeronly = 0; ifa = NLMSG_DATA (h); @@ -539,40 +538,41 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h) if (tb[IFA_LABEL] && strcmp (ifp->name, RTA_DATA (tb[IFA_LABEL]))) zlog_info (" IFA_LABEL %s", RTA_DATA (tb[IFA_LABEL])); } - - /* peer or broadcast network? */ - if (ifa->ifa_family == AF_INET) - peeronly = if_is_pointopoint (ifp) || - ifa->ifa_prefixlen >= IPV4_MAX_PREFIXLEN - 1; -#ifdef HAVE_IPV6 - if (ifa->ifa_family == AF_INET6) + + if (tb[IFA_ADDRESS] == NULL) + tb[IFA_ADDRESS] = tb[IFA_LOCAL]; + + if (ifp->flags & IFF_POINTOPOINT) { - peeronly = if_is_pointopoint (ifp) || - ifa->ifa_prefixlen >= IPV6_MAX_PREFIXLEN - 1; + if (tb[IFA_LOCAL]) + { + addr = RTA_DATA (tb[IFA_LOCAL]); + if (tb[IFA_ADDRESS]) + broad = RTA_DATA (tb[IFA_ADDRESS]); + else + broad = NULL; + } + else + { + if (tb[IFA_ADDRESS]) + addr = RTA_DATA (tb[IFA_ADDRESS]); + else + addr = NULL; + } } -#endif /* HAVE_IPV6 */ - if (!(tb[IFA_LOCAL] && tb[IFA_ADDRESS])) + else { - /* FIXME: IPv6 Appears to have only IFA_ADDRESS */ - peeronly = 0; + if (tb[IFA_ADDRESS]) + addr = RTA_DATA (tb[IFA_ADDRESS]); + else + addr = NULL; + + if (tb[IFA_BROADCAST]) + broad = RTA_DATA(tb[IFA_BROADCAST]); + else + broad = NULL; } - /* network. prefixlen applies to IFA_ADDRESS rather than IFA_LOCAL */ - if (tb[IFA_ADDRESS] && !peeronly) - addr = RTA_DATA (tb[IFA_ADDRESS]); - else if (tb[IFA_LOCAL]) - addr = RTA_DATA (tb[IFA_LOCAL]); - else - addr = NULL; - - /* broadcast/peer */ - if (tb[IFA_BROADCAST]) - broad = RTA_DATA (tb[IFA_BROADCAST]); - else if (tb[IFA_ADDRESS] && peeronly) - broad = RTA_DATA (tb[IFA_ADDRESS]); /* peer address specified */ - else - broad = NULL; - /* Flags. */ if (ifa->ifa_flags & IFA_F_SECONDARY) SET_FLAG (flags, ZEBRA_IFA_SECONDARY); -- cgit v1.2.1