Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 113672 - baselayout-1.12.0_pre11-r1: "interface_is_up $ifname true" check always fails
Summary: baselayout-1.12.0_pre11-r1: "interface_is_up $ifname true" check always fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-26 17:02 UTC by Georgi Georgiev
Modified: 2005-11-28 03:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georgi Georgiev 2005-11-26 17:02:24 UTC
baselayout-1.12.0_pre11-r1 always fails the "iproute2_is_up with address" check
when it is passed the "true" parameter. Looking at the function makes it clear why:

iproute2_is_up() {
        local check="\<UP\>" addr="${2:-false}"
        ${addr} && check="${check}.*inet "
        ip addr show "$1" | grep -Eq "${check}" && return 0
        return 1
}

Taking for example eth0, this results in
ip addr show eth0 | grep -Eq "\<UP\>.*inet" && return 0

Well,
$ /sbin/ip addr show eth0
3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:11:2f:d6:2a:bd brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.2/24 brd 10.0.0.255 scope global eth0
    inet 10.0.0.12/24 brd 10.0.0.255 scope global secondary eth0
    inet6 2001:240:516:1::2/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::211:2fff:fed6:2abd/64 scope link 
       valid_lft forever preferred_lft forever

However, grep -e "\<UP\>.*inet" never matches, since "inet" is not mentioned on
the same line where UP is mentioned. An ugly workaround is to modify the test
like this:

echo $(ip addr show "$1") | ... 

This is a showstopper for a diskless station where the initscript currently
assumes that the interface is not up and tries to remove all addresses before
bringing it up which in turn makes everything fail after the addresses disappear
and the communication with the NFS server is lost.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2005-11-28 03:04:49 UTC
Using xargs also work - fixed in pre11-r2