[PATCH 1/4] Support routes with different devs and gateways

Gernot Hillier gernot.hillier at siemens.com
Tue Oct 17 01:54:09 PDT 2017


Am 17.10.2017 um 10:35 schrieb [ext] Gernot Hillier:
> Dear David!
> 
> Thanks for reviewing!
> 
> Am 17.10.2017 um 10:04 schrieb David Woodhouse:
>> On Wed, 2017-10-11 at 22:39 +0200, Gernot Hillier wrote:
>>> Extend the *_network_route helper functions by parameters to specify device
>>> and, optionally, gateway for the route.
>>
>> Is this tested in *BSD, Solaris, OSX, etc?
> 
> Nope, sorry, only Linux (and Windows) machines here. I forced it to use
> /sbin/route instead of /sbin/ip, so the /sbin/route code should work as
> intended.
> 
> But there should be Siemens colleagues with OSX or *BSD wanting to test
> it, I'll ask around.
> 
>>> @@ -248,7 +248,12 @@ if [ -n "$IPROUTE" ]; then
>>>  		NETWORK="$1"
>>>  		NETMASK="$2"
>>>  		NETMASKLEN="$3"
>>> -		$IPROUTE route replace "$NETWORK/$NETMASKLEN" dev "$TUNDEV"
>>> +		NETDEV="$4"
>>> +		if [ -n "$5" ]; then
>>> +			$IPROUTE route replace "$NETWORK/$NETMASKLEN" dev "$NETDEV" via "$5"
>>
>> Can you assign $5 to a local variable and use it from there, like we do
>> for $1-$4? 
> 
> Sure, will rework it for v2 of series.

Ah, and BTW, these are global, not local variables. Something which made
me scratching my head for quite some time when looking for a bug in the
/sbin/route case with re-enabled route cleanup (my patch no. 4).
set_network_route used to call del_network_route which overwrote the
used global variables...

--
Gernot



More information about the openconnect-devel mailing list