diff mbox

feedback as solicited by Guix manual (Section 7.1.5)

Message ID 87inxq4rp9.fsf@gnu.org
State New
Headers show

Commit Message

Ludovic Courtès June 3, 2016, 8:11 a.m. UTC
Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2016-06-02 11:07 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> skribis:
>>
>>> Tomáš Čech (2016-06-01 07:53 +0300) wrote:
>>>
>>>> On Tue, May 31, 2016 at 11:10:21PM +0200, Ludovic Courtès wrote:
>>>>>Matthew Jordan <matthewjordandevops@yandex.com> skribis:
>>>>>
>>>>>> mentions using ifconfig, correct me if I"m wrong but isn't ifconfig
>>>>>> considered deprecated?
>>>>>
>>>>>This ifconfig (part of GNU Inetutils) is maintained, so I think it’s
>>>>>fine.  :-)
>>>>
>>>> Yes, ifconfig is considered deprecated for more than decade. I'm not
>>>> networking guy but colleague of mine who is told me that ifconfig is
>>>> just ugly wrapper not reflecting how the kernel is handling it.
>>>> http://serverfault.com/questions/633087/where-is-the-statement-of-deprecation-of-ifconfig-on-linux
>>>>
>>>> iproute2 is way to go.
>>>
>>> I would also prefer to see "ip" command instead of "ifconfig" in the
>>> manual.  Alternatively both can be mentioned..
>>
>> I have a hard time leaving ifconfig/iwconfig. ;-)
>>
>> I was about to change the manual’s examples to ‘ip’, but then realized
>> that this is Linux-specific and doesn’t buy us much for these simple
>> cases.  So, what about this:
>
> 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):

--8<---------------cut here---------------start------------->8---
~$ 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 +++
ludo@pluto ~$ 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

[...]

--8<---------------cut here---------------end--------------->8---

> 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:
OK with this?

Thanks,
Ludo’.

Comments

Alex Kost June 4, 2016, 12:52 p.m. UTC | #1
Ludovic Courtès (2016-06-03 11:11 +0300) wrote:

> Alex Kost <alezost@gmail.com> 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 +++
> ludo@pluto ~$ 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
>  
> +@noindent
> +@dots{} or, using the GNU/Linux-specific @command{ip} command:
> +
> +@example
> +ip a
> +@end 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.
diff mbox

Patch

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
 
+@noindent
+@dots{} or, using the GNU/Linux-specific @command{ip} command:
+
+@example
+ip a
+@end 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