summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 17:18:46 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 17:18:46 +0200
commit65254128e105903b6b470c6b4bb4729f56cf81bc (patch)
tree8f0e61f94053f49428531f0d8cd6e8d1abfcdb2a /proto
parent1a92ee9d4df265018c0344064019f53bc3afce3a (diff)
parent702c04fbef222e802ca4dfac645dc75ede522db6 (diff)
Merge commit '702c04fbef222e802ca4dfac645dc75ede522db6' into haugesund
Diffstat (limited to 'proto')
-rw-r--r--proto/babel/babel.c6
-rw-r--r--proto/babel/config.Y2
-rw-r--r--proto/bgp/config.Y13
-rw-r--r--proto/bgp/packets.c4
-rw-r--r--proto/ospf/config.Y2
-rw-r--r--proto/ospf/rt.c1
-rw-r--r--proto/perf/perf.c1
-rw-r--r--proto/radv/config.Y2
-rw-r--r--proto/rip/config.Y2
-rw-r--r--proto/rip/rip.c41
-rw-r--r--proto/rpki/rpki.c1
-rw-r--r--proto/static/static.c1
12 files changed, 35 insertions, 41 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 6cc6b794..d3eef506 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -645,11 +645,12 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
{
struct {
ea_list l;
- eattr a[4];
+ eattr a[5];
} eattrs = {
.l.count = ARRAY_SIZE(eattrs.a),
.a = {
EA_LITERAL_EMBEDDED(&ea_gen_preference, 0, c->preference),
+ EA_LITERAL_STORE_ADATA(&ea_gen_from, 0, &r->neigh->addr, sizeof(r->neigh->addr)),
EA_LITERAL_EMBEDDED(&ea_babel_metric, 0, r->metric),
EA_LITERAL_STORE_ADATA(&ea_babel_router_id, 0, &r->router_id, sizeof(r->router_id)),
EA_LITERAL_EMBEDDED(&ea_babel_seqno, 0, r->seqno),
@@ -658,9 +659,7 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
rta a0 = {
.source = RTS_BABEL,
- .scope = SCOPE_UNIVERSE,
.dest = RTD_UNICAST,
- .from = r->neigh->addr,
.nh.gw = r->next_hop,
.nh.iface = r->neigh->ifa->iface,
.eattrs = &eattrs.l,
@@ -687,7 +686,6 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
/* Unreachable */
rta a0 = {
.source = RTS_BABEL,
- .scope = SCOPE_UNIVERSE,
.dest = RTD_UNREACHABLE,
};
diff --git a/proto/babel/config.Y b/proto/babel/config.Y
index 82419b20..a4350eed 100644
--- a/proto/babel/config.Y
+++ b/proto/babel/config.Y
@@ -24,7 +24,7 @@ CF_DECLS
CF_KEYWORDS(BABEL, INTERFACE, METRIC, RXCOST, HELLO, UPDATE, INTERVAL, PORT,
TYPE, WIRED, WIRELESS, RX, TX, BUFFER, PRIORITY, LENGTH, CHECK, LINK,
- NEXT, HOP, IPV4, IPV6, BABEL_METRIC, SHOW, INTERFACES, NEIGHBORS,
+ NEXT, HOP, IPV4, IPV6, SHOW, INTERFACES, NEIGHBORS,
ENTRIES, RANDOMIZE, ROUTER, ID, AUTHENTICATION, NONE, MAC, PERMISSIVE)
CF_GRAMMAR
diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y
index db261bbb..b4d8b83f 100644
--- a/proto/bgp/config.Y
+++ b/proto/bgp/config.Y
@@ -19,18 +19,17 @@ CF_DECLS
CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, HOLD, TIME, CONNECT, RETRY, KEEPALIVE,
MULTIHOP, STARTUP, VIA, NEXT, HOP, SELF, DEFAULT, PATH, METRIC, ERROR,
- START, DELAY, FORGET, WAIT, ENABLE, DISABLE, AFTER, BGP_PATH,
- BGP_LOCAL_PREF, BGP_MED, BGP_ORIGIN, BGP_NEXT_HOP, BGP_ATOMIC_AGGR,
- BGP_AGGREGATOR, BGP_COMMUNITY, BGP_EXT_COMMUNITY, BGP_LARGE_COMMUNITY,
+ START, DELAY, FORGET, WAIT, ENABLE, DISABLE, AFTER,
+ BGP_LOCAL_PREF, BGP_MED,
SOURCE, ADDRESS, PASSWORD, RR, RS, CLIENT, CLUSTER, ID, AS4, ADVERTISE,
IPV4, CAPABILITIES, LIMIT, PASSIVE, PREFER, OLDER, MISSING, LLADDR,
- DROP, IGNORE, ROUTE, REFRESH, INTERPRET, COMMUNITIES, BGP_ORIGINATOR_ID,
- BGP_CLUSTER_LIST, IGP, TABLE, GATEWAY, DIRECT, RECURSIVE, MED, TTL,
+ DROP, IGNORE, ROUTE, REFRESH, INTERPRET, COMMUNITIES,
+ IGP, TABLE, GATEWAY, DIRECT, RECURSIVE, MED, TTL,
SECURITY, DETERMINISTIC, SECONDARY, ALLOW, BFD, ADD, PATHS, RX, TX,
GRACEFUL, RESTART, AWARE, CHECK, LINK, PORT, EXTENDED, MESSAGES, SETKEY,
STRICT, BIND, CONFEDERATION, MEMBER, MULTICAST, FLOW4, FLOW6, LONG,
LIVED, STALE, IMPORT, IBGP, EBGP, MANDATORY, INTERNAL, EXTERNAL, SETS,
- DYNAMIC, RANGE, NAME, DIGITS, BGP_AIGP, AIGP, ORIGINATE, COST, ENFORCE,
+ DYNAMIC, RANGE, NAME, DIGITS, AIGP, ORIGINATE, COST, ENFORCE,
FIRST, FREE, VALIDATE, BASE)
%type <i> bgp_nh
@@ -44,6 +43,8 @@ CF_KEYWORDS(CEASE, PREFIX, LIMIT, HIT, ADMINISTRATIVE, SHUTDOWN, RESET, PEER,
CF_GRAMMAR
+toksym: BGP_MED | BGP_LOCAL_PREF ;
+
proto: bgp_proto '}' ;
bgp_proto_start: proto_start BGP {
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index f87d25a3..c01dfeea 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -2476,9 +2476,9 @@ bgp_decode_nlri(struct bgp_parse_state *s, u32 afi, byte *nlri, uint len, ea_lis
a = allocz(RTA_MAX_SIZE);
a->source = RTS_BGP;
- a->scope = SCOPE_UNIVERSE;
- a->from = s->proto->remote_ip;
a->eattrs = ea;
+
+ ea_set_attr_data(&a->eattrs, &ea_gen_from, 0, &s->proto->remote_ip, sizeof(ip_addr));
ea_set_attr_u32(&a->eattrs, &ea_gen_preference, 0, c->c.preference);
c->desc->decode_next_hop(s, nh, nh_len, a);
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y
index 136e1dcb..bc3df8db 100644
--- a/proto/ospf/config.Y
+++ b/proto/ospf/config.Y
@@ -190,7 +190,7 @@ ospf_check_auth(void)
CF_DECLS
-CF_KEYWORDS(OSPF, V2, V3, OSPF_METRIC1, OSPF_METRIC2, OSPF_TAG, OSPF_ROUTER_ID)
+CF_KEYWORDS(OSPF, V2, V3)
CF_KEYWORDS(AREA, NEIGHBORS, RFC1583COMPAT, STUB, TICK, COST, COST2, RETRANSMIT)
CF_KEYWORDS(HELLO, TRANSMIT, PRIORITY, DEAD, TYPE, BROADCAST, BCAST, DEFAULT)
CF_KEYWORDS(NONBROADCAST, NBMA, POINTOPOINT, PTP, POINTOMULTIPOINT, PTMP)
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index fb822e34..0cfd3747 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -2054,7 +2054,6 @@ again1:
{
rta a0 = {
.source = nf->n.type,
- .scope = SCOPE_UNIVERSE,
.dest = RTD_UNICAST,
.nh = *(nf->n.nhs),
};
diff --git a/proto/perf/perf.c b/proto/perf/perf.c
index f07887a3..7c509eb0 100644
--- a/proto/perf/perf.c
+++ b/proto/perf/perf.c
@@ -144,7 +144,6 @@ perf_loop(void *data)
if (!p->attrs_per_rte || !(i % p->attrs_per_rte)) {
struct rta a0 = {
.source = RTS_PERF,
- .scope = SCOPE_UNIVERSE,
.dest = RTD_UNICAST,
.nh.iface = p->ifa->iface,
.nh.gw = gw,
diff --git a/proto/radv/config.Y b/proto/radv/config.Y
index f40fdcca..fb68d2e5 100644
--- a/proto/radv/config.Y
+++ b/proto/radv/config.Y
@@ -33,7 +33,7 @@ CF_KEYWORDS(RADV, PREFIX, INTERFACE, MIN, MAX, RA, DELAY, INTERVAL, SOLICITED,
RETRANS, TIMER, CURRENT, HOP, LIMIT, DEFAULT, VALID, PREFERRED, MULT,
LIFETIME, SKIP, ONLINK, AUTONOMOUS, RDNSS, DNSSL, NS, DOMAIN, LOCAL,
TRIGGER, SENSITIVE, PREFERENCE, LOW, MEDIUM, HIGH, PROPAGATE, ROUTE,
- ROUTES, RA_PREFERENCE, RA_LIFETIME)
+ ROUTES)
CF_ENUM(T_ENUM_RA_PREFERENCE, RA_PREF_, LOW, MEDIUM, HIGH)
diff --git a/proto/rip/config.Y b/proto/rip/config.Y
index 234e9029..3c0973b1 100644
--- a/proto/rip/config.Y
+++ b/proto/rip/config.Y
@@ -37,7 +37,7 @@ CF_KEYWORDS(RIP, NG, ECMP, LIMIT, WEIGHT, INFINITY, METRIC, UPDATE, TIMEOUT,
PASSIVE, VERSION, SPLIT, HORIZON, POISON, REVERSE, CHECK, ZERO,
TIME, BFD, AUTHENTICATION, NONE, PLAINTEXT, CRYPTOGRAPHIC, MD5,
TTL, SECURITY, RX, TX, BUFFER, LENGTH, PRIORITY, ONLY, LINK,
- DEMAND, CIRCUIT, RIP_METRIC, RIP_TAG)
+ DEMAND, CIRCUIT)
%type <i> rip_variant rip_auth
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index cf186f87..1c7d1f1f 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -153,11 +153,21 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
/* Update */
rta a0 = {
.source = RTS_RIP,
- .scope = SCOPE_UNIVERSE,
.dest = RTD_UNICAST,
};
- u8 rt_metric = rt->metric;
+ struct {
+ ea_list l;
+ eattr a[2];
+ } ea_block = {
+ .l.count = ARRAY_SIZE(ea_block.a),
+ .a = {
+ EA_LITERAL_EMBEDDED(&ea_gen_preference, 0, p->p.main_channel->preference),
+ EA_LITERAL_EMBEDDED(&ea_rip_metric, 0, rt->metric),
+ },
+ };
+ a0.eattrs = &ea_block.l;
+
u16 rt_tag = rt->tag;
if (p->ecmp)
@@ -189,30 +199,19 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
else
{
/* Unipath route */
- a0.from = rt->from->nbr->addr;
a0.nh.gw = rt->next_hop;
a0.nh.iface = rt->from->ifa->iface;
+ ea_set_attr_data(&a0.eattrs, &ea_gen_from, 0, &rt->from->nbr->addr, sizeof(ip_addr));
}
- struct {
- ea_list l;
- eattr a[4];
- struct rip_iface_adata riad;
- } ea_block = {
- .l.count = ARRAY_SIZE(ea_block.a),
- .a = {
- EA_LITERAL_EMBEDDED(&ea_gen_preference, 0, p->p.main_channel->preference),
- EA_LITERAL_EMBEDDED(&ea_rip_metric, 0, rt_metric),
- EA_LITERAL_EMBEDDED(&ea_rip_tag, 0, rt_tag),
- EA_LITERAL_DIRECT_ADATA(&ea_rip_from, 0, &ea_block.riad.ad),
- },
- .riad = {
- .ad = { .length = sizeof(struct rip_iface_adata) - sizeof(struct adata) },
- .iface = a0.nh.iface,
- },
- };
+ ea_set_attr_u32(&a0.eattrs, &ea_rip_tag, 0, rt_tag);
- a0.eattrs = &ea_block.l;
+ struct rip_iface_adata riad = {
+ .ad = { .length = sizeof(struct rip_iface_adata) - sizeof(struct adata) },
+ .iface = a0.nh.iface,
+ };
+ ea_set_attr(&a0.eattrs,
+ EA_LITERAL_DIRECT_ADATA(&ea_rip_from, 0, &riad.ad));
rte e0 = {
.attrs = &a0,
diff --git a/proto/rpki/rpki.c b/proto/rpki/rpki.c
index eecab897..8e2dbf49 100644
--- a/proto/rpki/rpki.c
+++ b/proto/rpki/rpki.c
@@ -122,7 +122,6 @@ rpki_table_add_roa(struct rpki_cache *cache, struct channel *channel, const net_
rta a0 = {
.source = RTS_RPKI,
- .scope = SCOPE_UNIVERSE,
.dest = RTD_NONE,
};
diff --git a/proto/static/static.c b/proto/static/static.c
index 9b6c38ee..425cab1b 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -56,7 +56,6 @@ static_announce_rte(struct static_proto *p, struct static_route *r)
rta *a = allocz(RTA_MAX_SIZE);
struct rte_src *src = static_get_source(p, r->index);
a->source = RTS_STATIC;
- a->scope = SCOPE_UNIVERSE;
a->dest = r->dest;
ea_set_attr_u32(&a->eattrs, &ea_gen_preference, 0, p->p.main_channel->preference);