diff options
Diffstat (limited to 'bgpd/bgp_mplsvpn.c')
-rw-r--r-- | bgpd/bgp_mplsvpn.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index 72ad089e..983a4867 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -36,7 +36,7 @@ static u_int16_t decode_rd_type (u_char *pnt) { u_int16_t v; - + v = ((u_int16_t) *pnt++ << 8); v |= (u_int16_t) *pnt; return v; @@ -58,7 +58,7 @@ decode_rd_as (u_char *pnt, struct rd_as *rd_as) { rd_as->as = (u_int16_t) *pnt++ << 8; rd_as->as |= (u_int16_t) *pnt++; - + rd_as->val = ((u_int32_t) *pnt++ << 24); rd_as->val |= ((u_int32_t) *pnt++ << 16); rd_as->val |= ((u_int32_t) *pnt++ << 8); @@ -70,13 +70,13 @@ decode_rd_ip (u_char *pnt, struct rd_ip *rd_ip) { memcpy (&rd_ip->ip, pnt, 4); pnt += 4; - + rd_ip->val = ((u_int16_t) *pnt++ << 8); rd_ip->val |= (u_int16_t) *pnt; } int -bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr, +bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr, struct bgp_nlri *packet) { u_char *pnt; @@ -92,9 +92,9 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr, u_char *tagpnt; /* Check peer status. */ - if (peer->status != Established) + if (peer->state != bgp_peer_pEstablished) return 0; - + /* Make prefix_rd */ prd.family = AF_UNSPEC; prd.prefixlen = 64; @@ -146,10 +146,10 @@ bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr, #if 0 if (type == RD_TYPE_AS) zlog_info ("prefix %ld:%ld:%ld:%s/%d", label, rd_as.as, rd_as.val, - inet_ntoa (p.u.prefix4), p.prefixlen); + safe_inet_ntoa (p.u.prefix4), p.prefixlen); else if (type == RD_TYPE_IP) - zlog_info ("prefix %ld:%s:%ld:%s/%d", label, inet_ntoa (rd_ip.ip), - rd_ip.val, inet_ntoa (p.u.prefix4), p.prefixlen); + zlog_info ("prefix %ld:%s:%ld:%s/%d", label, safe_inet_ntoa (rd_ip.ip), + rd_ip.val, safe_inet_ntoa (p.u.prefix4), p.prefixlen); #endif /* 0 */ if (pnt + psize > lim) @@ -234,12 +234,12 @@ str2tag (const char *str, u_char *tag) u_int32_t t; l = strtoul (str, &endptr, 10); - + if (*endptr == '\0' || l == ULONG_MAX || l > UINT32_MAX) return 0; t = (u_int32_t) l; - + tag[0] = (u_char)(t >> 12); tag[1] = (u_char)(t >> 4); tag[2] = (u_char)(t << 4); @@ -271,7 +271,7 @@ prefix_rd2str (struct prefix_rd *prd, char *buf, size_t size) else if (type == RD_TYPE_IP) { decode_rd_ip (pnt + 2, &rd_ip); - snprintf (buf, size, "%s:%d", inet_ntoa (rd_ip.ip), rd_ip.val); + snprintf (buf, size, "%s:%d", safe_inet_ntoa (rd_ip.ip), rd_ip.val); return buf; } @@ -342,7 +342,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd) if (header) { vty_out (vty, "BGP table version is 0, local router ID is %s%s", - inet_ntoa (bgp->router_id), VTY_NEWLINE); + safe_inet_ntoa (bgp->router_id), VTY_NEWLINE); vty_out (vty, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal%s", VTY_NEWLINE); vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s", @@ -373,7 +373,7 @@ show_adj_route_vpn (struct vty *vty, struct peer *peer, struct prefix_rd *prd) if (type == RD_TYPE_AS) vty_out (vty, "%u:%d", rd_as.as, rd_as.val); else if (type == RD_TYPE_IP) - vty_out (vty, "%s:%d", inet_ntoa (rd_ip.ip), rd_ip.val); + vty_out (vty, "%s:%d", safe_inet_ntoa (rd_ip.ip), rd_ip.val); vty_out (vty, "%s", VTY_NEWLINE); rd_header = 0; @@ -421,7 +421,7 @@ bgp_show_mpls_vpn (struct vty *vty, struct prefix_rd *prd, enum bgp_show_type ty vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); return CMD_WARNING; } - + for (rn = bgp_table_top (bgp->rib[AFI_IP][SAFI_MPLS_VPN]); rn; rn = bgp_route_next (rn)) { if (prd && memcmp (rn->p.u.val, prd->val, 8) != 0) @@ -432,7 +432,7 @@ bgp_show_mpls_vpn (struct vty *vty, struct prefix_rd *prd, enum bgp_show_type ty rd_header = 1; for (rm = bgp_table_top (table); rm; rm = bgp_route_next (rm)) - for (ri = rm->info; ri; ri = ri->next) + for (ri = rm->info; ri; ri = ri->info_next) { if (type == bgp_show_type_neighbor) { @@ -448,7 +448,7 @@ bgp_show_mpls_vpn (struct vty *vty, struct prefix_rd *prd, enum bgp_show_type ty else { vty_out (vty, "BGP table version is 0, local router ID is %s%s", - inet_ntoa (bgp->router_id), VTY_NEWLINE); + safe_inet_ntoa (bgp->router_id), VTY_NEWLINE); vty_out (vty, "Status codes: s suppressed, d damped, h history, * valid, > best, i - internal%s", VTY_NEWLINE); vty_out (vty, "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s", @@ -480,9 +480,9 @@ bgp_show_mpls_vpn (struct vty *vty, struct prefix_rd *prd, enum bgp_show_type ty if (type == RD_TYPE_AS) vty_out (vty, "%u:%d", rd_as.as, rd_as.val); else if (type == RD_TYPE_IP) - vty_out (vty, "%s:%d", inet_ntoa (rd_ip.ip), rd_ip.val); - - vty_out (vty, "%s", VTY_NEWLINE); + vty_out (vty, "%s:%d", safe_inet_ntoa (rd_ip.ip), rd_ip.val); + + vty_out (vty, "%s", VTY_NEWLINE); rd_header = 0; } if (tags) @@ -579,7 +579,7 @@ DEFUN (show_ip_bgp_vpnv4_all_neighbor_routes, { union sockunion *su; struct peer *peer; - + su = sockunion_str2su (argv[0]); if (su == NULL) { |