Bug number 8920 is correct -- there is a problem setting the MTU (and various other settings) with ifconfig in net-tools-1.54-3. First of all, ifconfig does not correctly use the "inet" address family by default, even though the documentation says that it should. Second, it does not use the correct socket when setting the MTU on an inet device. The attached patch fixes both of these problems.
Created attachment 100 [details] make "ifconfig sl0 mtu 1400" work properly
*** Bug 8920 has been marked as a duplicate of this bug. ***
Fixed (patch added) in net-tools-1.57-1. Thanks for the patch.
i put the atached fix into net-tools upstream CVS.
actually i tried to attach one, was not possible, so here it iis, and you can find it on vger and in the next upstream release. diff -u -r1.41 ifconfig.c --- ifconfig.c 2000/08/14 07:57:19 1.41 +++ ifconfig.c 2000/10/08 00:43:55 @@ -20,6 +20,8 @@ * {1.34} - 19980630 - Arnaldo Carvalho de Melo <acme.br> * - gettext instead of catgets for i18n * 10/1998 - Andi Kleen. Use interface list primitives. + * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu + * (default AF was wrong) */ #define DFLT_AF "inet" @@ -252,11 +254,6 @@ textdomain("net-tools"); #endif - /* Create a channel to the NET kernel. */ - if ((skfd = sockets_open(0)) < 0) { - perror("socket"); - exit(1); - } /* Find any options. */ argc--; @@ -289,6 +286,12 @@ argc--; } + /* Create a channel to the NET kernel. */ + if ((skfd = sockets_open(0)) < 0) { + perror("socket"); + exit(1); + } + /* Do we have to show the current setup? */ if (argc == 0) { int err = if_print((char *) NULL); @@ -304,19 +307,22 @@ exit(err < 0); } /* The next argument is either an address family name, or an option. */ - if ((ap = get_aftype(*spp)) == NULL) + if ((ap = get_aftype(*spp)) != NULL) + spp++; /* it was a AF name */ + else ap = get_aftype(DFLT_AF); - else { - /* XXX: should print the current setup if no args left, but only - for this family */ - spp++; + + if(ap) { addr_family = ap->af; + if ((fd=sockets_open(addr_family)) < 0) { + perror("family socket"); + exit(1); + } else { + if (skfd) close(skfd); + skfd = fd; + } } - if (sockets_open(addr_family) < 0) { - perror("family socket"); - exit(1); - } /* Process the remaining arguments. */ while (*spp != (char *) NULL) { if (!strcmp(*spp, "arp")) {