Comment 0 for bug 1544802

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

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 dev wlp3s0 proto static metric 600 dev wlp3s0 scope link metric 1000 dev wlp3s0 proto kernel scope link src 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.