diff options
author | pkelsey <pkelsey@FreeBSD.org> | 2015-07-08 16:19:32 +0000 |
---|---|---|
committer | pkelsey <pkelsey@FreeBSD.org> | 2015-07-08 16:19:32 +0000 |
commit | 7e965066ede451d7a551dd68d6c59acf32e4846e (patch) | |
tree | f0c2243cc0a2a59f3eb1354ba3987d4cbcb788bc /contrib/tcpdump/print-bgp.c | |
parent | 732211dc794db586649eabfc1d517b8a477440f5 (diff) | |
parent | c2704d8ede887d9fe69a9a11fe0755b09ec6895d (diff) | |
download | FreeBSD-src-7e965066ede451d7a551dd68d6c59acf32e4846e.zip FreeBSD-src-7e965066ede451d7a551dd68d6c59acf32e4846e.tar.gz |
MFV r285191: tcpdump 4.7.4.
Also, the changes made in r272451 and r272653 that were lost in the
merge of 4.6.2 (r276788) have been restored.
PR: 199568
Differential Revision: https://reviews.freebsd.org/D3007
Reviewed by: brooks, hiren
Approved by: jmallett (mentor)
MFC after: 1 month
Diffstat (limited to 'contrib/tcpdump/print-bgp.c')
-rw-r--r-- | contrib/tcpdump/print-bgp.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/contrib/tcpdump/print-bgp.c b/contrib/tcpdump/print-bgp.c index f5c02a1..c617c3b 100644 --- a/contrib/tcpdump/print-bgp.c +++ b/contrib/tcpdump/print-bgp.c @@ -530,7 +530,7 @@ decode_labeled_prefix4(netdissect_options *ndo, is added to the prefix length; we also do only read out just one label - there is no real application for advertisement of - stacked labels in a a single BGP message + stacked labels in a single BGP message */ if (24 > plen) @@ -574,7 +574,8 @@ badtlv: */ static char * bgp_vpn_ip_print(netdissect_options *ndo, - const u_char *pptr, u_int addr_length) { + const u_char *pptr, u_int addr_length) +{ /* worst case string is s fully formatted v6 address */ static char addr[sizeof("1234:5678:89ab:cdef:1234:5678:89ab:cdef")]; @@ -622,8 +623,8 @@ trunc: */ static int bgp_vpn_sg_print(netdissect_options *ndo, - const u_char *pptr, char *buf, u_int buflen) { - + const u_char *pptr, char *buf, u_int buflen) +{ uint8_t addr_length; u_int total_length, offset; @@ -667,8 +668,8 @@ trunc: * printing route targets inside a NLRI */ char * bgp_vpn_rd_print(netdissect_options *ndo, - const u_char *pptr) { - + const u_char *pptr) +{ /* allocate space for the largest possible string */ static char rd[sizeof("xxxxxxxxxx:xxxxx (xxx.xxx.xxx.xxx:xxxxx)")]; char *pos = rd; @@ -716,8 +717,10 @@ decode_rt_routing_info(netdissect_options *ndo, ND_TCHECK(pptr[0]); plen = pptr[0]; /* get prefix length */ - if (0 == plen) - return 1; /* default route target */ + if (0 == plen) { + snprintf(buf, buflen, "default route target"); + return 1; + } if (32 > plen) return -1; @@ -2617,8 +2620,8 @@ trunc: static void bgp_route_refresh_print(netdissect_options *ndo, - const u_char *pptr, int len) { - + const u_char *pptr, int len) +{ const struct bgp_route_refresh *bgp_route_refresh_header; char tokbuf[TOKBUFSIZE]; char tokbuf2[TOKBUFSIZE]; @@ -2715,7 +2718,7 @@ bgp_print(netdissect_options *ndo, if (ndo->ndo_snapend < dat + length) ep = ndo->ndo_snapend; - ND_PRINT((ndo, ": BGP, length: %u", length)); + ND_PRINT((ndo, ": BGP")); if (ndo->ndo_vflag < 1) /* lets be less chatty */ return; |