Merging rc.d/network_ipv6 into rc.d/netif

Mike Makonnen mtm at FreeBSD.Org
Thu May 17 13:40:17 UTC 2007


On Thu, Apr 05, 2007 at 11:02:51AM -0500, Brooks Davis wrote:
> > > 
> > > I fell fairly strongly that ipv6_network_interfaces and
> > > network_interfaces are a mistake and that we should remove them
> > > rather than propagating them.  The way I'd prefer to see interfaces
> > > that are exceptional with regard to address families specified with
> > > (|NO)IPV(4|6) variables in ifconfig_<interface> or simply by not
> > > having ipv(4|6)_ifconfig_interface variables (that it's a little more
> > > complicated than that with ipv4_addrs_<interface> around, but I think
> > > the concept holds).
> > 
> > I agree completely. However, when this hits the tree I don't want peoples
> > configurations to break (especially since I would like to see this in
> > 6-stable if we can aggree on it). Also, since this feature is already
> > deprecated in the man page I think we can provide silent support for
> > it without explicitly advertising it untill people have had a suffient
> > transition period.
> 
> OK, do you think it would be possible to kill off 

Yes, I think so. while working on the updated patch I realized that in
order for this to work it would require a violation POLA, so MFC isn't
going to be possible.

> 
> > > > 	ifconfig_DEFAULT
> > > > 	ifconfig_<interface>
> > > 
> > > ipv4 versions of these make sense, but at least ifconfig_<interface>
> > > should continue to exist.  For example both setting the mac address and
> > > starting WPA via the WPA keyword should not work in any address specific
> > > version because that would be a layering violation.
> > > 
> > 
> > Ok. That should be doable, but it's probably going to make
> > configuration decisions more complicated. For example, do we ignore
> > the WPA in the ipv(4|6)_* variables or does it's presence in any
> > of the variables enable it?
> 
> I'd ignore WPA outside of ifconfig_<interface>.  I think we'll want DHCP
> to work there and under ipv4_ifconfig_<interface>, but not IPv6.  That
> will change if/when a dhcp6 client arrives, but who knows when that will
> happen.

The current patch also moves DHCP to the versioned variables because it is
inevitable that we'll have an IPv6 dhcp client in the future. So, we might
as well prepare for it now.

BTW, there are some dhcp6 related knobs and
functions in the current patch, but they don't really do anything at the
moment. They are there to prepare the way for an IPv6 dhclient in the future
or to allow the one in the ports tree to plugin to rc.d easily.

The patch is at: http://people.freebsd.org/~mtm/src-etc.ipv6.diff

I have attached a description of the changes to this email.

Cheers.
-- 
Mike Makonnen         | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc
mmakonnen @ gmail.com | AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
mtm @ FreeBSD.Org     | FreeBSD - http://www.freebsd.org
-------------- next part --------------
Knobs that have been removed:
	network_interfaces
	ipv6_network_interfaces

These knobs have been removed at Brooks' suggestion. They denoted
whether an interface should be considered for IPv4 and IPv6 configuration,
respectively. Instead, now the user should use the NOIPV4 and NOIPV6
keyword in the ifconfig_<IF> variable of interface <IF> if it should *not*
be considered for v4 or v6 configuration, respectively.

Knobs that have changed meaning:
	ifconfig_<IF>
	ifconfig_DEFAULT

Currently these knobs are intended to be used for both non-IP *and* IPv4
configuration. Going forward they are intended for non-IP related
configuration only. The old2new_knobs() subroutine will issue a warning if it
detects certain IP related keywords in these knobs. The only IP related
keywords allowed in these two variables are: NOIPV4 and NOIPV6.

	synchronous_dhclient - When set to yes dhclient will be started
                               on DHCP interfaces during general network
                               startup. Currently, this implicitly refers
                               to IPv4 only. Going forward, it refers to both
                               IPv4 and IPv6. In practice, there will be no
                               differnce in behaviour until an IPv6 dhcp client
                               appears in the base system.
New knobs:
	ipv4_enable - similary to ipv6_enable, all IPv4 configuration of
                      interfaces and routing is enabled/disabled by setting
                      this knob to yes or no. Defaults to yes.
	ipv4_synchronous_dhclient - same as synchronous_dhclient, except it
                                    applies only to IPv4 interfaces.
	ipv6_synchronous_dhclient - same as above except for IPv6 interfaces.

