Bug 475249 - xen network-bridge script doesn't work with SRCADDR option in default route interface
Summary: xen network-bridge script doesn't work with SRCADDR option in default route i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen
Version: 5.2
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Michal Novotny
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 492190
TreeView+ depends on / blocked
 
Reported: 2008-12-08 17:22 UTC by Miguel Armas
Modified: 2014-02-02 22:36 UTC (History)
5 users (show)

Fixed In Version: xen-3.0.3-84.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 10:11:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Network-bridge script patch (674 bytes, patch)
2009-03-24 10:36 UTC, Michal Novotny
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1328 0 normal SHIPPED_LIVE xen bug fix and enhancement update 2009-09-01 10:32:30 UTC

Description Miguel Armas 2008-12-08 17:22:35 UTC
Description of problem:

If we define the option SRCADDR in the default route interface and we use xen, the script network-bridge does not create the default xen bridge xenbrX.

Version-Release number of selected component (if applicable):

 - xen-3.0.3-64.el5_2.3

How reproducible:

Always

Steps to Reproduce:
1. Define the option SRCADDR in the default route interface
2. Run /etc/xen/scripts/network-bridge start
3. We will get an error
  
Actual results:

network-bridge does not create the default xen bridge

Expected results:

network-bridge should create the default xen bridge xenbr0

Additional info:

The problem is the way the network-bridge script tries to find the vifnum to use. It uses:

vifnum=${vifnum:-$(ip route list | awk '/^default / { print $NF }' | sed 's/^[^0
-9]*//')}

This works if we don't have the SRCADDR, because the normal output for 'ip route list | grep /^default/' is:

default via 88.2.XX.XX dev eth1.11

So the dev is the last field, but if we use the SRCADDR option, the output is:

default via 88.2.XX.XX dev eth1.11  src 88.2.XX.ZZ

So it tries to use 88.2.XX.ZZ as the vifnum

A very simple fix is to define the vifnum in the /etc/xen/xend-config.sxp file:

(network-script 'network-bridge vifnum=0')

But I guess it would be nice to have that fixed so people does not waste time trying to make it work

Comment 2 Michal Novotny 2009-03-24 10:36:50 UTC
Created attachment 336442 [details]
Network-bridge script patch

This is a patch which solves issue of invalid vifnum device when SRCADDR option is defined in default routing interface. Basically it parses the options on the line using AWK expression to get correct vifnum. Tested using both SRCADDR defined and undefined in `ip route` and working fine for both cases.

Michal

Comment 3 Jiri Denemark 2009-04-29 17:23:48 UTC
Fix built into xen-3.0.3-84.el5

Comment 5 zhanghaiyan 2009-07-29 10:04:59 UTC
Can you please help to give out steps on 'how to define the option SRCADDR in the default route interface'? Thanks a lot

Comment 6 Jiri Denemark 2009-08-03 06:41:43 UTC
ip route del default via $GATEWAY dev $IFACE
ip route add default via $GATEWAY dev $IFACE src $IFACE_IP

Comment 7 zhanghaiyan 2009-08-03 08:14:42 UTC
Verified on xen-3.0.3-93.el5  and PASS

Comment 9 errata-xmlrpc 2009-09-02 10:11:15 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1328.html


Note You need to log in before you can comment on or make changes to this bug.