Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/networking/vconfig.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/networking/vconfig.c
r1765 r2725 5 5 * Copyright (C) 2001 Manuel Novoa III <mjn3@codepoet.org> 6 6 * 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 8 */ 9 9 … … 48 48 }; 49 49 50 #define VLAN_GROUP_ARRAY_LEN 409651 #define SIOCSIFVLAN 0x8983/* Set 802.1Q VLAN options */50 #define VLAN_GROUP_ARRAY_LEN 4096 51 #define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ 52 52 53 /* On entry, table points to the length of the current string plus54 * nul terminator plus data length for the subsequent entry. The55 * return value is the last data entry for the matching string. */53 /* On entry, table points to the length of the current string 54 * plus NUL terminator plus data length for the subsequent entry. 55 * The return value is the last data entry for the matching string. */ 56 56 static const char *xfind_str(const char *table, const char *str) 57 57 { 58 58 while (strcasecmp(str, table+1) != 0) { 59 if (!*(table += table[0])) { 59 table += table[0]; 60 if (!*table) { 60 61 bb_show_usage(); 61 62 } … … 107 108 static const char conf_file_name[] ALIGN1 = "/proc/net/vlan/config"; 108 109 109 int vconfig_main(int argc, char **argv) ;110 int vconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 110 111 int vconfig_main(int argc, char **argv) 111 112 { … … 122 123 xopen(conf_file_name, O_RDONLY); 123 124 124 memset(&ifr, 0, sizeof( struct vlan_ioctl_args));125 memset(&ifr, 0, sizeof(ifr)); 125 126 126 127 ++argv; … … 134 135 ifr.u.name_type = *xfind_str(name_types+1, argv[1]); 135 136 } else { 136 if (strlen(argv[1]) >= IF_NAMESIZE) { 137 bb_error_msg_and_die("if_name >= %d chars", IF_NAMESIZE); 138 } 139 strcpy(ifr.device1, argv[1]); 137 strncpy_IFNAMSIZ(ifr.device1, argv[1]); 140 138 p = argv[2]; 141 139
Note:
See TracChangeset
for help on using the changeset viewer.