This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 9215 - can't set MTU with ifconfig
can't set MTU with ifconfig
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: net-tools (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Crutcher Dunnavant
:
: 8920 (view as bug list)
Depends On:
Blocks: 8920
  Show dependency treegraph
 
Reported: 2000-02-08 07:44 EST by Jonathan Kamens
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-07 11:11:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
make "ifconfig sl0 mtu 1400" work properly (612 bytes, patch)
2000-02-08 07:45 EST, Jonathan Kamens
no flags Details | Diff

  None (edit)
Description Jonathan Kamens 2000-02-08 07:44:50 EST
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.
Comment 1 Jonathan Kamens 2000-02-08 07:45:59 EST
Created attachment 100 [details]
make "ifconfig sl0 mtu 1400" work properly
Comment 2 Jeff Johnson 2000-10-07 11:11:12 EDT
*** Bug 8920 has been marked as a duplicate of this bug. ***
Comment 3 Jeff Johnson 2000-10-07 12:18:02 EDT
Fixed (patch added) in net-tools-1.57-1. Thanks for the patch.
Comment 4 Bernd Eckenfels 2000-10-07 20:28:20 EDT
i put the atached fix into net-tools upstream CVS.

Comment 5 Bernd Eckenfels 2000-10-07 20:31:40 EDT
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@conectiva.com.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")) {

Note You need to log in before you can comment on or make changes to this bug.