From owner-freebsd-net@FreeBSD.ORG Thu Jun 23 10:08:09 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7886E16A41C for ; Thu, 23 Jun 2005 10:08:09 +0000 (GMT) (envelope-from ari@suutari.iki.fi) Received: from espresso2.syncrontech.com (sync-old.syncrontech.com [213.28.98.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F66343D48 for ; Thu, 23 Jun 2005 10:08:04 +0000 (GMT) (envelope-from ari@suutari.iki.fi) Received: from guinness.syncrontech.com (guinness.syncrontech.com [62.71.8.57]) by espresso2.syncrontech.com (8.12.11/8.12.11) with ESMTP id j5NA80Js007122; Thu, 23 Jun 2005 13:08:00 +0300 (EEST) (envelope-from ari@suutari.iki.fi) Received: from [62.71.8.37] (coffee.syncrontech.com [62.71.8.37]) by guinness.syncrontech.com (8.12.11/8.12.11) with ESMTP id j5NA7rRZ037724; Thu, 23 Jun 2005 13:07:53 +0300 (EEST) (envelope-from ari@suutari.iki.fi) Message-ID: <42BA89F3.3060406@suutari.iki.fi> Date: Thu, 23 Jun 2005 13:07:47 +0300 From: Ari Suutari User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Luigi Rizzo References: <42B7B352.8040806@suutari.iki.fi> <42BA6A22.6030506@suutari.iki.fi> <20050623010618.B7580@xorpc.icir.org> In-Reply-To: <20050623010618.B7580@xorpc.icir.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Policy routing idea (Was: ipfw: Would it be possible to continue processing rest of rules after match ?) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 10:08:09 -0000 Hi, Luigi Rizzo wrote: > for the chunk at --- 2951,2987 ---- > i think it would be better to reuse the 'case TOK_FORWARD', > by changing the opcode and messages according to the actual command. Changed. > here too i would reuse the existing code more, e.g. in ipfw_log() > put 'case O_SETNEXTHOP' next to case 'O_FORWARD_IP' and replace > the string "Forward" in the first snprintf() with "%s" and an > additional argument cmd->opcode == O_FORWARD_IP ? "Forward" : "SetNextHop" Done. > > Same in the action part at --- 2474,2490 ----, just reuse the > O_FORWARD case and end the block with > > if (cmd->opcode == O_FORWARD_IP) > goto done; > else > goto next_rule; Done. > > and the check for instruction format --- 3055,3069 ---- > can just reuse the O_FORWARD_IP code with no modifications. Done. Updated patch files are again at http://www.suutari.iki.fi/freebsd/ Also, some limited testing has been done. Ari S.