mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-23 02:01:55 +00:00
Revert "Filter: Allow setting the 'onlink' route attribute in filters"
This reverts commit 7144c9ca46
.
The onlink attribute implementation collides with the nexthop attribute
behavior in v3; keeping it aside until finding out how to reimplement it
correctly.
This commit is contained in:
parent
7144c9ca46
commit
9dc9124cec
@ -1816,14 +1816,6 @@ Common route attributes are:
|
|||||||
creation/removal. Zero is returned for routes with undefined outgoing
|
creation/removal. Zero is returned for routes with undefined outgoing
|
||||||
interfaces. Read-only.
|
interfaces. Read-only.
|
||||||
|
|
||||||
<tag><label id="rta-onlink"><m/bool/ onlink</tag>
|
|
||||||
Onlink flag means that the specified nexthop is accessible on the
|
|
||||||
interface regardless of IP prefixes configured on the interface.
|
|
||||||
The attribute can be used to configure such next hops by first setting
|
|
||||||
<cf/onlink = true/ and <cf/ifname/, and then setting <cf/gw/. Possible
|
|
||||||
use case for setting this flag is to automatically build overlay IP-IP
|
|
||||||
networks on linux.
|
|
||||||
|
|
||||||
<tag><label id="rta-weight"><m/int/ weight</tag>
|
<tag><label id="rta-weight"><m/int/ weight</tag>
|
||||||
Multipath weight of route next hops. Valid values are 1-256. Reading
|
Multipath weight of route next hops. Valid values are 1-256. Reading
|
||||||
returns the weight of the first next hop, setting it sets weights of all
|
returns the weight of the first next hop, setting it sets weights of all
|
||||||
|
@ -305,7 +305,7 @@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN,
|
|||||||
IF, THEN, ELSE, CASE,
|
IF, THEN, ELSE, CASE,
|
||||||
FOR, IN, DO,
|
FOR, IN, DO,
|
||||||
TRUE, FALSE, RT, RO, UNKNOWN, GENERIC,
|
TRUE, FALSE, RT, RO, UNKNOWN, GENERIC,
|
||||||
FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, DEST, IFNAME, IFINDEX, WEIGHT, GW_MPLS, ONLINK,
|
FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, DEST, IFNAME, IFINDEX, WEIGHT, GW_MPLS,
|
||||||
PREFERENCE,
|
PREFERENCE,
|
||||||
ROA_CHECK, ASN, SRC, DST,
|
ROA_CHECK, ASN, SRC, DST,
|
||||||
IS_V4, IS_V6,
|
IS_V4, IS_V6,
|
||||||
@ -795,7 +795,6 @@ static_attr:
|
|||||||
| WEIGHT { $$ = f_new_static_attr(T_INT, SA_WEIGHT, 0); }
|
| WEIGHT { $$ = f_new_static_attr(T_INT, SA_WEIGHT, 0); }
|
||||||
| PREFERENCE { $$ = f_new_static_attr(T_INT, SA_PREF, 0); }
|
| PREFERENCE { $$ = f_new_static_attr(T_INT, SA_PREF, 0); }
|
||||||
| GW_MPLS { $$ = f_new_static_attr(T_INT, SA_GW_MPLS, 0); }
|
| GW_MPLS { $$ = f_new_static_attr(T_INT, SA_GW_MPLS, 0); }
|
||||||
| ONLINK { $$ = f_new_static_attr(T_BOOL, SA_ONLINK, 0); }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
term:
|
term:
|
||||||
|
@ -102,7 +102,6 @@ enum f_sa_code {
|
|||||||
SA_WEIGHT,
|
SA_WEIGHT,
|
||||||
SA_PREF,
|
SA_PREF,
|
||||||
SA_GW_MPLS,
|
SA_GW_MPLS,
|
||||||
SA_ONLINK,
|
|
||||||
} PACKED;
|
} PACKED;
|
||||||
|
|
||||||
/* Static attribute definition (members of struct rta) */
|
/* Static attribute definition (members of struct rta) */
|
||||||
|
@ -694,7 +694,6 @@
|
|||||||
case SA_WEIGHT: RESULT(sa.f_type, i, rta->nh.weight + 1); break;
|
case SA_WEIGHT: RESULT(sa.f_type, i, rta->nh.weight + 1); break;
|
||||||
case SA_PREF: RESULT(sa.f_type, i, rta->pref); break;
|
case SA_PREF: RESULT(sa.f_type, i, rta->pref); break;
|
||||||
case SA_GW_MPLS: RESULT(sa.f_type, i, rta->nh.labels ? rta->nh.label[0] : MPLS_NULL); break;
|
case SA_GW_MPLS: RESULT(sa.f_type, i, rta->nh.labels ? rta->nh.label[0] : MPLS_NULL); break;
|
||||||
case SA_ONLINK: RESULT(sa.f_type, i, rta->nh.flags & RNF_ONLINK ? 1 : 0); break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bug("Invalid static attribute access (%u/%u)", sa.f_type, sa.sa_code);
|
bug("Invalid static attribute access (%u/%u)", sa.f_type, sa.sa_code);
|
||||||
@ -721,8 +720,8 @@
|
|||||||
case SA_GW:
|
case SA_GW:
|
||||||
{
|
{
|
||||||
ip_addr ip = v1.val.ip;
|
ip_addr ip = v1.val.ip;
|
||||||
struct iface *ifa = ipa_is_link_local(ip) || (rta->nh.flags & RNF_ONLINK) ? rta->nh.iface : NULL;
|
struct iface *ifa = ipa_is_link_local(ip) ? rta->nh.iface : NULL;
|
||||||
neighbor *n = neigh_find((*fs->rte)->src->proto, ip, ifa, (rta->nh.flags & RNF_ONLINK) ? NEF_ONLINK : 0);
|
neighbor *n = neigh_find((*fs->rte)->src->proto, ip, ifa, 0);
|
||||||
if (!n || (n->scope == SCOPE_HOST))
|
if (!n || (n->scope == SCOPE_HOST))
|
||||||
runtime( "Invalid gw address" );
|
runtime( "Invalid gw address" );
|
||||||
|
|
||||||
@ -802,15 +801,6 @@
|
|||||||
rta->pref = v1.val.i;
|
rta->pref = v1.val.i;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SA_ONLINK:
|
|
||||||
{
|
|
||||||
if (v1.val.i)
|
|
||||||
rta->nh.flags |= RNF_ONLINK;
|
|
||||||
else
|
|
||||||
rta->nh.flags &= ~RNF_ONLINK;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bug("Invalid static attribute access (%u/%u)", sa.f_type, sa.sa_code);
|
bug("Invalid static attribute access (%u/%u)", sa.f_type, sa.sa_code);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user