bgpd: Revert incorrect handling of data

data is actually allowed to be NULL.  So allow
pass in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-05-15 22:29:10 -04:00
parent cc629aef4a
commit b84ccd4089

View File

@ -603,8 +603,6 @@ bgp_notify_send_with_data (struct peer *peer, u_char code, u_char sub_code,
struct stream *s;
int length;
assert (data);
/* Allocate new stream. */
s = stream_new (BGP_MAX_PACKET_SIZE);
@ -616,7 +614,8 @@ bgp_notify_send_with_data (struct peer *peer, u_char code, u_char sub_code,
stream_putc (s, sub_code); /* BGP notify sub_code */
/* If notify data is present. */
stream_write (s, data, datalen);
if (data)
stream_write (s, data, datalen);
/* Set BGP packet length. */
length = bgp_packet_set_size (s);