From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 25 16:30:32 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C4BF16A4CE for ; Mon, 25 Oct 2004 16:30:32 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C15643D54 for ; Mon, 25 Oct 2004 16:30:32 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9PGUWOc021524 for ; Mon, 25 Oct 2004 16:30:32 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9PGUWOx021520; Mon, 25 Oct 2004 16:30:32 GMT (envelope-from gnats) Resent-Date: Mon, 25 Oct 2004 16:30:32 GMT Resent-Message-Id: <200410251630.i9PGUWOx021520@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vladimir Ivanov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA1EB16A4CF for ; Mon, 25 Oct 2004 16:30:23 +0000 (GMT) Received: from wawa.yandex.ru (wawa.yandex.ru [213.180.193.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id D008243D2F for ; Mon, 25 Oct 2004 16:30:22 +0000 (GMT) (envelope-from wawa@wawa.yandex.ru) Received: from wawa.yandex.ru (localhost [127.0.0.1]) by wawa.yandex.ru (8.13.1/8.13.1) with ESMTP id i9PGULwj001249 for ; Mon, 25 Oct 2004 20:30:21 +0400 (MSD) (envelope-from wawa@wawa.yandex.ru) Received: (from root@localhost) by wawa.yandex.ru (8.13.1/8.13.1/Submit) id i9PGULrU001248; Mon, 25 Oct 2004 20:30:21 +0400 (MSD) (envelope-from wawa) Message-Id: <200410251630.i9PGULrU001248@wawa.yandex.ru> Date: Mon, 25 Oct 2004 20:30:21 +0400 (MSD) From: Vladimir Ivanov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/73129: IPFW misbehaviour in RELENG_5 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Vladimir Ivanov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2004 16:30:32 -0000 >Number: 73129 >Category: kern >Synopsis: IPFW misbehaviour in RELENG_5 >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 25 16:30:31 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Vladimir Ivanov >Release: FreeBSD 5.3-STABLE i386 >Organization: Yandex LLC >Environment: System: FreeBSD wawa.yandex.ru 5.3-STABLE FreeBSD 5.3-STABLE #0: Mon Oct 25 19:21:30 MSD 2004 wawa@wawa.yandex.ru:/usr/src/sys/i386/compile/WAWA i386 >Description: IPFW does not forward packets which has dst-addr from directly connected network. >How-To-Repeat: there are three interfaces on router: vlan3: flags=8843 mtu 1500 inet 213.180.192.168 netmask 0xfffffff0 broadcast 213.180.192.175 ether 00:30:48:29:e9:62 media: Ethernet 1000baseTX (1000baseTX ) status: active vlan: 3 parent interface: em0 vlan159: flags=8843 mtu 1500 inet 213.180.200.254 netmask 0xffffff00 broadcast 213.180.200.255 ether 00:30:48:29:e9:62 media: Ethernet 1000baseTX (1000baseTX ) status: active vlan: 159 parent interface: em0 vlan169: flags=8843 mtu 1500 inet 213.180.218.254 netmask 0xffffff00 broadcast 213.180.218.255 ether 00:30:48:29:e9:62 media: Ethernet 1000baseTX (1000baseTX ) status: active vlan: 169 parent interface: em0 Firewall: fwd 213.180.192.162 tcp from 213.180.200.32/28 to 213.180.218.0/24 in via vlan159 allow ip from any to any The very first firewall command does not forward packets et all. Though it increments counters I've found a strange piece of code in the module ip_route.c. The problem may be fixed by removing a couple of lines. I'm not sure whether it is a valid solution cause code is pretty complicated. Author's comments are desirable :-) >Fix: --- ip_output.c.orig Sun Oct 3 21:04:40 2004 +++ ip_output.c Mon Oct 25 20:01:59 2004 @@ -706,16 +706,11 @@ /* Or forward to some other address? */ fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); if (fwd_tag) { - if (!in_localip(ip->ip_src) && !in_localaddr(ip->ip_dst)) { - dst = (struct sockaddr_in *)&ro->ro_dst; - bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); - m->m_flags |= M_SKIP_FIREWALL; - m_tag_delete(m, fwd_tag); - goto again; - } else { - m_tag_delete(m, fwd_tag); - /* Continue. */ - } + dst = (struct sockaddr_in *)&ro->ro_dst; + bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); + m->m_flags |= M_SKIP_FIREWALL; + m_tag_delete(m, fwd_tag); + goto again; } #endif >Release-Note: >Audit-Trail: >Unformatted: