Support default route with non-default attributes

Bug #1544802 reported by Shaheed Haque
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vpnc-scripts (Ubuntu)
New
Undecided
Unassigned

Bug Description

The /usr/share/vpnc-scripts/vpnc-script handles updates to the default route using two different codepaths. In one codepath, the command "ip route replace" is used to update the original default route with new one (and to restore it later). The replace command in the update case does not work if the original route default route has non-standard attributes. For example, an original default route like this:

$ sudo ip route
default via 192.168.1.254 dev wlp3s0 proto static metric 600
169.254.0.0/16 dev wlp3s0 scope link metric 1000
192.168.1.0/24 dev wlp3s0 proto kernel scope link src 192.168.1.85 metric 600

cannot be simply "ip route replace"d by a command of the form "ip route replace dev <foo>". Also, the present logic to save and then restore the original rute is broken because not all the route attributes are preserved AND the replacement attributes don't match the attributes of the new default route.

The attached patch addresses both these problems.

The software versions in use are up-to-date Wily with:

$ dpkg-query -l | egrep 'vpnc-scripts|iproute'
ii iproute 1:4.1.1-1ubuntu1 all transitional dummy package for iproute2
ii iproute2 4.1.1-1ubuntu1 amd64 networking and traffic control tools
ii vpnc-scripts 0.1~git20140806-1 all Network configuration scripts for VPNC and OpenConnect

Tags: patch
Revision history for this message
Shaheed Haque (srhaque-i) wrote :
description: updated
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Proposed patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Mike Miller (mtmiller) wrote :

Hi Shaheed, would you mind sending your patch to <email address hidden>? Please see http://www.infradead.org/openconnect/contribute.html for contribution guidelines.

Thanks!

Revision history for this message
Shaheed Haque (srhaque-i) wrote : Re: [Bug 1544802] Re: Support default route with non-default attributes
Revision history for this message
Dimitri Papadopoulos (dimitri-papadopoulos) wrote :

Hi Shaheed,

I have tried to integrate your patch here:
https://gitlab.com/openconnect/vpnc-scripts/-/merge_requests/56

Perhaps it would help to continue the discussion there.

I am testing on an Ubuntu 22.04 workstation and here are my findings:

- In my specific case, I don't see any difference in routes before/after using your patch.

- In my specific case, the patch generates error messages:
   Error: either "to" is duplicate, or "default" is a garbage.
   RTNETLINK answers: File exists

Revision history for this message
Dimitri Papadopoulos (dimitri-papadopoulos) wrote :

I really don't understand the expected benefit of using add/delete over replace.

Can you comment on the following?
"The replace command in the update case does not work if the original route default route has non-standard attributes."

Revision history for this message
Dimitri Papadopoulos (dimitri-papadopoulos) wrote :

Which route attributes? Usually different metrics, I guess?

Revision history for this message
Shaheed Haque (srhaque-i) wrote :

Sorry I failed to see the earlier activity.

Anyway, in the most common case, yes I would think that the metric is the most
Common attribute.

However, the broader point is that a route can be seriously non trivial
Construct (as you will know from the man page) so if we want to delete, save and restore
It then anything which supports less than the full syntax will likely leave
The system in a wholly broken state.

Now, it has been a while, and I'm not very close to
The issue these days, but I can try to answer any further
Questions.

Revision history for this message
Shaheed Haque (srhaque-i) wrote :

Oh, the problem with using "replace" is that it does not seem to support all the attributes
That "add" supports.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.