From owner-freebsd-net Sun Jul 14 11:58:53 2002 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 EF01B37B400; Sun, 14 Jul 2002 11:58:46 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D02D43E5E; Sun, 14 Jul 2002 11:58:46 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g6EIwka78526; Sun, 14 Jul 2002 11:58:46 -0700 (PDT) (envelope-from rizzo) Date: Sun, 14 Jul 2002 11:58:46 -0700 From: Luigi Rizzo To: arch@freebsd.org Subject: reintroduce handling of NULL route in ip_output() Message-ID: <20020714115846.C78146@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org [discussion on -arch, Bcc to -net in case someone is interested there] Hi, I would like to reintroduce the ability to pass a NULL route to p_output(), which has been possible up to rev.1.34 of ip_output(). Making ip_output() unable to handle NULL routes only saved a single "if (ro == NULL)" check, but caused the work of allocating/deallocating the route to be replicated in multiple places in the clients of ip_output(), and the way this is done is very inconsistent, sometimes involving the use of static variables which (apart from potential errors due to misuse) are a no-no if we ever want to go to fine-grained locking in the network stack. See for example how the route to ip_output is passed in netinet/igmp.c netinet/ip_mroute.c netinet/ip_input.c netinet/tcp_subr.c at least in one place there is a "bug" (like resetting some fields of an automatic variable right before exiting from the block). Other usages look suspicious too. My reason to re-allow NULL routes in ip_output() are: * simplify the code in the callers by centralizing a common function; * make another step towards the removal of global variables in the protocol stack; Does any of you have strong and _motivated_ objections ? thanks luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message