summaryrefslogtreecommitdiff
path: root/bgpd/bgp_flowspec_util.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-06-02 20:03:52 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-06-29 16:11:47 +0300
commitb08dcc3f3f0b128b4662f3be86eb53075e93ac9f (patch)
treea5d0029da0b919ab46468fb0abb011f827d7df3c /bgpd/bgp_flowspec_util.c
parent176d039a2792f4ccc901a4b04efeb934fdeec050 (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 'bgpd/bgp_flowspec_util.c')
-rw-r--r--bgpd/bgp_flowspec_util.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/bgpd/bgp_flowspec_util.c b/bgpd/bgp_flowspec_util.c
index 23baa0184e..348dc7c9d1 100644
--- a/bgpd/bgp_flowspec_util.c
+++ b/bgpd/bgp_flowspec_util.c
@@ -227,12 +227,8 @@ int bgp_flowspec_ip_address(enum bgp_flowspec_util_nlri_t type,
BGP_FLOWSPEC_STRING_DISPLAY_MAX);
break;
case BGP_FLOWSPEC_CONVERT_TO_NON_OPAQUE:
- if (prefix) {
- if (prefix_local.family == AF_INET)
- PREFIX_COPY_IPV4(prefix, &prefix_local);
- else
- PREFIX_COPY_IPV6(prefix, &prefix_local);
- }
+ if (prefix)
+ prefix_copy(prefix, &prefix_local);
break;
case BGP_FLOWSPEC_VALIDATE_ONLY:
default: