Init script adds spurious IPv4 default route if dynamic-pool or prefix isn't configured

Bug #1031772 reported by Tore Anderson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tayga (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The init script contains the following code:

    if [ "x$CONFIGURE_IFACE" = "xyes" ] ; then
                $DAEMON --mktun
                ip link set $TUN_DEVICE up
                ip route add $DYNAMIC_POOL dev nat64
                ip route add $IPV6_PREFIX dev nat64
    fi

If the "dynamic-pool" setting isn't configured in /etc/tayga.conf, $DYNAMIC_POOL is empty. Similarly, if the "prefix" setting isn't, $IPV6_PREFIX is empty. (Both of these settings are optional.) This in turn means that one or both of the "ip route add" commands will evalue to "ip route add dev nat64", which will add a link-local IPv4 default route pointing to the nat64 interface:

root@tayga1-osl1:~# ip -4 r
default dev nat64 scope link
default via 87.238.62.26 dev eth0 metric 100
87.238.62.26/31 dev eth0 proto kernel scope link src 87.238.62.27

Since this new default route has a lower metric than the proper one added by ifupdown, IPv4 connectivity to the server is broken.

The fix is obviously to check whether or not the variables are defined prior to adding the routes. Patch attached.

Tore

Tags: patch

Related branches

Revision history for this message
Tore Anderson (toreanderson) wrote :
Revision history for this message
Tore Anderson (toreanderson) wrote :

Also, you might want to replace the static "nat64" for $TUN_DEVICE.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "tayga-init.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tayga - 0.9.2-6

---------------
tayga (0.9.2-6) unstable; urgency=low

  * Upload to unstable.

 -- Andrew Shadura <email address hidden> Sun, 05 May 2013 11:05:10 +0200

Changed in tayga (Ubuntu):
status: New → Fix Released
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.