diff options
Diffstat (limited to 'contrib/ipfilter/ip_log.c')
-rw-r--r-- | contrib/ipfilter/ip_log.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/contrib/ipfilter/ip_log.c b/contrib/ipfilter/ip_log.c index 6bf7a4d..e57bd69 100644 --- a/contrib/ipfilter/ip_log.c +++ b/contrib/ipfilter/ip_log.c @@ -3,7 +3,7 @@ * * See the IPFILTER.LICENCE file for details on licencing. * - * $Id: ip_log.c,v 2.5.2.19 2002/04/25 16:32:48 darrenr Exp $ + * $Id: ip_log.c,v 2.5.2.21 2002/10/26 06:21:30 darrenr Exp $ */ #include <sys/param.h> #if defined(KERNEL) && !defined(_KERNEL) @@ -99,6 +99,9 @@ # include <netinet/tcp.h> # include <netinet/udp.h> # include <netinet/ip_icmp.h> +# ifdef USE_INET6 +# include <netinet/icmp6.h> +# endif # include <netinet/ip_var.h> # ifndef _KERNEL # include <syslog.h> @@ -211,6 +214,26 @@ mb_t *m; break; } } +#ifdef USE_INET6 + else if (p == IPPROTO_ICMPV6) { + struct icmp6_hdr *icmp; + + icmp = (struct icmp6_hdr *)fin->fin_dp; + + /* + * For ICMPV6, if the packet is an error packet, also + * include the information about the packet which + * caused the error. + */ + if (icmp->icmp6_type < 128) { + hlen += MIN(sizeof(struct icmp6_hdr) + 8, + fin->fin_dlen); + } else { + hlen += MIN(sizeof(struct icmp6_hdr), + fin->fin_dlen); + } + } +#endif } /* * Get the interface number and name to which this packet is @@ -334,10 +357,10 @@ int *types, cnt; ipl->ipl_dsize = len; # ifdef _KERNEL # if SOLARIS || defined(sun) - uniqtime((struct timeval *)&ipl->ipl_sec); + uniqtime(&ipl->ipl_tv); # else # if BSD >= 199306 || defined(__FreeBSD__) || defined(__sgi) - microtime((struct timeval *)&ipl->ipl_sec); + microtime(&ipl->ipl_tv); # endif # endif # else |