Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jul 2002 11:58:46 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        arch@freebsd.org
Subject:   reintroduce handling of NULL route in ip_output()
Message-ID:  <20020714115846.C78146@iguana.icir.org>

next in thread | raw e-mail | index | archive | help
[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-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020714115846.C78146>