--- embedaddon/quagga/isisd/isis_tlv.c 2013/07/21 23:54:39 1.1.1.3 +++ embedaddon/quagga/isisd/isis_tlv.c 2016/11/02 10:09:10 1.1.1.4 @@ -115,7 +115,6 @@ parse_tlvs (char *areatag, u_char * stream, int size, struct ipv6_reachability *ipv6_reach; int prefix_octets; #endif /* HAVE_IPV6 */ - u_char virtual; int value_len, retval = ISIS_OK; u_char *start = stream, *pnt = stream, *endpnt; @@ -179,7 +178,7 @@ parse_tlvs (char *areatag, u_char * stream, int size, * | Virtual Flag | * +-------+-------+-------+-------+-------+-------+-------+-------+ */ - virtual = *pnt; /* FIXME: what is the use for this? */ + /* virtual = *pnt; FIXME: what is the use for this? */ pnt++; value_len++; /* +-------+-------+-------+-------+-------+-------+-------+-------+ @@ -742,7 +741,6 @@ parse_tlvs (char *areatag, u_char * stream, int size, zlog_warn ("ISIS-TLV (%s): unsupported TLV type %d, length %d", areatag, type, length); - retval = ISIS_WARNING; pnt += length; break; } @@ -927,7 +925,6 @@ tlv_add_ip_addrs (struct list *ip_addrs, struct stream struct prefix_ipv4 *ipv4; u_char value[255]; u_char *pos = value; - int retval; for (ALL_LIST_ELEMENTS_RO (ip_addrs, node, ipv4)) { @@ -996,8 +993,8 @@ tlv_add_lsp_entries (struct list *lsps, struct stream return add_tlv (LSP_ENTRIES, pos - value, value, stream); } -int -tlv_add_ipv4_reachs (struct list *ipv4_reachs, struct stream *stream) +static int +tlv_add_ipv4_reachs (u_char tag, struct list *ipv4_reachs, struct stream *stream) { struct listnode *node; struct ipv4_reachability *reach; @@ -1010,7 +1007,7 @@ tlv_add_ipv4_reachs (struct list *ipv4_reachs, struct if (pos - value + IPV4_REACH_LEN > 255) { retval = - add_tlv (IPV4_INT_REACHABILITY, pos - value, value, stream); + add_tlv (tag, pos - value, value, stream); if (retval != ISIS_OK) return retval; pos = value; @@ -1029,8 +1026,21 @@ tlv_add_ipv4_reachs (struct list *ipv4_reachs, struct pos += IPV4_MAX_BYTELEN; } - return add_tlv (IPV4_INT_REACHABILITY, pos - value, value, stream); + return add_tlv (tag, pos - value, value, stream); } + +int +tlv_add_ipv4_int_reachs (struct list *ipv4_reachs, struct stream *stream) +{ + return tlv_add_ipv4_reachs(IPV4_INT_REACHABILITY, ipv4_reachs, stream); +} + +int +tlv_add_ipv4_ext_reachs (struct list *ipv4_reachs, struct stream *stream) +{ + return tlv_add_ipv4_reachs(IPV4_EXT_REACHABILITY, ipv4_reachs, stream); +} + int tlv_add_te_ipv4_reachs (struct list *te_ipv4_reachs, struct stream *stream)