92 |
lmac = xmalloc(ETH_ALEN); |
lmac = xmalloc(ETH_ALEN); |
93 |
ch->mac = ether_aton_r(selector + (strncmp(selector, "mac=", 4) ? 0 : 4), lmac); |
ch->mac = ether_aton_r(selector + (strncmp(selector, "mac=", 4) ? 0 : 4), lmac); |
94 |
if (ch->mac == NULL) |
if (ch->mac == NULL) |
95 |
bb_error_msg_and_die("cannot parse %s", selector); |
bb_error_msg_and_die("can't parse %s", selector); |
96 |
#if ENABLE_FEATURE_NAMEIF_EXTENDED |
#if ENABLE_FEATURE_NAMEIF_EXTENDED |
97 |
found_selector++; |
found_selector++; |
98 |
}; |
}; |
144 |
|
|
145 |
if (1 & getopt32(argv, "sc:", &fname)) { |
if (1 & getopt32(argv, "sc:", &fname)) { |
146 |
openlog(applet_name, 0, LOG_LOCAL0); |
openlog(applet_name, 0, LOG_LOCAL0); |
147 |
logmode = LOGMODE_SYSLOG; |
/* Why not just "="? I assume logging to stderr |
148 |
|
* can't hurt. 2>/dev/null if you don't like it: */ |
149 |
|
logmode |= LOGMODE_SYSLOG; |
150 |
} |
} |
151 |
argc -= optind; |
argc -= optind; |
152 |
argv += optind; |
argv += optind; |
179 |
|
|
180 |
/* Find the current interface name and copy it to ifr.ifr_name */ |
/* Find the current interface name and copy it to ifr.ifr_name */ |
181 |
memset(&ifr, 0, sizeof(struct ifreq)); |
memset(&ifr, 0, sizeof(struct ifreq)); |
182 |
strncpy(ifr.ifr_name, token[0], sizeof(ifr.ifr_name)); |
strncpy_IFNAMSIZ(ifr.ifr_name, token[0]); |
183 |
|
|
184 |
#if ENABLE_FEATURE_NAMEIF_EXTENDED |
#if ENABLE_FEATURE_NAMEIF_EXTENDED |
185 |
/* Check for driver etc. */ |
/* Check for driver etc. */ |
211 |
if (strcmp(ifr.ifr_name, ch->ifname) != 0) { |
if (strcmp(ifr.ifr_name, ch->ifname) != 0) { |
212 |
strcpy(ifr.ifr_newname, ch->ifname); |
strcpy(ifr.ifr_newname, ch->ifname); |
213 |
ioctl_or_perror_and_die(ctl_sk, SIOCSIFNAME, &ifr, |
ioctl_or_perror_and_die(ctl_sk, SIOCSIFNAME, &ifr, |
214 |
"cannot change ifname %s to %s", |
"can't change ifname %s to %s", |
215 |
ifr.ifr_name, ch->ifname); |
ifr.ifr_name, ch->ifname); |
216 |
} |
} |
217 |
/* Remove list entry of renamed interface */ |
/* Remove list entry of renamed interface */ |