From 2a9e064d7b41ae6e944dd9fbcb18b89e8fda0dba Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 21 Apr 2000 12:25:35 +0000 Subject: If no NLRI's are present in an UPDATE message, parse the attributes, but don't check presence of mandatory attributes. [draft-09] --- proto/bgp/packets.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'proto/bgp/packets.c') diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index bec2e501..ccaa91c1 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -305,6 +305,7 @@ bgp_rx_update(struct bgp_conn *conn, byte *pkt, int len) int withdrawn_len, attr_len, nlri_len, pxlen; net *n; rte e; + rta *a0; rta *a = NULL; DBG("BGP: UPDATE\n"); @@ -341,11 +342,10 @@ bgp_rx_update(struct bgp_conn *conn, byte *pkt, int len) rte_update(bgp->p.table, n, &bgp->p, NULL); } - if (nlri_len) + a0 = bgp_decode_attrs(conn, attrs, attr_len, bgp_linpool, nlri_len); + if (a0 && nlri_len) { - a = bgp_decode_attrs(conn, attrs, attr_len, bgp_linpool); - if (!a) - return; + a = rta_lookup(a0); while (nlri_len) { rte *e; @@ -357,9 +357,9 @@ bgp_rx_update(struct bgp_conn *conn, byte *pkt, int len) e->pflags = 0; rte_update(bgp->p.table, n, &bgp->p, e); } - lp_flush(bgp_linpool); rta_free(a); } + lp_flush(bgp_linpool); return; malformed: -- cgit v1.2.3