isisd: unexpected kernel routing table (BZ#544)

Fix bug 544: isisd produces an unexpected routing table for wide-metric.

* isis_spf.c: Accept VTYPE_PSEUDO_TE_IS and VTYPE_NONPSEUDO_TE_IS
  vertex types for SPF calculation
* isis_pdu.c: Change order of TLVs to match Cisco to make bitwise
  comparison easier for Wireshark
* isis_tlv.c: EXTREME_TLV_DEBUG for TLV debugging instead of
  EXTREME_DEBUG
This commit is contained in:
Fritz Reichmann 2011-10-01 17:43:12 +04:00 committed by Denis Ovsienko
parent d034aa027e
commit c25eaffdb2
3 changed files with 32 additions and 25 deletions

View file

@ -1992,12 +1992,34 @@ send_hello (struct isis_circuit *circuit, int level)
if (tlv_add_authinfo (circuit->passwd.type, circuit->passwd.len,
circuit->passwd.passwd, circuit->snd_stream))
return ISIS_WARNING;
/* Protocols Supported TLV */
if (circuit->nlpids.count > 0)
if (tlv_add_nlpid (&circuit->nlpids, circuit->snd_stream))
return ISIS_WARNING;
/* Area Addresses TLV */
assert (circuit->area);
if (circuit->area->area_addrs && circuit->area->area_addrs->count > 0)
if (tlv_add_area_addrs (circuit->area->area_addrs, circuit->snd_stream))
return ISIS_WARNING;
/* IP interface Address TLV */
if (circuit->ip_router && circuit->ip_addrs && circuit->ip_addrs->count > 0)
if (tlv_add_ip_addrs (circuit->ip_addrs, circuit->snd_stream))
return ISIS_WARNING;
#ifdef HAVE_IPV6
/* IPv6 Interface Address TLV */
if (circuit->ipv6_router && circuit->ipv6_link &&
circuit->ipv6_link->count > 0)
if (tlv_add_ipv6_addrs (circuit->ipv6_link, circuit->snd_stream))
return ISIS_WARNING;
#endif /* HAVE_IPV6 */
/* Restart signaling, vendor C sends it too */
retval = add_tlv (211, 3, 0, circuit->snd_stream);
/* LAN Neighbors TLV */
if (circuit->circ_type == CIRCUIT_T_BROADCAST)
{
@ -2011,23 +2033,6 @@ send_hello (struct isis_circuit *circuit, int level)
return ISIS_WARNING;
}
/* Protocols Supported TLV */
if (circuit->nlpids.count > 0)
if (tlv_add_nlpid (&circuit->nlpids, circuit->snd_stream))
return ISIS_WARNING;
/* IP interface Address TLV */
if (circuit->ip_router && circuit->ip_addrs && circuit->ip_addrs->count > 0)
if (tlv_add_ip_addrs (circuit->ip_addrs, circuit->snd_stream))
return ISIS_WARNING;
#ifdef HAVE_IPV6
/* IPv6 Interface Address TLV */
if (circuit->ipv6_router && circuit->ipv6_link &&
circuit->ipv6_link->count > 0)
if (tlv_add_ipv6_addrs (circuit->ipv6_link, circuit->snd_stream))
return ISIS_WARNING;
#endif /* HAVE_IPV6 */
if (circuit->u.bc.pad_hellos)
if (tlv_add_padding (circuit->snd_stream))
return ISIS_WARNING;
@ -2284,9 +2289,7 @@ send_l1_csnp (struct thread *thread)
circuit->t_send_csnp[0] = NULL;
if (circuit->circ_type == CIRCUIT_T_BROADCAST && circuit->u.bc.is_dr[0])
{
send_csnp (circuit, 1);
}
/* set next timer thread */
THREAD_TIMER_ON (master, circuit->t_send_csnp[0], send_l1_csnp, circuit,
isis_jitter (circuit->csnp_interval[0], CSNP_JITTER));
@ -2306,9 +2309,7 @@ send_l2_csnp (struct thread *thread)
circuit->t_send_csnp[1] = NULL;
if (circuit->circ_type == CIRCUIT_T_BROADCAST && circuit->u.bc.is_dr[1])
{
send_csnp (circuit, 2);
}
/* set next timer thread */
THREAD_TIMER_ON (master, circuit->t_send_csnp[1], send_l2_csnp, circuit,
isis_jitter (circuit->csnp_interval[1], CSNP_JITTER));

View file

@ -1030,15 +1030,22 @@ isis_run_spf (struct isis_area *area, int level, int family)
while (listcount (spftree->tents) > 0)
{
/* C.2.7 a) 1) */
node = listhead (spftree->tents);
vertex = listgetdata (node);
/* Remove from tent list */
/* C.2.7 a) 2) */
list_delete_node (spftree->tents, node);
/* C.2.7 a) 3) */
if (isis_find_vertex (spftree->paths, vertex->N.id, vertex->type))
continue;
add_to_paths (spftree, vertex, area, level);
if (vertex->type == VTYPE_PSEUDO_IS ||
vertex->type == VTYPE_NONPSEUDO_IS)
vertex->type == VTYPE_NONPSEUDO_IS ||
vertex->type == VTYPE_PSEUDO_TE_IS ||
vertex->type == VTYPE_NONPSEUDO_TE_IS )
{
if (listcount(vertex->Adj_N) == 0) {
continue;
@ -1054,7 +1061,6 @@ isis_run_spf (struct isis_area *area, int level, int family)
{
isis_spf_process_pseudo_lsp (spftree, lsp, vertex->d_N,
vertex->depth, family, adj);
}
else
{

View file

@ -741,7 +741,7 @@ add_tlv (u_char tag, u_char len, u_char * value, struct stream *stream)
stream_putc (stream, len); /* LENGTH */
stream_put (stream, value, (int) len); /* VALUE */
#ifdef EXTREME_DEBUG
#ifdef EXTREME_TLV_DEBUG
zlog_debug ("Added TLV %d len %d", tag, len);
#endif /* EXTREME DEBUG */
return ISIS_OK;