Package: kvm
Version: 18-1
Severity: normal

Hello,
kvm-ifup tries to bridge the network interface of the virtual machine
with the interface used for the default route.

To extract interface name it uses this instruction:

switch=$(/sbin/ip route list | awk '/^default / { print $NF }')

i.e. it uses the last field of the default route. This works as long as
the route is simple enough, e.g.:

default via 10.0.0.138 dev br0

On my system the default route has both an explicit metric and a realm,
so it looks like this:

default via 10.0.0.138 dev br0  metric 1 realm 10

Since the output of 'ip route ls' does not have a fixed format I suggest
to use the following awk program:

switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if ($(i) == 
"dev") print $(i+1) }}')

which matches the default route and prints the field following the 'dev'
token (which is always the interface name).


Luca Tettamanti

-- Package-specific info:


/proc/cpuinfo:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 CPU          6400  @ 2.13GHz
stepping        : 6
cpu MHz         : 2128.000
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc 
pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips        : 4273.69
clflush size    : 64

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 CPU          6400  @ 2.13GHz
stepping        : 6
cpu MHz         : 1596.000
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc 
pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips        : 4270.10
clflush size    : 64




-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.21-rc5libata-gce20269d-dirty
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.utf8)

Versions of packages kvm depends on:
ii  adduser  3.97                            Add and remove users and groups
ii  bridge-u 1.2-1                           Utilities for configuring the Linu
ii  iproute  20061002-4                      Professional tools to control the 
ii  libasoun 1.0.13-2                        ALSA library
ii  libc6    2.3.6.ds1-11                    GNU C Library: Shared libraries
ii  libsdl1. 1.2.11-7                        Simple DirectMedia Layer
ii  libuuid1 1.39+1.40-WIP-2006.11.14+dfsg-1 universally unique id library
ii  zlib1g   1:1.2.3-13                      compression library - runtime

Versions of packages kvm recommends:
pn  kvm-so <none>                            (no description available)
ii  linux- 2.6.16+2.6.17-rc3-0experimental.1 Linux kernel 2.6.17-rc3 image on A
ii  qemu   0.9.0-1                           fast processor emulator
pn  vde2   <none>                            (no description available)

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to