mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-14 19:16:28 +00:00
bgpd rfapi: advertise encap attribute when TT is valid and not MPLS.
Ensure tunnel type set based on rx'ed Ignore bad/mpls encap types. Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
parent
1b4ae82d37
commit
c65742c791
@ -2171,7 +2171,9 @@ bgp_attr_encap(
|
|||||||
stlv_last = tlv;
|
stlv_last = tlv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attre && (BGP_ATTR_ENCAP == type)) {
|
if (BGP_ATTR_ENCAP == type) {
|
||||||
|
if (!attre)
|
||||||
|
attre = bgp_attr_extra_get(attr);
|
||||||
attre->encap_tunneltype = tunneltype;
|
attre->encap_tunneltype = tunneltype;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2777,7 +2779,10 @@ bgp_packet_mpattr_tea(
|
|||||||
struct bgp_attr_encap_subtlv *st;
|
struct bgp_attr_encap_subtlv *st;
|
||||||
const char *attrname;
|
const char *attrname;
|
||||||
|
|
||||||
if (!attr || !attr->extra)
|
if (!attr || !attr->extra ||
|
||||||
|
(attrtype == BGP_ATTR_ENCAP &&
|
||||||
|
(!attr->extra->encap_tunneltype ||
|
||||||
|
attr->extra->encap_tunneltype == BGP_ENCAP_TYPE_MPLS)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (attrtype) {
|
switch (attrtype) {
|
||||||
@ -2808,11 +2813,6 @@ bgp_packet_mpattr_tea(
|
|||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* if no tlvs, don't make attr */
|
|
||||||
if (subtlvs == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* compute attr length */
|
/* compute attr length */
|
||||||
for (st = subtlvs; st; st = st->next) {
|
for (st = subtlvs; st; st = st->next) {
|
||||||
attrlenfield += (attrhdrlen + st->length);
|
attrlenfield += (attrhdrlen + st->length);
|
||||||
|
@ -513,7 +513,8 @@ vnc_import_bgp_add_route_mode_resolve_nve_one_bi (
|
|||||||
if (bi->attr && bi->attr->extra)
|
if (bi->attr && bi->attr->extra)
|
||||||
{
|
{
|
||||||
encaptlvs = bi->attr->extra->vnc_subtlvs;
|
encaptlvs = bi->attr->extra->vnc_subtlvs;
|
||||||
if (bi->attr->extra->encap_tunneltype != BGP_ENCAP_TYPE_MPLS)
|
if (bi->attr->extra->encap_tunneltype != BGP_ENCAP_TYPE_RESERVED &&
|
||||||
|
bi->attr->extra->encap_tunneltype != BGP_ENCAP_TYPE_MPLS)
|
||||||
{
|
{
|
||||||
if (opt != NULL)
|
if (opt != NULL)
|
||||||
opt->next = &optary[cur_opt];
|
opt->next = &optary[cur_opt];
|
||||||
|
Loading…
Reference in New Issue
Block a user