Date: Thu, 16 Sep 2004 04:00:10 -0000 From: Pyun YongHyeon <yongari@kt-is.co.kr> To: pf4freebsd@freelists.org Subject: [pf4freebsd] Re: problem with 'user' Message-ID: <20040131070219.GA72233@kt-is.co.kr> In-Reply-To: <20040131054309.GA37208@kt-is.co.kr> References: <20040130123456.GA773@fried.sakeos.net> <20040131054309.GA37208@kt-is.co.kr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 31, 2004 at 02:43:09PM +0900, To pf4freebsd@freelists.org wrote: > Thank you for your report. > Can you try this patch? (Copy attached file to > /usr/ports/security/pf/files directory and build.) > Working/failure reports are very appreciated. > Sorry, file was inlined. Here is attached file. Regards, Pyun YongHyeon -- Pyun YongHyeon <http://www.kr.freebsd.org/~yongari> -- Attached file included as plaintext by Ecartis -- --- pf/pf.c.orig Tue Jan 6 15:05:35 2004 +++ pf/pf.c Sat Jan 31 14:33:47 2004 @@ -2153,11 +2153,11 @@ struct pf_addr *saddr, *daddr; u_int16_t sport, dport; #if defined(__FreeBSD__) - struct inpcb *inp; + struct inpcbinfo *pi; #else struct inpcbtable *tb; - struct inpcb *inp; #endif + struct inpcb *inp; *uid = UID_MAX; *gid = GID_MAX; @@ -2165,14 +2165,18 @@ case IPPROTO_TCP: sport = pd->hdr.tcp->th_sport; dport = pd->hdr.tcp->th_dport; -#if !defined(__FreeBSD__) +#if defined(__FreeBSD__) + pi = &tcbinfo; +#else tb = &tcbtable; #endif break; case IPPROTO_UDP: sport = pd->hdr.udp->uh_sport; dport = pd->hdr.udp->uh_dport; -#if !defined(__FreeBSD__) +#if defined(__FreeBSD__) + pi = &udbinfo; +#else tb = &udbtable; #endif break; @@ -2195,16 +2199,16 @@ case AF_INET: #if defined(__FreeBSD__) #if (__FreeBSD_version >= 500043) - INP_INFO_RLOCK(&tcbinfo); + INP_INFO_RLOCK(pi); /* XXX LOR */ #endif - inp = in_pcblookup_hash(&tcbinfo, saddr->v4, sport, daddr->v4, + inp = in_pcblookup_hash(pi, saddr->v4, sport, daddr->v4, dport, 0, NULL); if (inp == NULL) { - inp = in_pcblookup_hash(&tcbinfo, saddr->v4, sport, + inp = in_pcblookup_hash(pi, saddr->v4, sport, daddr->v4, dport, INPLOOKUP_WILDCARD, NULL); if(inp == NULL) { #if (__FreeBSD_version >= 500043) - INP_INFO_RUNLOCK(&tcbinfo); + INP_INFO_RUNLOCK(pi); #endif return (0); } @@ -2223,16 +2227,16 @@ case AF_INET6: #if defined(__FreeBSD__) #if (__FreeBSD_version >= 500043) - INP_INFO_RLOCK(&tcbinfo); + INP_INFO_RLOCK(pi); #endif - inp = in6_pcblookup_hash(&tcbinfo, &saddr->v6, sport, + inp = in6_pcblookup_hash(pi, &saddr->v6, sport, &daddr->v6, dport, 0, NULL); if (inp == NULL) { - inp = in6_pcblookup_hash(&tcbinfo, &saddr->v6, sport, + inp = in6_pcblookup_hash(pi, &saddr->v6, sport, &daddr->v6, dport, INPLOOKUP_WILDCARD, NULL); if (inp == NULL) { #if (__FreeBSD_version >= 500043) - INP_INFO_RUNLOCK(&tcbinfo); + INP_INFO_RUNLOCK(pi); #endif return (0); } @@ -2261,7 +2265,7 @@ *gid = inp->inp_socket->so_cred->cr_groups[0]; #if (__FreeBSD_version >= 500043) INP_UNLOCK(inp); - INP_INFO_RUNLOCK(&tcbinfo); + INP_INFO_RUNLOCK(pi); #endif #else *uid = inp->inp_socket->so_euid;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040131070219.GA72233>
