struct in_addr *nexthop;
char buf[2][INET_ADDRSTRLEN];
int valid_nh_count = 0;
+ int has_valid_label = 0;
/* resize nexthop buffer size if necessary */
- if ((oldsize = stream_get_size (bgp_nexthop_buf)) <
- (sizeof (struct in_addr *) * nhcount))
- {
- newsize = sizeof (struct in_addr *) * nhcount;
- newsize = stream_resize (bgp_nexthop_buf, newsize);
- if (newsize == oldsize)
- {
- zlog_err ("can't resize nexthop buffer");
- return;
- }
- }
stream_reset (bgp_nexthop_buf);
nexthop = NULL;
struct zapi_ipv6 api;
int valid_nh_count = 0;
char buf[2][INET6_ADDRSTRLEN];
+ int has_valid_label = 0;
- /* resize nexthop buffer size if necessary */
- if ((oldsize = stream_get_size (bgp_nexthop_buf)) <
- (sizeof (struct in6_addr *) * nhcount))
- {
- newsize = (sizeof (struct in6_addr *) * nhcount);
- newsize = stream_resize (bgp_nexthop_buf, newsize);
- if (newsize == oldsize)
- {
- zlog_err ("can't resize nexthop buffer");
- return;
- }
- }
stream_reset (bgp_nexthop_buf);
-
- /* resize ifindices buffer size if necessary */
- if ((oldsize = stream_get_size (bgp_ifindices_buf)) <
- (sizeof (unsigned int) * nhcount))
- {
- newsize = (sizeof (unsigned int) * nhcount);
- newsize = stream_resize (bgp_ifindices_buf, newsize);
- if (newsize == oldsize)
- {
- zlog_err ("can't resize nexthop buffer");
- return;
- }
- }
stream_reset (bgp_ifindices_buf);
-
- /* For labeled unicast, each nexthop has a label too. Resize label
- * buffer, if required.
- */
- if (safi == SAFI_UNICAST)
- {
- if ((oldsize = stream_get_size (bgp_label_buf)) <
- (sizeof (unsigned int) * nhcount))
- {
- newsize = (sizeof (unsigned int) * nhcount);
- newsize = stream_resize (bgp_label_buf, newsize);
- if (newsize == oldsize)
- {
- zlog_err ("can't resize label buffer");
- return;
- }
- }
- stream_reset (bgp_label_buf);
- }
+ stream_reset (bgp_label_buf);
ifindex = 0;
nexthop = NULL;