diff --git a/nest/mrtdump.h b/nest/mrtdump.h index d3b13493..9ca9ca4b 100644 --- a/nest/mrtdump.h +++ b/nest/mrtdump.h @@ -41,7 +41,9 @@ /* MRT BGP4MP Subtypes */ #define MRT_BGP4MP_MESSAGE 1 #define MRT_BGP4MP_MESSAGE_AS4 4 -#define MRT_BGP4MP_STATE_CHANGE_AS4 5 +#define MRT_BGP4MP_MESSAGE_ADDPATH 8 /* Experimental draft-petrie-grow-mrt-add-paths */ +#define MRT_BGP4MP_MESSAGE_AS4_ADDPATH 9 /* Experimental draft-petrie-grow-mrt-add-paths */ +#define MRT_BGP4MP_STATE_CHANGE_AS4 5 struct mrt_buffer { diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index a117895c..f2169cdb 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -88,11 +88,19 @@ mrt_dump_bgp_packet(struct bgp_conn *conn, byte *pkt, unsigned len) byte *bp = buf + MRT_HDR_LENGTH; int as4 = conn->bgp->as4_session; + int addpath = conn->bgp->add_path_rx; + + u16 subtype; + if (addpath) + subtype = as4 ? MRT_BGP4MP_MESSAGE_AS4_ADDPATH : MRT_BGP4MP_MESSAGE_ADDPATH; + else + subtype = as4 ? MRT_BGP4MP_MESSAGE_AS4 : MRT_BGP4MP_MESSAGE; bp = mrt_put_bgp4_hdr(bp, conn, as4); memcpy(bp, pkt, len); bp += len; - mrt_dump_message_proto(&conn->bgp->p, MRT_BGP4MP, as4 ? MRT_BGP4MP_MESSAGE_AS4 : MRT_BGP4MP_MESSAGE, buf, bp-buf); + + mrt_dump_message(&conn->bgp->p, MRT_BGP4MP, subtype, buf, bp-buf); } static inline u16