bgpd: Cleanup some SA

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-05-15 07:33:48 -04:00
parent 56afaa8bcb
commit 46c3ce8327
5 changed files with 19 additions and 19 deletions

View File

@ -1500,7 +1500,6 @@ bgp_attr_as4_path (struct bgp_attr_parser_args *args, struct aspath **as4_path)
} }
/* Set aspath attribute flag. */ /* Set aspath attribute flag. */
if (as4_path)
attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_AS4_PATH); attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_AS4_PATH);
return BGP_ATTR_PARSE_PROCEED; return BGP_ATTR_PARSE_PROCEED;

View File

@ -1158,8 +1158,6 @@ extcommunity_list_set (struct community_list_handler *ch,
} }
} }
if (str)
{
if (style == EXTCOMMUNITY_LIST_STANDARD) if (style == EXTCOMMUNITY_LIST_STANDARD)
ecom = ecommunity_str2com (str, 0, 1); ecom = ecommunity_str2com (str, 0, 1);
else else
@ -1167,7 +1165,6 @@ extcommunity_list_set (struct community_list_handler *ch,
if (! ecom && ! regex) if (! ecom && ! regex)
return COMMUNITY_LIST_ERR_MALFORMED_VAL; return COMMUNITY_LIST_ERR_MALFORMED_VAL;
}
if (ecom) if (ecom)
ecom->str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_DISPLAY, 0); ecom->str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_DISPLAY, 0);
@ -1180,8 +1177,7 @@ extcommunity_list_set (struct community_list_handler *ch,
entry->config = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_COMMUNITY_LIST, 0); entry->config = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_COMMUNITY_LIST, 0);
else if (regex) else if (regex)
entry->config = XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str); entry->config = XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str);
else
entry->config = NULL;
entry->u.ecom = ecom; entry->u.ecom = ecom;
entry->reg = regex; entry->reg = regex;

View File

@ -626,7 +626,7 @@ bgp_dump_parse_time (const char *str)
return 0; return 0;
total += time * 60; total += time * 60;
time = 0; time = 0;
seen_h = 1; seen_m = 1;
} }
else else
return 0; return 0;

View File

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

View File

@ -8887,6 +8887,7 @@ bgp_show_community (struct vty *vty, struct bgp *bgp, int argc,
int i; int i;
char *str; char *str;
int first = 0; int first = 0;
int ret = 0;
b = buffer_new (1024); b = buffer_new (1024);
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
@ -8915,9 +8916,12 @@ bgp_show_community (struct vty *vty, struct bgp *bgp, int argc,
return CMD_WARNING; return CMD_WARNING;
} }
return bgp_show (vty, bgp, afi, safi, ret = bgp_show (vty, bgp, afi, safi,
(exact ? bgp_show_type_community_exact : (exact ? bgp_show_type_community_exact :
bgp_show_type_community), com, 0); bgp_show_type_community), com, 0);
community_free (com);
return ret;
} }
static int static int