Bug 9215
| Summary: | can't set MTU with ifconfig | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] Red Hat Raw Hide | Reporter: | Jonathan Kamens <h1k6zn2m> | ||||
| Component: | net-tools | Assignee: | Crutcher Dunnavant <crutcher> | ||||
| Status: | CLOSED RAWHIDE | QA Contact: | |||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 1.0 | CC: | ecki | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2000-10-07 15:11:18 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 8920 | ||||||
| Attachments: |
|
||||||
|
Description
Jonathan Kamens
2000-02-08 12:44:50 UTC
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")) {
|