[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feedback as solicited by Guix manual (Section 7.1.5)
From: |
Alex Kost |
Subject: |
Re: feedback as solicited by Guix manual (Section 7.1.5) |
Date: |
Sat, 04 Jun 2016 15:52:57 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Ludovic Courtès (2016-06-03 11:11 +0300) wrote:
> Alex Kost <address@hidden> skribis:
[...]
>> Wow, do you mean that ifconfig is not only for Linux kernel?
>
> Exactly.
>
> Under the hood, ‘ip’ uses Linux-specific netlink socket interfaces,
> whereas GNU ifconfig uses the good ol’ ioctls that most Unices support
> (including GNU/Hurd):
>
>
> ~$ sudo strace -e socket ip a
> socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, 0) = 3
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
> default qlen 1
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> inet 127.0.0.1/8 scope host lo
> valid_lft forever preferred_lft forever
> inet6 ::1/128 scope host
> valid_lft forever preferred_lft forever
> 2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
> group default qlen 1000
> link/ether 5c:26:0a:64:07:23 brd ff:ff:ff:ff:ff:ff
> inet 193.50.110.57/24 brd 193.50.110.255 scope global eno1
> valid_lft forever preferred_lft forever
> inet6 fe80::5e26:aff:fe64:723/64 scope link
> valid_lft forever preferred_lft forever
> 3: wlp0s29u1u2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state
> DOWN group default qlen 1000
> link/ether 60:02:b4:99:9b:31 brd ff:ff:ff:ff:ff:ff
> +++ exited with 0 +++
> address@hidden ~$ sudo strace -e ioctl ifconfig -a
> ioctl(3, SIOCGIFINDEX, {ifr_name="wlp0s29u1u2", ifr_index=3}) = 0
> ioctl(3, SIOCGIFINDEX, {ifr_name="lo", ifr_index=1}) = 0
> ioctl(3, SIOCGIFINDEX, {ifr_name="eno1", ifr_index=2}) = 0
> ioctl(5, SIOCGIFINDEX, {ifr_name="eno1", ifr_index=2}) = 0
> ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0
> ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0
> ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0
> ioctl(4, SIOCGIFHWADDR, {ifr_name="eno1", ifr_hwaddr=5c:26:0a:64:07:23}) = 0
> eno1 Link encap:Ethernet HWaddr 5C:26:0A:64:07:23
>
> [...]
>
>
>> If ifconfig is a general thing (suitable for Hurd) then I agree; we
>> should probably leave it as it is now. Otherwise I would also add a
>> mention how to do it with "ip", like this:
>
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index c8c7555..12dd354 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -6010,6 +6010,13 @@ Run the following command see what your network
> interfaces are called:
> ifconfig -a
> @end example
>
> address@hidden
> address@hidden or, using the GNU/Linux-specific @command{ip} command:
> +
> address@hidden
> +ip a
> address@hidden example
> +
> @c
> http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c#n20
> Wired interfaces have a name starting with @samp{e}; for example, the
> interface corresponding to the first on-board Ethernet controller is
>
> OK with this?
As for me, I'm absolutely OK with this. And thanks for the explanation
that ifconfig is a more general tool.
--
Alex