Unfortunately, because some knobs (like ifconfig_DEFAULT) have changed
meanings, instead of being replaced, it is not possible to have
a completely seemless transition. You will have to edit rc.conf(5) in
order for your system to work properly after these changes. Having said that,
quite a few of the new IP version related knobs can be "automagically" set
based on the values of the knobs currently in use. These knobs are:
	gateway_enable     => ipv4_gateway_enable
	router_enable      => ipv4_router_enable
	router             => ipv4_router
	router_flags       => ipv4_router_flags
	defaultrouter      => ipv4_defaultrouter
	static_routes      => ipv4_static_routes
	static_routes_<IF> => ipv4_static_routes_<IF>
	route_<XXX>        => ipv4_route_<XXX>
	dhclient_program   => ipv4_dhclient_program
	dhclient_flags     => ipv4_dhclient_flags
	dhclient_flags_<IF> => ipv4_dhclient_flags_<IF>
	background_dhclient_<IF> => ipv4_background_dhclient_<IF>

The knobs that you will have to examine and modify manually are:
	ifconfig_<IF> - move IPv4 related configuration (including DHCP keyword)
                        to ipv4_ifconfig_<IF>
	ifconfig_<IF>_aliasX - move IPv4 related configuration to
                              ipv4_ifconfig_<IF>_aliasX
	ifconfig_DEFAULT - move IPv4 related configuration (including DHCP) to
                           ipv4_ifconfig_DEFAULT
	network_interfaces - for the interfaces *not* on this list put the
                             NOIPV4 keyword in the respective ifconfig_<IF>
                             variable and delete this knob
	ipv6_network_interfaces - for the interfaces *not* on this list put the
                                  NOIPV6 keyword in the respective ifconfig_<IF>
                                  variable and delete this knob

Some network subroutines have been changed, and some have been split out to
reflect their use in IP v4 and v6 configuration. Here's what they look like
after the change:

ifconfig_up / ifconfig_down - Non-IP related ifconfig(8) configuration
ifconfig_up4 / ifconfig_down4 - IPv4 related ifconfig(8) configuration
ifconfig_up6 / ifconfig_down6 - IPv6 related ifconfig(8) configuration
dhcpif4 - Returns 0 if the IPv4 address of an interface should be configured
          automatically by DHCP
dhcpif6 - Returns 0 if the IPv6 address of an interface should be configured
          automatically by DHCP
dhcpif - Returns 0 if either or both IP address versions are configured
         automatically by DHCP.
syncdhcpif4 - Returns 0 if dhclient(8) should be run synchronously for IPv4
              in the general network start script.
syncdhcpif6 - Same as above except it refers to IPv6 configuration
ipv4if - Returns 0 if the interface should be configured for IPv4
ipv6if - Returns 0 if the interface should be configured for IPv6
post_ifconfig_up4 / post_ifconfig_down4 - Configure IPv4 alias knobs and
                                          entries in CIDR notation
post_ifconfig_up6 - configure IPv6 alias knobs
ifalias_up4 / ifalias_down4 - Configure IPv4 alias entries. Called by
                              post_ifconfig_up4/down4 routines, respectively.
ifalias_up6 / ifalias_down6 - configure IPv6 alias knobs. Called by
                              post_ifconfig_up6().
delete_addrs6 - remove IPv6 addresses from an interface. Called by
                ifconfig_down6().
list_net_interfaces - Lists network interfaces of the following types:
                      <no type> - All IPv4 interfaces (legacy behaviour)
                      ipv4 - all IPv4 interfaces
                      ipv6 - all IPv6 interfaces
                      nodhcp - all interfaces, excluding DHCP configured
                               interfaces
                      dhcp  - list only DHCP configured interfaces
                      dhcp4 - list only DHCP configured IPv4 interfaces
                      dhcp6 - list only DHCP configured IPv6 interfaces
rtsol_up - starts rtsol(8) on an interface
stf_up - setup IPv4 to IPv6 mapping
faith_up - setup a faith(4) interface
default_interface_up - set default IPv6 interface
working_ipv6_interfaces - lists valid IPv6 interfaces

There are also a bunch of support functions that begin with an underscore '_'.
They are meant to be private to network.subr and are called by some of the
subroutines listed above.


More information about the freebsd-rc mailing list