On Wed, Mar 24, 2010 at 10:25:22AM +0100, Toni Mueller wrote:
> 
> On Sun, 21.03.2010 at 20:28:32 +0100, Michael Tautschnig <[email protected]> 
> wrote:
> > On a sidenote, you should rather use ip addr show instead of ifconfig.
> 
> Why, please?
> 
> I gather that "ip addr show" has much richer output and is easier to
> parse, but will this be available on non-Linux platforms, eg.
> kfreebsd-amd64?
> 
> See eg.
> 
> > http://packages.debian.org/search?searchon=contents&keywords=ip&mode=exactfilename&suite=unstable&arch=any

Well, it actually depends on what your packages does.  If its goal
involves examining the IP addresses active on the system's interfaces,
then you should bear in mind that addresses added by "ip addr add"
will not be shown in ifconfig's output.

[r...@debian ~]$ sudo ip addr add 127.10.0.5/16 dev lo
[r...@debian ~]$ sudo ip addr list | fgrep inet
    inet 127.0.0.1/8 scope host lo
    inet 127.10.0.5/16 scope host lo
    inet6 ::1/128 scope host
    inet 10.100.0.85/24 brd 10.100.0.255 scope global eth0
    inet6 fe80::21a:4bff:feb1:824c/64 scope link
[r...@debian ~]$ sudo ifconfig | fgrep inet
          inet addr:10.100.0.85  Bcast:10.100.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21a:4bff:feb1:824c/64 Scope:Link
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
[r...@debian ~]$

Just something to bear in mind - whether it actually affects your
package depends on exactly what your package does with ifconfig :)

G'luck,
Peter

-- 
Peter Pentchev  [email protected]    [email protected]    [email protected]
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
If there were no counterfactuals, this sentence would not have been paradoxical.

Attachment: pgpVkfH9OLBgn.pgp
Description: PGP signature

Reply via email to