Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Mar 2007 16:00:13 +0000
From:      "Bruce M. Simpson" <bms@FreeBSD.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>,  freebsd-net@FreeBSD.org,  Vladimir Ivanov <wawa@yandex-team.ru>, bug-followup@FreeBSD.org
Subject:   Re: kern/106722: [net] [patch] ifconfig may not connect an	interface to known network
Message-ID:  <45F81C0D.2000608@FreeBSD.org>
In-Reply-To: <20070314115916.GB2713@cell.sick.ru>
References:  <20070314115916.GB2713@cell.sick.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Gleb Smirnoff wrote:
> AFAIK, the problem needs a more generic approach. I see two approaches.
>
> 1) Introduce RTM_CHANGEADD, a command that will forcibly add route,
> deleting all conflicting ones. Use this command in in_addprefix().
>
> 2) In rt_flags field we still have several extra bits. We can use
> them to specify route source - RTS_CONNECTED, RTS_STATIC, RTS_XXX,
> where XXX is a routing protocol. When issuing RTM_ADD a route with
> a preferred source (e.g. CONNECTED vs STATIC) will override the old
> one.
>
>   

The proposed changes also constitute a hack.

I understand that they are being proposed to address problems we 
currently have in the stack, i.e. that we do not support multipathing, 
though it is more than likely they will be blown away in future when the 
architecture changes (and it has to change).

Approach 1 is largely irrelevant if multiple paths are introduced to the 
network stack; there is then no concept of a conflicting forwarding 
entry, only preference derived from the interface, entry flags, or the 
entry ('route') itself.

Approach 2 has some merit to it, although the forwarding plane should 
not care where the forwarding entry came from unless it needs to (e.g. 
next-hop resolution).

It seems reasonable that the forwarding plane should tag entries as 
being 'CONNECTED' i.e. derived from the address configuration of an 
interface. I believe many implementations out there do this, and 
multi-path does not change this.

We already have the RTF_PROTO1 flag to determine if the forwarding entry 
('route') came from a routing protocol in userland, so there should be 
no need to change the existing flags.

The RTF_STATIC flag only has special meaning in that it means 'the user 
added this forwarding entry manually via the route(8) command'. We 
should preserve these semantics, though I believe we should start 
implementing forwarding preference in the radix trie.

I think it seems acceptable and reasonable that we use a limited form of 
Approach 2 to clobber 'routes' being aded in the case described in the 
PR, until such time as the network stack is re-engineered to support 
multiple paths and forwarding preference.

I also believe it is useful if we start to use more modern technical 
jargon to discuss 'routes' in the network stack, because we are actually 
discussing the behaviour of entries in a forwarding table.

Regards,
BMS



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