From owner-freebsd-bugs@freebsd.org Mon Sep 12 20:25:46 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD49DBD827D for ; Mon, 12 Sep 2016 20:25:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C04CFCD7 for ; Mon, 12 Sep 2016 20:25:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u8CKPkdi030368 for ; Mon, 12 Sep 2016 20:25:46 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212630] ipfw swap does not swap tables between sets Date: Mon, 12 Sep 2016 20:25:46 +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: 11.0-RC1 X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: avernar@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org 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 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 20:25:47 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212630 Bug ID: 212630 Summary: ipfw swap does not swap tables between sets Product: Base System Version: 11.0-RC1 Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: avernar@gmail.com I have net.inet.ip.fw.tables_sets=3D1 to place tables into sets. The ipfw = set move command works and moves the tables into the new set. The ipfw set swap command does not swap the tables between sets. #sysctl net.inet.ip.fw.tables_sets=3D1 #ipfw set 2 table test create #ipfw set 3 table test create #ipfw set 2 table test add 10.0.0.0/8 #ipfw add set 2 deny all from any to "table(test)" via tun #ipfw -S table all list --- table(test), set(3) --- --- table(test), set(2) --- 10.0.0.0/8 0 #ipfw set swap 2 3 #ipfw -S table all list --- table(test), set(3) --- --- table(test), set(2) --- 10.0.0.0/8 0 It looks like the swap_sets_cb function in is getting called multiple times= for the same tables: swap_sets_cb: no=3D0xfffff80013313d00, no->kidx=3D2, no->name=3Dtest, no->s= et=3D3, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff800b21e0b00, no->kidx=3D1, no->name=3Dtest, no->s= et=3D2, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff80013313d00, no->kidx=3D2, no->name=3Dtest, no->s= et=3D2, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff800b21e0b00, no->kidx=3D1, no->name=3Dtest, no->s= et=3D3, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff80013313d00, no->kidx=3D2, no->name=3Dtest, no->s= et=3D3, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff800b21e0b00, no->kidx=3D1, no->name=3Dtest, no->s= et=3D2, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff80013313d00, no->kidx=3D2, no->name=3Dtest, no->s= et=3D2, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff800b21e0b00, no->kidx=3D1, no->name=3Dtest, no->s= et=3D3, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff80013313d00, no->kidx=3D2, no->name=3Dtest, no->s= et=3D3, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff800b21e0b00, no->kidx=3D1, no->name=3Dtest, no->s= et=3D2, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff80013313d00, no->kidx=3D2, no->name=3Dtest, no->s= et=3D2, args->set=3D2, args->new_set=3D3 swap_sets_cb: no=3D0xfffff800b21e0b00, no->kidx=3D1, no->name=3Dtest, no->s= et=3D3, args->set=3D2, args->new_set=3D3 That is all the calls for one "ipfw set swap 2 3" command. Since it's an e= ven number of calls for each object they all end up in their original sets inst= ead of swapped. Ah, just figured out why. Each table rewriter is asked to swap tables and their are six rewriters. Each rewriter's table_manage_sets calls ipfw_obj_manage_sets to swap the two tables. That's why I see 6 calls to swap_sets_cb, 6 rewriters x 2 tables =3D 12 calls. That's why it doesn't s= wap. I also checked how many times move_sets_cb is called and it's also 12 times= (6 * 2). But for move it's only one way so it ends up working. --=20 You are receiving this mail because: You are the assignee for the bug.=