[lfs-dev] script ifdown "ip addr show ${IFACE} | grep 'inet'" notwork.

Matt Burgess matthew at linuxfromscratch.org
Thu Aug 9 11:35:23 PDT 2012


On Fri, 2012-08-10 at 02:11 +0800, xinglp wrote:
> 2012/8/10 Matthew Burgess <matthew at linuxfromscratch.org>:
> > On Thu, 9 Aug 2012 23:15:32 +0800, xinglp <xinglp at gmail.com> wrote:
> >> Maybe we should replace "ip addr show ${IFACE}" with "ip -f inet addr
> >> show ${IFACE}".
> >
> > It would help if you explained *why* you think this needs changing.
> > Does the current code not work?  If so, how does the bug/issue manifest
> > itself?
> >
> 
> older version
> ============================
> root [ ~ ]# ip --Version
> ip utility, iproute2-ss120521
> root [ ~ ]# ip addr show eth0
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state
> UNKNOWN qlen 1000
>     link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
>     inet 192.168.x.x/24 brd 192.168.x.255 scope global eth0
>     inet6 fe80::xxxxxx/64 scope link
>        valid_lft forever preferred_lft forever
> 
> newer verion
> ============================
> root [ ~ ]# ip --Version
> ip utility, iproute2-ss120801
> root [ ~ ]# ip addr show eth0
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> state UP qlen 1000
>     link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
> root [ ~ ]# ip -f inet addr show eth0
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> state UP qlen 1000
>     inet 192.168.x.x/24 brd 192.168.x.255 scope global eth0
> 
> So the newer verion of 'ip' did not show the
> "inet 192.168.x.x/24 brd 192.168.x.255 scope global eth0"
> without option "-f inet".

Yeah, that definitely looks like a bug to me, thanks for the report.

I think upstream reports need to be sent to netdev at vger.kernel.org, if
you wouldn't mind?

Thanks,

Matt.




More information about the lfs-dev mailing list