diff options
author | Darren Reed <darrenr@FreeBSD.org> | 2007-10-18 21:42:51 +0000 |
---|---|---|
committer | Darren Reed <darrenr@FreeBSD.org> | 2007-10-18 21:42:51 +0000 |
commit | e8e48c1c7b41ecab29b107b5ee35cdea9fdc5c20 (patch) | |
tree | 244554a59fc24e7a35e6085f00a0f0ed67863bac /sys/contrib/ipfilter/netinet/ip_log.c | |
parent | 103b406762fd9664783670aae8479f3a8ec71c61 (diff) | |
download | src-e8e48c1c7b41ecab29b107b5ee35cdea9fdc5c20.tar.gz src-e8e48c1c7b41ecab29b107b5ee35cdea9fdc5c20.zip |
Import IPFilter 4.1.28
Notes
Notes:
svn path=/vendor-sys/ipfilter/dist/; revision=172771
Diffstat (limited to 'sys/contrib/ipfilter/netinet/ip_log.c')
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_log.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c index 2a0c72ef291c..aed828eae435 100644 --- a/sys/contrib/ipfilter/netinet/ip_log.c +++ b/sys/contrib/ipfilter/netinet/ip_log.c @@ -3,7 +3,7 @@ * * See the IPFILTER.LICENCE file for details on licencing. * - * $Id: ip_log.c,v 2.75.2.15 2007/02/03 00:49:30 darrenr Exp $ + * $Id: ip_log.c,v 2.75.2.19 2007/09/09 11:32:06 darrenr Exp $ */ #include <sys/param.h> #if defined(KERNEL) || defined(_KERNEL) @@ -256,7 +256,8 @@ u_int flags; ipflog_t ipfl; u_char p; mb_t *m; -# if (SOLARIS || defined(__hpux)) && defined(_KERNEL) +# if (SOLARIS || defined(__hpux)) && defined(_KERNEL) && \ + !defined(_INET_IP_STACK_H) qif_t *ifp; # else struct ifnet *ifp; @@ -268,7 +269,10 @@ u_int flags; ipfl.fl_nattag.ipt_num[0] = 0; ifp = fin->fin_ifp; - hlen = fin->fin_hlen; + if (fin->fin_exthdr != NULL) + hlen = (char *)fin->fin_dp - (char *)fin->fin_ip; + else + hlen = fin->fin_hlen; /* * calculate header size. */ @@ -329,14 +333,16 @@ u_int flags; * Get the interface number and name to which this packet is * currently associated. */ -# if (SOLARIS || defined(__hpux)) && defined(_KERNEL) +# if (SOLARIS || defined(__hpux)) && defined(_KERNEL) && \ + !defined(_INET_IP_STACK_H) ipfl.fl_unit = (u_int)ifp->qf_ppa; - COPYIFNAME(ifp, ipfl.fl_ifname); + COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname); # else # if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \ (defined(OpenBSD) && (OpenBSD >= 199603)) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) - COPYIFNAME(ifp, ipfl.fl_ifname); + (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) || \ + (SOLARIS && defined(_INET_IP_STACK_H)) + COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname); # else ipfl.fl_unit = (u_int)ifp->if_unit; # if defined(_KERNEL) @@ -345,7 +351,7 @@ u_int flags; if ((ipfl.fl_ifname[2] = ifp->if_name[2])) ipfl.fl_ifname[3] = ifp->if_name[3]; # else - (void) strncpy(ipfl.fl_ifname, IFNAME(ifp), sizeof(ipfl.fl_ifname)); + COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname); ipfl.fl_ifname[sizeof(ipfl.fl_ifname) - 1] = '\0'; # endif # endif @@ -421,7 +427,7 @@ void **items; size_t *itemsz; int *types, cnt; { - caddr_t buf, ptr; + u_char *buf, *ptr; iplog_t *ipl; size_t len; int i; @@ -458,7 +464,7 @@ int *types, cnt; * check that we have space to record this information and can * allocate that much. */ - KMALLOCS(buf, caddr_t, len); + KMALLOCS(buf, u_char *, len); if (buf == NULL) return -1; SPL_NET(s); @@ -497,7 +503,7 @@ int *types, cnt; if (types[i] == 0) { bcopy(items[i], ptr, itemsz[i]); } else if (types[i] == 1) { - COPYDATA(items[i], 0, itemsz[i], ptr); + COPYDATA(items[i], 0, itemsz[i], (char *)ptr); } ptr += itemsz[i]; } @@ -622,7 +628,7 @@ struct uio *uio; iplused[unit] -= dlen; MUTEX_EXIT(&ipl_mutex); SPL_X(s); - error = UIOMOVE((caddr_t)ipl, dlen, UIO_READ, uio); + error = UIOMOVE(ipl, dlen, UIO_READ, uio); if (error) { SPL_NET(s); MUTEX_ENTER(&ipl_mutex); @@ -632,7 +638,7 @@ struct uio *uio; break; } MUTEX_ENTER(&ipl_mutex); - KFREES((caddr_t)ipl, dlen); + KFREES(ipl, dlen); SPL_NET(s); } if (!iplt[unit]) { @@ -665,7 +671,7 @@ minor_t unit; MUTEX_ENTER(&ipl_mutex); while ((ipl = iplt[unit]) != NULL) { iplt[unit] = ipl->ipl_next; - KFREES((caddr_t)ipl, ipl->ipl_dsize); + KFREES(ipl, ipl->ipl_dsize); } iplh[unit] = &iplt[unit]; ipll[unit] = NULL; |