FreeBSD NAT-T patch integration [CFR/CFT]

VANHULLEBUS Yvan vanhu at FreeBSD.org
Mon Jul 21 08:31:13 UTC 2008


On Wed, Jul 16, 2008 at 09:10:18PM -0700, Sam Leffler wrote:
[...]
> Please test/review the following patch against HEAD:
> 
> http://people.freebsd.org/~sam/nat_t-20080616.patch

I have tested the RELENG7 version of the patch, and it works well.


But I noticed a misplaced #endif at the beginning of udp_ctloutput(),
which will generate problems if INET6 is not defined:

	 if (sopt->sopt_level != IPPROTO_UDP) {
#ifdef INET6
		if (INP_CHECK_SOCKAF(so, AF_INET6)) {
			INP_WUNLOCK(inp);
			error = ip6_ctloutput(so, sopt);
#endif
		} else {
		    INP_WUNLOCK(inp);
			error = ip_ctloutput(so, sopt);
#ifdef INET6
		}
#endif
		return (error);
	}


The code should be:


	 if (sopt->sopt_level != IPPROTO_UDP) {
#ifdef INET6
		if (INP_CHECK_SOCKAF(so, AF_INET6)) {
			INP_WUNLOCK(inp);
			error = ip6_ctloutput(so, sopt);
		} else {
#endif
		    INP_WUNLOCK(inp);
			error = ip_ctloutput(so, sopt);
#ifdef INET6
		}
#endif
		return (error);
	}




Yvan.


More information about the freebsd-net mailing list