guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feedback as solicited by Guix manual (Section 7.1.5)


From: Ludovic Courtès
Subject: Re: feedback as solicited by Guix manual (Section 7.1.5)
Date: Fri, 03 Jun 2016 10:11:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Alex Kost <address@hidden> skribis:

> Ludovic Courtès (2016-06-02 11:07 +0300) wrote:
>
>> Alex Kost <address@hidden> 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 <address@hidden> 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 +++
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

[...]

--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:

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?

Thanks,
Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]