version 1.1.1.2, 2012/10/09 09:22:28
|
version 1.1.1.3, 2013/07/21 23:54:39
|
Line 117 parse_tlvs (char *areatag, u_char * stream, int size,
|
Line 117 parse_tlvs (char *areatag, u_char * stream, int size,
|
#endif /* HAVE_IPV6 */ |
#endif /* HAVE_IPV6 */ |
u_char virtual; |
u_char virtual; |
int value_len, retval = ISIS_OK; |
int value_len, retval = ISIS_OK; |
u_char *start = stream, *pnt = stream; | u_char *start = stream, *pnt = stream, *endpnt; |
|
|
*found = 0; |
*found = 0; |
memset (tlvs, 0, sizeof (struct tlvs)); |
memset (tlvs, 0, sizeof (struct tlvs)); |
Line 584 parse_tlvs (char *areatag, u_char * stream, int size,
|
Line 584 parse_tlvs (char *areatag, u_char * stream, int size,
|
zlog_debug ("ISIS-TLV (%s): IPv4 extended Reachability length %d", |
zlog_debug ("ISIS-TLV (%s): IPv4 extended Reachability length %d", |
areatag, length); |
areatag, length); |
#endif /* EXTREME_TLV_DEBUG */ |
#endif /* EXTREME_TLV_DEBUG */ |
|
endpnt = pnt + length; |
if (*expected & TLVFLAG_TE_IPV4_REACHABILITY) |
if (*expected & TLVFLAG_TE_IPV4_REACHABILITY) |
{ |
{ |
while (length > value_len) |
while (length > value_len) |
{ |
{ |
te_ipv4_reach = (struct te_ipv4_reachability *) pnt; |
te_ipv4_reach = (struct te_ipv4_reachability *) pnt; |
|
if ((te_ipv4_reach->control & 0x3F) > IPV4_MAX_BITLEN) |
|
{ |
|
zlog_warn ("ISIS-TLV (%s): invalid IPv4 extended reach" |
|
"ability prefix length %d", areatag, |
|
te_ipv4_reach->control & 0x3F); |
|
retval = ISIS_WARNING; |
|
break; |
|
} |
if (!tlvs->te_ipv4_reachs) |
if (!tlvs->te_ipv4_reachs) |
tlvs->te_ipv4_reachs = list_new (); |
tlvs->te_ipv4_reachs = list_new (); |
listnode_add (tlvs->te_ipv4_reachs, te_ipv4_reach); |
listnode_add (tlvs->te_ipv4_reachs, te_ipv4_reach); |
Line 600 parse_tlvs (char *areatag, u_char * stream, int size,
|
Line 609 parse_tlvs (char *areatag, u_char * stream, int size,
|
((((te_ipv4_reach->control & 0x3F) - 1) >> 3) + 1) : 0); |
((((te_ipv4_reach->control & 0x3F) - 1) >> 3) + 1) : 0); |
} |
} |
} |
} |
else | |
{ | pnt = endpnt; |
pnt += length; | |
} | |
break; |
break; |
|
|
#ifdef HAVE_IPV6 |
#ifdef HAVE_IPV6 |
Line 648 parse_tlvs (char *areatag, u_char * stream, int size,
|
Line 655 parse_tlvs (char *areatag, u_char * stream, int size,
|
* +---------------------------------------------------------------+ |
* +---------------------------------------------------------------+ |
*/ |
*/ |
*found |= TLVFLAG_IPV6_REACHABILITY; |
*found |= TLVFLAG_IPV6_REACHABILITY; |
|
endpnt = pnt + length; |
|
|
if (*expected & TLVFLAG_IPV6_REACHABILITY) |
if (*expected & TLVFLAG_IPV6_REACHABILITY) |
{ |
{ |
while (length > value_len) |
while (length > value_len) |
{ |
{ |
ipv6_reach = (struct ipv6_reachability *) pnt; |
ipv6_reach = (struct ipv6_reachability *) pnt; |
|
if (ipv6_reach->prefix_len > IPV6_MAX_BITLEN) |
|
{ |
|
zlog_warn ("ISIS-TLV (%s): invalid IPv6 extended reach" |
|
"ability prefix length %d", areatag, |
|
ipv6_reach->prefix_len); |
|
retval = ISIS_WARNING; |
|
break; |
|
} |
|
|
prefix_octets = ((ipv6_reach->prefix_len + 7) / 8); |
prefix_octets = ((ipv6_reach->prefix_len + 7) / 8); |
value_len += prefix_octets + 6; |
value_len += prefix_octets + 6; |
pnt += prefix_octets + 6; |
pnt += prefix_octets + 6; |
Line 662 parse_tlvs (char *areatag, u_char * stream, int size,
|
Line 680 parse_tlvs (char *areatag, u_char * stream, int size,
|
listnode_add (tlvs->ipv6_reachs, ipv6_reach); |
listnode_add (tlvs->ipv6_reachs, ipv6_reach); |
} |
} |
} |
} |
else | |
{ | pnt = endpnt; |
pnt += length; | |
} | |
break; |
break; |
#endif /* HAVE_IPV6 */ |
#endif /* HAVE_IPV6 */ |
|
|
Line 696 parse_tlvs (char *areatag, u_char * stream, int size,
|
Line 712 parse_tlvs (char *areatag, u_char * stream, int size,
|
Neighbor Extended Local Circuit ID (four octets, if Neighbor |
Neighbor Extended Local Circuit ID (four octets, if Neighbor |
System ID is present) */ |
System ID is present) */ |
pnt += length; |
pnt += length; |
|
value_len += length; |
} |
} |
} |
} |
else |
else |
Line 916 tlv_add_ip_addrs (struct list *ip_addrs, struct stream
|
Line 933 tlv_add_ip_addrs (struct list *ip_addrs, struct stream
|
{ |
{ |
if (pos - value + IPV4_MAX_BYTELEN > 255) |
if (pos - value + IPV4_MAX_BYTELEN > 255) |
{ |
{ |
retval = add_tlv (IPV4_ADDR, pos - value, value, stream); | /* RFC 1195 s4.2: only one tuple of 63 allowed. */ |
if (retval != ISIS_OK) | zlog_warn ("tlv_add_ip_addrs(): cutting off at 63 IP addresses"); |
return retval; | break; |
pos = value; | |
} |
} |
*(u_int32_t *) pos = ipv4->prefix.s_addr; |
*(u_int32_t *) pos = ipv4->prefix.s_addr; |
pos += IPV4_MAX_BYTELEN; |
pos += IPV4_MAX_BYTELEN; |