All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Rousse <Guillaume.Rousse@inria.fr>
To: xen-devel@lists.xensource.com
Subject: bug in default interface number computation
Date: Thu, 14 Dec 2006 12:34:27 +0100	[thread overview]
Message-ID: <458136C3.3030308@inria.fr> (raw)

Hello.

The network-bridge script tries to automatically find the default
network interface number with the following ligne:
vifnum=${vifnum:-$(ip route list | awk '/^default / { print $NF }' | sed
's/^[^0-9]*//')}

However, this fails on mandriva, because the parsed line is:
default via 193.55.250.126 dev eth0  metric 10

This causes many troubles, such as:
http://article.gmane.org/gmane.comp.emulators.xen.user/17846

A simple solution is to change the position-based parsing to something
more robust:
vifnum=${vifnum:-$(ip route list 0.0.0.0/0 | sed 's/.*dev
[^0-9]\+\([0-9]\+\).*$/\1/')}

This is also more robust against default interfaces that would be named
otherwise as dev[0-9].

                 reply	other threads:[~2006-12-14 11:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=458136C3.3030308@inria.fr \
    --to=guillaume.rousse@inria.fr \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.