aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-01-19 13:34:21 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-01-19 13:34:21 +0000
commit9118853b4131ca4be1bf5bdc229047f704ccafd9 (patch)
treed9482d2ce435da124d28fb14cd1277a4c87e6efe /networking
parent4d9ee560876c32f0a68da467c0eacffa0f99ed37 (diff)
downloadbusybox-w32-9118853b4131ca4be1bf5bdc229047f704ccafd9.tar.gz
busybox-w32-9118853b4131ca4be1bf5bdc229047f704ccafd9.tar.bz2
busybox-w32-9118853b4131ca4be1bf5bdc229047f704ccafd9.zip
Dont use getopt_long, minor usage changes, patch by Nick Fedchik
git-svn-id: svn://busybox.net/trunk/busybox@6385 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-rw-r--r--networking/nameif.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/networking/nameif.c b/networking/nameif.c
index cd18b4c18..f3b927158 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -36,7 +36,7 @@
36#include "busybox.h" 36#include "busybox.h"
37 37
38/* take from linux/sockios.h */ 38/* take from linux/sockios.h */
39#define SIOCSIFNAME 0x8923 /* set interface name */ 39#define SIOCSIFNAME 0x8923 /* set interface name */
40 40
41/* Octets in one ethernet addr, from <linux/if_ether.h> */ 41/* Octets in one ethernet addr, from <linux/if_ether.h> */
42#define ETH_ALEN 6 42#define ETH_ALEN 6
@@ -101,13 +101,8 @@ int nameif_main(int argc, char **argv)
101 int if_index = 1; 101 int if_index = 1;
102 mactable_t *ch; 102 mactable_t *ch;
103 103
104 static struct option opts[] = {
105 {"syslog", 0, NULL, 's'},
106 {"configfile", 1, NULL, 'c'},
107 {NULL},
108 };
109 104
110 while ((opt = getopt_long(argc, argv, "c:s", opts, NULL)) != -1) { 105 while ((opt = getopt(argc, argv, "c:s")) != -1) {
111 switch (opt) { 106 switch (opt) {
112 case 'c': 107 case 'c':
113 fname = optarg; 108 fname = optarg;
@@ -152,8 +147,7 @@ int nameif_main(int argc, char **argv)
152 ch = xcalloc(1, sizeof(mactable_t)); 147 ch = xcalloc(1, sizeof(mactable_t));
153 ch->ifname = xstrndup(line_ptr, name_length); 148 ch->ifname = xstrndup(line_ptr, name_length);
154 if (name_length > IF_NAMESIZE) 149 if (name_length > IF_NAMESIZE)
155 serror("interface name `%s' too long", 150 serror("interface name `%s' too long", ch->ifname);
156 ch->ifname);
157 line_ptr += name_length; 151 line_ptr += name_length;
158 line_ptr += strspn(line_ptr, " \t"); 152 line_ptr += strspn(line_ptr, " \t");
159 name_length = strspn(line_ptr, "0123456789ABCDEFabcdef:"); 153 name_length = strspn(line_ptr, "0123456789ABCDEFabcdef:");