]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pbrd:fix mismatching in match src-dst
authorChirag Shah <chirag@nvidia.com>
Fri, 17 Mar 2023 04:47:07 +0000 (21:47 -0700)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 19 Mar 2023 04:43:01 +0000 (04:43 +0000)
upstream commit 67765a232d has incorect
address family check which prevent from
deleting src/dst config under pbr rule.

Ticket:#3405024
Issue:3405024
Testing Done:

Config:

pbr-map map6 seq 1
 match src-ip 2000::200:100:100:0/96
 match dst-ip 2000::100:100:100:0/96
 set nexthop-group group3

Before:
torc-12(config)# pbr-map map6 seq 1
torc-12(config-pbr-map)# no match src-ip 2000::200:100:100:0/96
Cannot mismatch families within match src/dst

After:
torc-12(config)# pbr-map map6 seq 1
torc-12(config-pbr-map)# no match src-ip 2000::200:100:100:0/96
torc-12(config-pbr-map)#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 03494887eddaa255d9b6a217bfff60cc63cede42)

pbrd/pbr_vty.c

index dcb251beba62e8d701b79474c44c4fc5d7cef2df..60e215e731ef3bcb0e031430e1ab62fee3b953ec 100644 (file)
@@ -140,7 +140,7 @@ DEFPY(pbr_map_match_src, pbr_map_match_src_cmd,
        if (!pbrms)
                return CMD_WARNING_CONFIG_FAILED;
 
-       if (pbrms->dst && pbrms->family && prefix->family != pbrms->family) {
+       if (pbrms->dst && prefix->family != pbrms->dst->family) {
                vty_out(vty, "Cannot mismatch families within match src/dst\n");
                return CMD_WARNING_CONFIG_FAILED;
        }
@@ -176,7 +176,7 @@ DEFPY(pbr_map_match_dst, pbr_map_match_dst_cmd,
        if (!pbrms)
                return CMD_WARNING_CONFIG_FAILED;
 
-       if (pbrms->src && pbrms->family && prefix->family != pbrms->family) {
+       if (pbrms->src && prefix->family != pbrms->src->family) {
                vty_out(vty, "Cannot mismatch families within match src/dst\n");
                return CMD_WARNING_CONFIG_FAILED;
        }