Subject: Re: gre: minor cleanups in netlink interface

From: Patrick McHardy <[email-masked]>
Date: Sat, 11 Oct 2008 16:45:48 +0200

Patrick McHardy wrote:
> Herbert Xu wrote:
>>> I noticed the interface expects to always get a full configuration
>>> on change requests. Is there are particular reason for not
>>> supporting incremental changes, lets say
>>>
>>> "ip link change dev gre0 type gre remote <new remote>"
>>>
>>> ? It looks easy enough to change, so I could take care of this.
>>
>> I think this should be done in iproute.  That way the user (or
>> rather the user-space programmer) gets to choose the behaviour.
>> This is also how the existing interface works too.
> 
> We don't have much precedent for rtnl_link besides VLAN (which
> does support incremental changes), but actually all other route
> netlink interfaces do support incremental changes by sending only
> a subset of the attributes. A reason for supporting this in the
> interface is that incremental userspace changes will always be
> racy because you need two seperate operations.

Its actually also what defines the difference between using
NLM_F_REPLACE (ip link replace) and no flags (ip link change).
The former replaces the replaces the object, the later changes
an existing object.