summaryrefslogtreecommitdiff
path: root/zebra/connected.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/connected.c')
-rw-r--r--zebra/connected.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/zebra/connected.c b/zebra/connected.c
index 2198ddf5ea..23f2f666a0 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -495,7 +495,8 @@ void connected_delete_ipv4(struct interface *ifp, int flags,
/* Add connected IPv6 route to the interface. */
void connected_add_ipv6(struct interface *ifp, int flags, struct in6_addr *addr,
- uint8_t prefixlen, const char *label)
+ struct in6_addr *broad, uint8_t prefixlen,
+ const char *label)
{
struct prefix_ipv6 *p;
struct connected *ifc;
@@ -518,6 +519,20 @@ void connected_add_ipv6(struct interface *ifp, int flags, struct in6_addr *addr,
p->prefixlen = prefixlen;
ifc->address = (struct prefix *)p;
+ if (broad) {
+ p = prefix_ipv6_new();
+ p->family = AF_INET6;
+ IPV6_ADDR_COPY(&p->prefix, broad);
+ p->prefixlen = prefixlen;
+ ifc->destination = (struct prefix *)p;
+ } else {
+ if (CHECK_FLAG(ifc->flags, ZEBRA_IFA_PEER)) {
+ zlog_warn("warning: %s called for interface %s with peer flag set, but no peer address supplied",
+ __func__, ifp->name);
+ UNSET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
+ }
+ }
+
/* Label of this address. */
if (label)
ifc->label = XSTRDUP(MTYPE_CONNECTED_LABEL, label);
@@ -536,9 +551,9 @@ void connected_add_ipv6(struct interface *ifp, int flags, struct in6_addr *addr,
}
void connected_delete_ipv6(struct interface *ifp, struct in6_addr *address,
- uint8_t prefixlen)
+ struct in6_addr *broad, uint8_t prefixlen)
{
- struct prefix p;
+ struct prefix p, d;
struct connected *ifc;
memset(&p, 0, sizeof(struct prefix));
@@ -546,7 +561,14 @@ void connected_delete_ipv6(struct interface *ifp, struct in6_addr *address,
memcpy(&p.u.prefix6, address, sizeof(struct in6_addr));
p.prefixlen = prefixlen;
- ifc = connected_check(ifp, &p);
+ if (broad) {
+ memset(&d, 0, sizeof(struct prefix));
+ d.family = AF_INET6;
+ IPV6_ADDR_COPY(&d.u.prefix, broad);
+ d.prefixlen = prefixlen;
+ ifc = connected_check_ptp(ifp, &p, &d);
+ } else
+ ifc = connected_check_ptp(ifp, &p, NULL);
connected_delete_helper(ifc, &p);
}