diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-06-02 20:03:52 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-06-29 16:11:47 +0300 |
| commit | b08dcc3f3f0b128b4662f3be86eb53075e93ac9f (patch) | |
| tree | a5d0029da0b919ab46468fb0abb011f827d7df3c /zebra/connected.c | |
| parent | 176d039a2792f4ccc901a4b04efeb934fdeec050 (diff) | |
*: unify prefix copying
There are a few places in the code where we use PREFIX_COPY(_IPV4/IPV6)
macro to copy a prefix. Let's always use prefix_copy function for this.
This should fix CID 1482142 and 1504610.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra/connected.c')
| -rw-r--r-- | zebra/connected.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/zebra/connected.c b/zebra/connected.c index d110ccf6dd..dc7193eb4c 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -198,7 +198,7 @@ static void connected_update(struct interface *ifp, struct connected *ifc) void connected_up(struct interface *ifp, struct connected *ifc) { afi_t afi; - struct prefix p = {0}; + struct prefix p; struct nexthop nh = { .type = NEXTHOP_TYPE_IFINDEX, .ifindex = ifp->ifindex, @@ -225,7 +225,7 @@ void connected_up(struct interface *ifp, struct connected *ifc) /* Ensure 'down' flag is cleared */ UNSET_FLAG(ifc->conf, ZEBRA_IFC_DOWN); - PREFIX_COPY(&p, CONNECTED_PREFIX(ifc)); + prefix_copy(&p, CONNECTED_PREFIX(ifc)); /* Apply mask to the network. */ apply_mask(&p); @@ -277,9 +277,9 @@ void connected_up(struct interface *ifp, struct connected *ifc) * resolve to the same network and mask */ for (ALL_LIST_ELEMENTS_RO(ifp->connected, cnode, c)) { - struct prefix cp = {0}; + struct prefix cp; - PREFIX_COPY(&cp, CONNECTED_PREFIX(c)); + prefix_copy(&cp, CONNECTED_PREFIX(c)); apply_mask(&cp); if (prefix_same(&cp, &p) && @@ -412,7 +412,7 @@ void connected_down(struct interface *ifp, struct connected *ifc) return; } - PREFIX_COPY(&p, CONNECTED_PREFIX(ifc)); + prefix_copy(&p, CONNECTED_PREFIX(ifc)); /* Apply mask to the network. */ apply_mask(&p); @@ -450,7 +450,7 @@ void connected_down(struct interface *ifp, struct connected *ifc) for (ALL_LIST_ELEMENTS_RO(ifp->connected, cnode, c)) { struct prefix cp; - PREFIX_COPY(&cp, CONNECTED_PREFIX(c)); + prefix_copy(&cp, CONNECTED_PREFIX(c)); apply_mask(&cp); if (prefix_same(&p, &cp) && |
