summaryrefslogtreecommitdiff
path: root/bgpd/bgp_packet.c
diff options
context:
space:
mode:
authorpaul <paul>2004-07-09 17:48:53 +0000
committerpaul <paul>2004-07-09 17:48:53 +0000
commite01f9cbb87123217ac6d88c12ddb784fca9cc5b7 (patch)
treeedf78b44ec8c5979afe0abdeefa8b33572e67ef7 /bgpd/bgp_packet.c
parentb9790b34c825e390c818044f6666f73beee1d373 (diff)
2004-07-09 Paul Jakma <paul@dishone.st>
Merge of GNU Zebra cvs2svn changesets r799, r800 and r807. * bgp_dump.c: (bgp_dump_attr) cleanup. return status code. check attributes present before printing. * bgp_dump.c: update bgp_dump_attr prototype. * bgp_packet.c: (bgp_update_receive) init attrstr. check status of bgp_dump_attr. Log end-of-rib UPDATEs.
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r--bgpd/bgp_packet.c67
1 files changed, 63 insertions, 4 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 37f5afdc..42820273 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -1375,7 +1375,7 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
struct bgp_nlri withdraw;
struct bgp_nlri mp_update;
struct bgp_nlri mp_withdraw;
- char attrstr[BUFSIZ];
+ char attrstr[BUFSIZ] = "";
/* Status must be Established. */
if (peer->status != Established)
@@ -1478,9 +1478,11 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
/* Logging the attribute. */
if (BGP_DEBUG (update, UPDATE_IN))
{
- bgp_dump_attr (peer, &attr, attrstr, BUFSIZ);
- zlog (peer->log, LOG_INFO, "%s rcvd UPDATE w/ attr: %s",
- peer->host, attrstr);
+ ret= bgp_dump_attr (peer, &attr, attrstr, BUFSIZ);
+
+ if (ret)
+ zlog (peer->log, LOG_INFO, "%s rcvd UPDATE w/ attr: %s",
+ peer->host, attrstr);
}
/* Network Layer Reachability Information. */
@@ -1518,6 +1520,15 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
bgp_nlri_parse (peer, &attr, &update);
}
+
+ if (! attribute_len && ! withdraw_len)
+ {
+ /* End-of-RIB received */
+
+ if (BGP_DEBUG (update, UPDATE_IN))
+ zlog (peer->log, LOG_INFO, "rcvd End-of-RIB for IPv4 Unicast from %s",
+ peer->host);
+ }
}
if (peer->afc[AFI_IP][SAFI_MULTICAST])
{
@@ -1530,6 +1541,18 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
&& mp_withdraw.afi == AFI_IP
&& mp_withdraw.safi == SAFI_MULTICAST)
bgp_nlri_parse (peer, NULL, &mp_withdraw);
+
+ if (attribute_len == 6 && ! withdraw_len
+ && mp_withdraw.afi == AFI_IP
+ && mp_withdraw.safi == SAFI_MULTICAST
+ && mp_withdraw.length == 0)
+ {
+ /* End-of-RIB received */
+
+ if (BGP_DEBUG (update, UPDATE_IN))
+ zlog (peer->log, LOG_INFO, "rcvd End-of-RIB for IPv4 Multicast from %s",
+ peer->host);
+ }
}
if (peer->afc[AFI_IP6][SAFI_UNICAST])
{
@@ -1542,6 +1565,18 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
&& mp_withdraw.afi == AFI_IP6
&& mp_withdraw.safi == SAFI_UNICAST)
bgp_nlri_parse (peer, NULL, &mp_withdraw);
+
+ if (attribute_len == 6 && ! withdraw_len
+ && mp_withdraw.afi == AFI_IP6
+ && mp_withdraw.safi == SAFI_UNICAST
+ && mp_withdraw.length == 0)
+ {
+ /* End-of-RIB received */
+
+ if (BGP_DEBUG (update, UPDATE_IN))
+ zlog (peer->log, LOG_INFO, "rcvd End-of-RIB for IPv6 Unicast from %s",
+ peer->host);
+ }
}
if (peer->afc[AFI_IP6][SAFI_MULTICAST])
{
@@ -1554,6 +1589,18 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
&& mp_withdraw.afi == AFI_IP6
&& mp_withdraw.safi == SAFI_MULTICAST)
bgp_nlri_parse (peer, NULL, &mp_withdraw);
+
+ if (attribute_len == 6 && ! withdraw_len
+ && mp_withdraw.afi == AFI_IP6
+ && mp_withdraw.safi == SAFI_MULTICAST
+ && mp_withdraw.length == 0)
+ {
+ /* End-of-RIB received */
+
+ if (BGP_DEBUG (update, UPDATE_IN))
+ zlog (peer->log, LOG_INFO, "rcvd End-of-RIB for IPv6 Multicast from %s",
+ peer->host);
+ }
}
if (peer->afc[AFI_IP][SAFI_MPLS_VPN])
{
@@ -1566,6 +1613,18 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
&& mp_withdraw.afi == AFI_IP
&& mp_withdraw.safi == BGP_SAFI_VPNV4)
bgp_nlri_parse_vpnv4 (peer, NULL, &mp_withdraw);
+
+ if (attribute_len == 6 && ! withdraw_len
+ && mp_withdraw.afi == AFI_IP
+ && mp_withdraw.safi == BGP_SAFI_VPNV4
+ && mp_withdraw.length == 0)
+ {
+ /* End-of-RIB received */
+
+ if (BGP_DEBUG (update, UPDATE_IN))
+ zlog (peer->log, LOG_INFO, "rcvd End-of-RIB for VPNv4 Unicast from %s",
+ peer->host);
+ }
}
/* Everything is done. We unintern temporary structures which