Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2013 09:42:36 -0600
From:      Will Andrews <will@firepipe.net>
To:        freebsd-net@freebsd.org
Cc:        "Justin T. Gibbs" <gibbs@freebsd.org>, Alan Somers <asomers@freebsd.org>
Subject:   CFR: FIB handling improvements
Message-ID:  <CADBaqmi6c7v8ojry8uViRi9tK18n8_RaDrP%2BUjvcmEN9guWm3w@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm working to port forward to FreeBSD/head, improvements made to FIB
handling by my colleagues Alan Somers and Justin Gibbs.

Please review: http://people.freebsd.org/~will/fix-fib-issues.1.diff

This patch includes fixes for several issues relating to FIBs:

* Use of dhclient with non-zero FIBs.  With this patch, it is possible
to use DHCP on a specific interface with a non-zero FIB and have it
work correctly with this rc.conf snippet:

ifconfig_em1="SYNCDHCP"
dhclient_fib_em1=1

This part of the patch includes a XXX, because I am not sure whether
the dhclient rc.d script should manually set the FIB on the given
interface, or if it should be inferred via some other mechanism.

* Always add loopback routes for non-zero FIBs, for both IPv4 and
IPv6.  Arguably, this could be a policy issue, but it is currently
less-than-trivial to specify (in rc.conf) that a route needs to be
applied to every FIB.

* Having two or more FIBs whose interfaces share the same prefix and
netmask.  This involves adding fibnum arguments to ifa_ifwithnet() and
ifa_ifwithdstaddr(), and checking it within.

* Setting the FIB on a network interface.  rtinit1() looks it up via
the current process context, so we must be calling setfib(2) from
within ifconfig.

* Creating & deleting loopback routes now works correctly for
non-default FIBs, by using the interface's FIB instead of always 0.

Commits would be made on each of these issues separately, but since
they are all related, I thought it would be easier for others to
evaluate them with context.

Thanks!
--Will.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADBaqmi6c7v8ojry8uViRi9tK18n8_RaDrP%2BUjvcmEN9guWm3w>