From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: feedback as solicited by Guix manual (Section 7.1.5) Date: Fri, 03 Jun 2016 10:11:46 +0200 Message-ID: <87inxq4rp9.fsf@gnu.org> References: <574B8D1E.6080000@ethan-stefan.net> <20160531155854.GA27525@jasmine> <87oa7mxk8b.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> <20160531175659.GA17589@jasmine> <87mvn6xehy.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> <8760tundc2.fsf@gnu.org> <20160601045313.hzbhirssd52sd2pn@venom> <87r3cgofqa.fsf@gmail.com> <87shww9fon.fsf@gnu.org> <8737ownfz0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8kCx-0006ri-Sv for guix-devel@gnu.org; Fri, 03 Jun 2016 04:12:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8kCt-0000YR-Bf for guix-devel@gnu.org; Fri, 03 Jun 2016 04:11:55 -0400 In-Reply-To: <8737ownfz0.fsf@gmail.com> (Alex Kost's message of "Thu, 02 Jun 2016 11:37:55 +0300") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Kost Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alex Kost skribis: > Ludovic Court=C3=A8s (2016-06-02 11:07 +0300) wrote: > >> Alex Kost skribis: >> >>> Tom=C3=A1=C5=A1 =C4=8Cech (2016-06-01 07:53 +0300) wrote: >>> >>>> On Tue, May 31, 2016 at 11:10:21PM +0200, Ludovic Court=C3=A8s wrote: >>>>>Matthew Jordan 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=E2= =80=99s >>>>>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-depr= ecation-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=E2=80=99s examples to =E2=80=98ip=E2=80= =99, but then realized >> that this is Linux-specific and doesn=E2=80=99t buy us much for these si= mple >> cases. So, what about this: > > Wow, do you mean that ifconfig is not only for Linux kernel? Exactly. Under the hood, =E2=80=98ip=E2=80=99 uses Linux-specific netlink socket int= erfaces, whereas GNU ifconfig uses the good ol=E2=80=99 ioctls that most Unices supp= ort (including GNU/Hurd): --8<---------------cut here---------------start------------->8--- ~$ sudo strace -e socket ip a socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, 0) =3D 3 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group d= efault 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=20 valid_lft forever preferred_lft forever 2: eno1: 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=20 valid_lft forever preferred_lft forever 3: wlp0s29u1u2: 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=3D"wlp0s29u1u2", ifr_index=3D3}) =3D 0 ioctl(3, SIOCGIFINDEX, {ifr_name=3D"lo", ifr_index=3D1}) =3D 0 ioctl(3, SIOCGIFINDEX, {ifr_name=3D"eno1", ifr_index=3D2}) =3D 0 ioctl(5, SIOCGIFINDEX, {ifr_name=3D"eno1", ifr_index=3D2}) =3D 0 ioctl(4, SIOCGIFHWADDR, {ifr_name=3D"eno1", ifr_hwaddr=3D5c:26:0a:64:07:23}= ) =3D 0 ioctl(4, SIOCGIFHWADDR, {ifr_name=3D"eno1", ifr_hwaddr=3D5c:26:0a:64:07:23}= ) =3D 0 ioctl(4, SIOCGIFHWADDR, {ifr_name=3D"eno1", ifr_hwaddr=3D5c:26:0a:64:07:23}= ) =3D 0 ioctl(4, SIOCGIFHWADDR, {ifr_name=3D"eno1", ifr_hwaddr=3D5c:26:0a:64:07:23}= ) =3D 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable OK with this? Thanks, Ludo=E2=80=99. --=-=-=--