lmac = xmalloc(ETH_ALEN);
ch->mac = ether_aton_r(selector + (strncmp(selector, "mac=", 4) ? 0 : 4), lmac);
if (ch->mac == NULL)
- bb_error_msg_and_die("cannot parse %s", selector);
+ bb_error_msg_and_die("can't parse %s", selector);
#if ENABLE_FEATURE_NAMEIF_EXTENDED
found_selector++;
};
if (1 & getopt32(argv, "sc:", &fname)) {
openlog(applet_name, 0, LOG_LOCAL0);
- logmode = LOGMODE_SYSLOG;
+ /* Why not just "="? I assume logging to stderr
+ * can't hurt. 2>/dev/null if you don't like it: */
+ logmode |= LOGMODE_SYSLOG;
}
argc -= optind;
argv += optind;
/* Find the current interface name and copy it to ifr.ifr_name */
memset(&ifr, 0, sizeof(struct ifreq));
- strncpy(ifr.ifr_name, token[0], sizeof(ifr.ifr_name));
+ strncpy_IFNAMSIZ(ifr.ifr_name, token[0]);
#if ENABLE_FEATURE_NAMEIF_EXTENDED
/* Check for driver etc. */
if (strcmp(ifr.ifr_name, ch->ifname) != 0) {
strcpy(ifr.ifr_newname, ch->ifname);
ioctl_or_perror_and_die(ctl_sk, SIOCSIFNAME, &ifr,
- "cannot change ifname %s to %s",
+ "can't change ifname %s to %s",
ifr.ifr_name, ch->ifname);
}
/* Remove list entry of renamed interface */