}
/* 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;
}
}
}
- if (str)
- {
- if (style == EXTCOMMUNITY_LIST_STANDARD)
- ecom = ecommunity_str2com (str, 0, 1);
- else
- regex = bgp_regcomp (str);
+ if (style == EXTCOMMUNITY_LIST_STANDARD)
+ ecom = ecommunity_str2com (str, 0, 1);
+ else
+ regex = bgp_regcomp (str);
- if (! ecom && ! regex)
- return COMMUNITY_LIST_ERR_MALFORMED_VAL;
- }
+ if (! ecom && ! regex)
+ return COMMUNITY_LIST_ERR_MALFORMED_VAL;
if (ecom)
ecom->str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_DISPLAY, 0);
entry->config = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_COMMUNITY_LIST, 0);
else if (regex)
entry->config = XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str);
- else
- entry->config = NULL;
+
entry->u.ecom = ecom;
entry->reg = regex;
return 0;
total += time * 60;
time = 0;
- seen_h = 1;
+ seen_m = 1;
}
else
return 0;
struct stream *s;
int length;
+ assert (data);
+
/* Allocate new stream. */
s = stream_new (BGP_MAX_PACKET_SIZE);
stream_putc (s, sub_code); /* BGP notify sub_code */
/* If notify data is present. */
- if (data)
- stream_write (s, data, datalen);
+ stream_write (s, data, datalen);
/* Set BGP packet length. */
length = bgp_packet_set_size (s);
int i;
char *str;
int first = 0;
+ int ret = 0;
b = buffer_new (1024);
for (i = 0; i < argc; i++)
return CMD_WARNING;
}
- return bgp_show (vty, bgp, afi, safi,
- (exact ? bgp_show_type_community_exact :
- bgp_show_type_community), com, 0);
+ ret = bgp_show (vty, bgp, afi, safi,
+ (exact ? bgp_show_type_community_exact :
+ bgp_show_type_community), com, 0);
+ community_free (com);
+
+ return ret;
}
static int