Skip to content

Commit 1e3f3a9

Browse files
committed
bgpd, yang: add gretap encapsulation type in route-map
Add support for gretap encapsulation type. Signed-off-by: Philippe Guibert <[email protected]>
1 parent 07b3ee7 commit 1e3f3a9

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

bgpd/bgp_routemap.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ route_set_l3vpn_nexthop_encapsulation(void *rule, const struct prefix *prefix,
22942294

22952295
path = object;
22962296

2297-
if (rins->zif_type != ZEBRA_IF_GRE)
2297+
if (rins->zif_type != ZEBRA_IF_GRE && rins->zif_type != ZEBRA_IF_GRETAP)
22982298
return RMAP_OKAY;
22992299

23002300
SET_FLAG(path->attr->rmap_change_flags, BATTR_RMAP_L3VPN_ACCEPT_GRE);
@@ -2310,7 +2310,10 @@ static void *route_set_l3vpn_nexthop_encapsulation_compile(const char *arg)
23102310
sizeof(struct rmap_l3vpn_nexthop_encapsulation_set));
23112311

23122312
/* XXX ALL GRE modes are accepted for now: gre or ip6gre */
2313-
rins->zif_type = ZEBRA_IF_GRE;
2313+
if (strmatch(arg, "gretap"))
2314+
rins->zif_type = ZEBRA_IF_GRETAP;
2315+
else
2316+
rins->zif_type = ZEBRA_IF_GRE;
23142317

23152318
return rins;
23162319
}
@@ -6275,12 +6278,13 @@ DEFUN_YANG (no_set_distance,
62756278
}
62766279

62776280
DEFPY_YANG(set_l3vpn_nexthop_encapsulation, set_l3vpn_nexthop_encapsulation_cmd,
6278-
"[no] set l3vpn next-hop encapsulation gre",
6281+
"[no] set l3vpn next-hop encapsulation <gre|gretap>$ziftype",
62796282
NO_STR SET_STR
62806283
"L3VPN operations\n"
62816284
"Next hop Information\n"
62826285
"Encapsulation options (for BGP only)\n"
6283-
"Accept L3VPN traffic over GRE encapsulation\n")
6286+
"Accept L3VPN traffic over GRE encapsulation\n"
6287+
"Accept L3VPN traffic over GRETAP encapsulation\n")
62846288
{
62856289
const char *xpath =
62866290
"./set-action[action='frr-bgp-route-map:set-l3vpn-nexthop-encapsulation']";
@@ -6297,7 +6301,7 @@ DEFPY_YANG(set_l3vpn_nexthop_encapsulation, set_l3vpn_nexthop_encapsulation_cmd,
62976301
if (operation == NB_OP_DESTROY)
62986302
return nb_cli_apply_changes(vty, NULL);
62996303

6300-
nb_cli_enqueue_change(vty, xpath_value, NB_OP_MODIFY, "gre");
6304+
nb_cli_enqueue_change(vty, xpath_value, NB_OP_MODIFY, ziftype);
63016305

63026306
return nb_cli_apply_changes(vty, NULL);
63036307
}

yang/frr-bgp-route-map.yang

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,11 @@ identity set-extcommunity-color {
13661366
description
13671367
"GRE protocol";
13681368
}
1369+
enum "gretap" {
1370+
value 1;
1371+
description
1372+
"GRE protocol";
1373+
}
13691374
}
13701375
description
13711376
"Specify L3VPN traffic over other than LSP encapsulation value";

0 commit comments

Comments
 (0)