From owner-freebsd-bugs@FreeBSD.ORG Sun Aug 3 01:57:02 2014 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACCD9B46 for ; Sun, 3 Aug 2014 01:57:02 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D823290E for ; Sun, 3 Aug 2014 01:57:02 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s731v2GE089378 for ; Sun, 3 Aug 2014 01:57:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 192350] New: [ipf] ipnat via kld doesn't work with INET6 kernel option Date: Sun, 03 Aug 2014 01:57:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: newnix.ua@gmail.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Aug 2014 01:57:02 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192350 Bug ID: 192350 Summary: [ipf] ipnat via kld doesn't work with INET6 kernel option Product: Base System Version: 10.0-STABLE Hardware: Any OS: Any Status: Needs Triage Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: newnix.ua@gmail.com Created attachment 145286 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=145286&action=edit ipv6 fix to ip_compat.h to work with ipf/ipnat Just boot into this livecd ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/amd64/amd64/ISO-IMAGES/10.0/FreeBSD-10.0-STABLE-amd64-20140725-r269083-disc1.iso or i386 one Then type kldload ipfilter && ipnat -l you'll get this: 70:ioctl(SIOCGNATS) object size mismatch for copying out ipfobj To fix this in installed system: cd /usr/src patch -p0 < /root/ipnat-ip6fix-ip_compat.diff cd sys/modules/ipfilter/ && make clean cd ../../../sbin/ipf && make all install clean Then: ipnat -l List of active MAP/Redirect filters: List of active sessions: Looks like Cy Schubert broke it with this fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190964 Here is what was changed in his fix that breaks ipnat when INET6 is enabled: root@amd64older:/usr/src/sys/contrib/ipfilter # diff -r /usr/src/sys/contrib/ipfilter /root/src/sys/contrib/ipfilter diff -r /usr/src/sys/contrib/ipfilter/netinet/ip_compat.h /root/src/sys/contrib/ipfilter/netinet/ip_compat.h 7c7 < * $FreeBSD: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h 255754 2013-09-21 03:57:56Z cy $ --- > * $FreeBSD: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h 268937 2014-07-21 06:45:19Z cy $ 36,39d35 < #if defined(__FreeBSD_version) && (__FreeBSD_version >= 400000) && \ < !defined(_KERNEL) && !defined(USE_INET6) && !defined(NOINET6) < # define USE_INET6 < #endif Sure this def utilizes an old way to pass kernel build options so NOINET6 does not work. But deleting this ifdef completely forces to compile userland ipf without -DUSE_INET6. So we should use MK_INET_SUPPORT in some way and it was made in this same file (ip_compat.h): # define HAS_SYS_MD5_H 1 # if defined(_KERNEL) # include "opt_bpf.h" # include "opt_inet6.h" # if defined(INET6) && !defined(USE_INET6) # define USE_INET6 # endif # endif As you can see for some reason it was made not to work with userland. Is there a strong reason for this? Is it safe to enable it here or this must be done in some other way? -- You are receiving this mail because: You are the assignee for the bug.