summaryrefslogtreecommitdiffstats
path: root/pbrd/pbr_zebra.c
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2018-03-26 21:16:09 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-04-06 19:22:43 +0200
commit49027ce8568ca773b0fc441e4abbf71d0d605c2c (patch)
treeff042cafbaa7c32454c178dfb410855f01419ff7 /pbrd/pbr_zebra.c
parentpbrd: Remove table and rule range commands (diff)
downloadfrr-49027ce8568ca773b0fc441e4abbf71d0d605c2c.tar.xz
frr-49027ce8568ca773b0fc441e4abbf71d0d605c2c.zip
pbrd: adjust/remove the rule correctly when dst and/or src removed
When the last match criteria was removed (dst-ip or src-ip), we were not deleting the rule correctly for ipv6. This fix retains the needed src-ip/dst-ip during the pbr_send_pbr_map process so the appropriate information is available for the rule delete. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Diffstat (limited to 'pbrd/pbr_zebra.c')
-rw-r--r--pbrd/pbr_zebra.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 971fe65aa..a1a2d34ac 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -455,7 +455,7 @@ void pbr_send_rnh(struct nexthop *nhop, bool reg)
static void pbr_encode_pbr_map_sequence_prefix(struct stream *s,
struct prefix *p,
- u_char family)
+ unsigned char family)
{
struct prefix any;
@@ -474,14 +474,11 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
struct pbr_map_sequence *pbrms,
struct interface *ifp)
{
- u_char family;
+ unsigned char family;
family = AF_INET;
- if (pbrms->src)
- family = pbrms->src->family;
-
- if (pbrms->dst)
- family = pbrms->dst->family;
+ if (pbrms->family)
+ family = pbrms->family;
stream_putl(s, pbrms->seqno);
stream_putl(s, pbrms->ruleno);