From c0fc3e67185c1e0ff2d083572c6ad3983ba4ef25 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 18 Sep 2018 17:29:00 +0200 Subject: The MRT protocol The new MRT protocol is responsible for periodic RIB table dumps in the MRT format (RFC 6396). Also the existing code for BGP4MP MRT dumps is refactored and splitted between BGP to MRT protocols, will be more integrated into MRT in the future. Example: protocol mrt { table "*"; filename "%N_%F_%T.mrt"; period 60; } It is partially based on the old MRT code from Pavel Tvrdik. --- proto/bgp/attrs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'proto/bgp/attrs.c') diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 3b88791d..05fcfe72 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -471,7 +471,7 @@ bgp_get_attr_len(eattr *a) /** * bgp_encode_attrs - encode BGP attributes - * @p: BGP instance + * @p: BGP instance (or NULL) * @w: buffer * @attrs: a list of extended attributes * @remains: remaining space in the buffer @@ -485,6 +485,7 @@ uint bgp_encode_attrs(struct bgp_proto *p, byte *w, ea_list *attrs, int remains) { uint i, code, type, flags; + int as4_session = p ? p->as4_session : 1; byte *start = w; int len, rv; @@ -504,7 +505,7 @@ bgp_encode_attrs(struct bgp_proto *p, byte *w, ea_list *attrs, int remains) * we have to convert our 4B AS_PATH to 2B AS_PATH and send our AS_PATH * as optional AS4_PATH attribute. */ - if ((code == BA_AS_PATH) && (! p->as4_session)) + if ((code == BA_AS_PATH) && !as4_session) { len = a->u.ptr->length; @@ -546,7 +547,7 @@ bgp_encode_attrs(struct bgp_proto *p, byte *w, ea_list *attrs, int remains) } /* The same issue with AGGREGATOR attribute */ - if ((code == BA_AGGREGATOR) && (! p->as4_session)) + if ((code == BA_AGGREGATOR) && !as4_session) { int new_used; -- cgit v1.2.3