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 wro= te: > 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. >=20 Sorry, file was inlined. Here is attached file. Regards, Pyun YongHyeon --=20 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; =20 *uid =3D UID_MAX; *gid =3D GID_MAX; @@ -2165,14 +2165,18 @@ case IPPROTO_TCP: sport =3D pd->hdr.tcp->th_sport; dport =3D pd->hdr.tcp->th_dport; -#if !defined(__FreeBSD__) +#if defined(__FreeBSD__) + pi =3D &tcbinfo; +#else tb =3D &tcbtable; #endif break; case IPPROTO_UDP: sport =3D pd->hdr.udp->uh_sport; dport =3D pd->hdr.udp->uh_dport; -#if !defined(__FreeBSD__) +#if defined(__FreeBSD__) + pi =3D &udbinfo; +#else tb =3D &udbtable; #endif break; @@ -2195,16 +2199,16 @@ case AF_INET: #if defined(__FreeBSD__) #if (__FreeBSD_version >=3D 500043) - INP_INFO_RLOCK(&tcbinfo); + INP_INFO_RLOCK(pi); /* XXX LOR */ #endif - inp =3D in_pcblookup_hash(&tcbinfo, saddr->v4, sport, daddr->v4, + inp =3D in_pcblookup_hash(pi, saddr->v4, sport, daddr->v4, dport, 0, NULL); if (inp =3D=3D NULL) { - inp =3D in_pcblookup_hash(&tcbinfo, saddr->v4, sport, + inp =3D in_pcblookup_hash(pi, saddr->v4, sport, daddr->v4, dport, INPLOOKUP_WILDCARD, NULL); if(inp =3D=3D NULL) { #if (__FreeBSD_version >=3D 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 >=3D 500043) - INP_INFO_RLOCK(&tcbinfo); + INP_INFO_RLOCK(pi); #endif - inp =3D in6_pcblookup_hash(&tcbinfo, &saddr->v6, sport, + inp =3D in6_pcblookup_hash(pi, &saddr->v6, sport, &daddr->v6, dport, 0, NULL); if (inp =3D=3D NULL) { - inp =3D in6_pcblookup_hash(&tcbinfo, &saddr->v6, sport, + inp =3D in6_pcblookup_hash(pi, &saddr->v6, sport, &daddr->v6, dport, INPLOOKUP_WILDCARD, NULL); if (inp =3D=3D NULL) { #if (__FreeBSD_version >=3D 500043) - INP_INFO_RUNLOCK(&tcbinfo); + INP_INFO_RUNLOCK(pi); #endif return (0); } @@ -2261,7 +2265,7 @@ *gid =3D inp->inp_socket->so_cred->cr_groups[0]; #if (__FreeBSD_version >=3D 500043) INP_UNLOCK(inp); - INP_INFO_RUNLOCK(&tcbinfo); + INP_INFO_RUNLOCK(pi); #endif #else *uid =3D inp->inp_socket->so_euid;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040131070219.GA72233>