On 11/11/05, Albert Chin <[EMAIL PROTECTED]> wrote:
> From print-isoclns.c:
>   static int
>   isis_print_extd_ip_reach (const u_int8_t *tptr, const char *ident, 
> u_int16_t afi) {
>       char ident_buffer[20];
>       u_int8_t prefix[sizeof(struct in6_addr)]; /* shared copy buffer for 
> IPv4 and IPv6 prefixes */
>
> The prefix definition isn't wrapped in an #ifdef INET6. Ditto for this
> line in the same file:
>   memset(prefix, 0, sizeof(struct in6_addr));              /* clear the copy 
> buffer */
>
I would say this code (without looking further) does the buffering for
both IPv4 and IPv6 (there is a comment saying that!).

It uses the in6_addr structure because that would be bigger than IPv4
so could hold both. Saves having two different parts of code doing
basically the same thing. There would probably be a cast when it is
used if being used by IPv4.

Ian
--
Ian McDonald
http://wand.net.nz/~iam4
WAND Network Research Group
University of Waikato
New Zealand
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.

Reply via email to