diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-16 11:17:52 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-16 11:17:52 -0400 |
| commit | f52d0a1a702875093b7dedfed9981f39619914b6 (patch) | |
| tree | dcd983db6e85f1542ac4020a7a429f5e3e6a65ff | |
| parent | 60c0687a9a0608f828ce36134638ea6974d733ea (diff) | |
zebra: Check for NULL in connected_add_ipv6
When I implemented the same functionality in add_ipv6 that
add_ipv4 has I just assumed that broad would not be NULL with
the ZEBRA_IFA_PEER flag set.
Modify the code to act similiar to the flow of control
in add_ipv4.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| -rw-r--r-- | zebra/connected.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/zebra/connected.c b/zebra/connected.c index 35b3b0f4a9..23f2f666a0 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -519,12 +519,18 @@ void connected_add_ipv6(struct interface *ifp, int flags, struct in6_addr *addr, p->prefixlen = prefixlen; ifc->address = (struct prefix *)p; - if (CHECK_FLAG(ifc->flags, ZEBRA_IFA_PEER)) { + 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. */ |
