-/* $OpenBSD: ifconfig.c,v 1.462 2023/03/08 04:43:06 guenther Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.463 2023/05/12 18:24:13 jan Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
errno == ENOENT)
return (-1);
else
- err(1, "SIOCGIFGMEMB");
+ err(1, "%s: SIOCGIFGMEMB", ifgr.ifgr_name);
}
len = ifgr.ifgr_len;
if ((ifgr.ifgr_groups = calloc(1, len)) == NULL)
err(1, "printgroup");
if (ioctl(sock, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1)
- err(1, "SIOCGIFGMEMB");
+ err(1, "%s: SIOCGIFGMEMB", ifgr.ifgr_name);
for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(struct ifg_req);
ifg++) {
bzero(&ifgr, sizeof(ifgr));
strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name));
if (ioctl(sock, SIOCGIFGATTR, (caddr_t)&ifgr) == -1)
- err(1, "SIOCGIFGATTR");
+ err(1, "%s: SIOCGIFGATTR", ifgr.ifgr_name);
printf("%s:", groupname);
printf(" carp demote count %d", ifgr.ifgr_attrib.ifg_carp_demoted);
if (argc > 1) {
neg = strtonum(argv[1], 0, 128, &errstr);
if (errstr)
- errx(1, "invalid carp demotion: %s", errstr);
+ errx(1, "%s: invalid carp demotion: %s", ifgr.ifgr_name,
+ errstr);
}
if (p[0] == '-') {
usage();
if (ioctl(sock, SIOCSIFGATTR, (caddr_t)&ifgr) == -1)
- err(1, "SIOCSIFGATTR");
+ err(1, "%s: SIOCSIFGATTR", ifgr.ifgr_name);
}
void
(void) strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(sock, SIOCIFCREATE, &ifr) == -1)
- err(1, "SIOCIFCREATE");
+ err(1, "%s: SIOCIFCREATE", ifr.ifr_name);
}
void
(void) strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(sock, SIOCIFDESTROY, &ifr) == -1)
- err(1, "SIOCIFDESTROY");
+ err(1, "%s: SIOCIFDESTROY", ifr.ifr_name);
}
struct if_clonereq *
bcopy((char *)&ifr, (char *)&my_ifr, sizeof(struct ifreq));
if (ioctl(sock, SIOCGIFFLAGS, (caddr_t)&my_ifr) == -1)
- err(1, "SIOCGIFFLAGS");
+ err(1, "%s: SIOCGIFFLAGS", my_ifr.ifr_name);
(void) strlcpy(my_ifr.ifr_name, ifname, sizeof(my_ifr.ifr_name));
flags = my_ifr.ifr_flags;
flags |= value;
my_ifr.ifr_flags = flags;
if (ioctl(sock, SIOCSIFFLAGS, (caddr_t)&my_ifr) == -1)
- err(1, "SIOCSIFFLAGS");
+ err(1, "%s: SIOCSIFFLAGS", my_ifr.ifr_name);
}
void
bcopy((char *)&ifr, (char *)&my_ifr, sizeof(struct ifreq));
if (ioctl(sock, SIOCGIFXFLAGS, (caddr_t)&my_ifr) == -1)
- warn("SIOCGIFXFLAGS");
+ warn("%s: SIOCGIFXFLAGS", my_ifr.ifr_name);
(void) strlcpy(my_ifr.ifr_name, ifname, sizeof(my_ifr.ifr_name));
xflags = my_ifr.ifr_flags;
xflags |= value;
my_ifr.ifr_flags = xflags;
if (ioctl(sock, SIOCSIFXFLAGS, (caddr_t)&my_ifr) == -1)
- warn("SIOCSIFXFLAGS");
+ warn("%s: SIOCSIFXFLAGS", my_ifr.ifr_name);
}
void
strlcpy(ifar.ifar_name, ifname, sizeof(ifar.ifar_name));
ifar.ifar_af = value;
if (ioctl(sock, SIOCIFAFATTACH, (caddr_t)&ifar) == -1)
- warn("SIOCIFAFATTACH");
+ warn("%s: SIOCIFAFATTACH", ifar.ifar_name);
}
void
strlcpy(ifar.ifar_name, ifname, sizeof(ifar.ifar_name));
ifar.ifar_af = value;
if (ioctl(sock, SIOCIFAFDETACH, (caddr_t)&ifar) == -1)
- warn("SIOCIFAFDETACH");
+ warn("%s: SIOCIFAFDETACH", ifar.ifar_name);
}
void
strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ);
if (ioctl(sock, SIOCAIFGROUP, (caddr_t)&ifgr) == -1) {
if (errno != EEXIST)
- err(1," SIOCAIFGROUP");
+ err(1,"%s: SIOCAIFGROUP", group_name);
}
}
if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ)
errx(1, "unsetifgroup: group name too long");
if (ioctl(sock, SIOCDIFGROUP, (caddr_t)&ifgr) == -1)
- err(1, "SIOCDIFGROUP");
+ err(1, "%s: SIOCDIFGROUP", group_name);
}
const char *
ifr.ifr_data = (caddr_t)&join;
if (ioctl(sock, SIOCS80211JOIN, (caddr_t)&ifr) == -1)
- err(1, "SIOCS80211JOIN");
+ err(1, "%s: SIOCS80211JOIN", ifr.ifr_name);
}
void
if (d == -1) {
ifr.ifr_data = (caddr_t)&join;
if (ioctl(sock, SIOCS80211JOIN, (caddr_t)&ifr) == -1)
- err(1, "SIOCS80211JOIN");
+ err(1, "%s: SIOCS80211JOIN", ifr.ifr_name);
}
len = sizeof(join.i_nwid);
(void)strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
ifr.ifr_data = (caddr_t)&join;
if (ioctl(sock, SIOCS80211JOIN, (caddr_t)&ifr) == -1)
- err(1, "SIOCS80211JOIN");
+ err(1, "%s: SIOCS80211JOIN", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&join;
if (ioctl(sock, SIOCS80211JOIN, (caddr_t)&ifr) == -1)
- err(1, "SIOCS80211JOIN");
+ err(1, "%s: SIOCS80211JOIN", ifr.ifr_name);
}
void
}
strlcpy(bssid.i_name, ifname, sizeof(bssid.i_name));
if (ioctl(sock, SIOCS80211BSSID, &bssid) == -1)
- warn("SIOCS80211BSSID");
+ warn("%s: SIOCS80211BSSID", bssid.i_name);
}
void
}
if (ioctl(sock, SIOCS80211NWKEY, (caddr_t)&nwkey) == -1)
- err(1, "SIOCS80211NWKEY");
+ err(1, "%s: SIOCS80211NWKEY", nwkey.i_name);
}
void
}
if (ioctl(sock, SIOCS80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCS80211WPAPARMS");
+ err(1, "%s: SIOCS80211WPAPARMS", wpa.i_name);
}
void
memset(&wpa, 0, sizeof(wpa));
(void)strlcpy(wpa.i_name, ifname, sizeof(wpa.i_name));
if (ioctl(sock, SIOCG80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCG80211WPAPARMS");
+ err(1, "%s: SIOCG80211WPAPARMS", wpa.i_name);
wpa.i_protos = rval;
/* Let the kernel set up the appropriate default ciphers. */
wpa.i_ciphers = 0;
wpa.i_groupcipher = 0;
if (ioctl(sock, SIOCS80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCS80211WPAPARMS");
+ err(1, "%s: SIOCS80211WPAPARMS", wpa.i_name);
}
void
memset(&wpa, 0, sizeof(wpa));
(void)strlcpy(wpa.i_name, ifname, sizeof(wpa.i_name));
if (ioctl(sock, SIOCG80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCG80211WPAPARMS");
+ err(1, "%s: SIOCG80211WPAPARMS", wpa.i_name);
wpa.i_akms = rval;
/* Enable WPA for 802.1x here. PSK case is handled in setifwpakey(). */
wpa.i_enabled = ((rval & IEEE80211_WPA_AKM_8021X) != 0);
if (ioctl(sock, SIOCS80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCS80211WPAPARMS");
+ err(1, "%s: SIOCS80211WPAPARMS", wpa.i_name);
}
static const struct {
memset(&wpa, 0, sizeof(wpa));
(void)strlcpy(wpa.i_name, ifname, sizeof(wpa.i_name));
if (ioctl(sock, SIOCG80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCG80211WPAPARMS");
+ err(1, "%s: SIOCG80211WPAPARMS", wpa.i_name);
wpa.i_ciphers = rval;
if (ioctl(sock, SIOCS80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCS80211WPAPARMS");
+ err(1, "%s: SIOCS80211WPAPARMS", wpa.i_name);
}
void
memset(&wpa, 0, sizeof(wpa));
(void)strlcpy(wpa.i_name, ifname, sizeof(wpa.i_name));
if (ioctl(sock, SIOCG80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCG80211WPAPARMS");
+ err(1, "%s: SIOCG80211WPAPARMS", wpa.i_name);
wpa.i_groupcipher = cipher;
if (actions & A_JOIN) {
}
if (ioctl(sock, SIOCS80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCS80211WPAPARMS");
+ err(1, "%s: SIOCS80211WPAPARMS", wpa.i_name);
}
void
warnx("no nwid or join command, guessing nwid to use");
if (ioctl(sock, SIOCG80211NWID, (caddr_t)&ifr) == -1)
- err(1, "SIOCG80211NWID");
+ err(1, "%s: SIOCG80211NWID", ifr.ifr_name);
}
passlen = strlen(val);
}
if (ioctl(sock, SIOCS80211WPAPSK, (caddr_t)&psk) == -1)
- err(1, "SIOCS80211WPAPSK");
+ err(1, "%s: SIOCS80211WPAPSK", psk.i_name);
/* And ... automatically enable or disable WPA */
memset(&wpa, 0, sizeof(wpa));
(void)strlcpy(wpa.i_name, ifname, sizeof(wpa.i_name));
if (ioctl(sock, SIOCG80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCG80211WPAPARMS");
+ err(1, "%s: SIOCG80211WPAPARMS", psk.i_name);
wpa.i_enabled = psk.i_enabled;
if (ioctl(sock, SIOCS80211WPAPARMS, (caddr_t)&wpa) == -1)
- err(1, "SIOCS80211WPAPARMS");
+ err(1, "%s: SIOCS80211WPAPARMS", psk.i_name);
}
void
strlcpy(channel.i_name, ifname, sizeof(channel.i_name));
channel.i_channel = (u_int16_t)chan;
if (ioctl(sock, SIOCS80211CHANNEL, (caddr_t)&channel) == -1)
- warn("SIOCS80211CHANNEL");
+ warn("%s: SIOCS80211CHANNEL", channel.i_name);
}
void
errx(1, "Invalid nwflag: %s", val);
if (ioctl(sock, SIOCG80211FLAGS, (caddr_t)&ifr) != 0)
- err(1, "SIOCG80211FLAGS");
+ err(1, "%s: SIOCG80211FLAGS", ifr.ifr_name);
if (d)
ifr.ifr_flags &= ~flag;
ifr.ifr_flags |= flag;
if (ioctl(sock, SIOCS80211FLAGS, (caddr_t)&ifr) != 0)
- err(1, "SIOCS80211FLAGS");
+ err(1, "%s: SIOCS80211FLAGS", ifr.ifr_name);
}
void
(void)strlcpy(power.i_name, ifname, sizeof(power.i_name));
if (ioctl(sock, SIOCG80211POWER, (caddr_t)&power) == -1) {
- warn("SIOCG80211POWER");
+ warn("%s: SIOCG80211POWER", power.i_name);
return;
}
power.i_enabled = d == -1 ? 0 : 1;
if (ioctl(sock, SIOCS80211POWER, (caddr_t)&power) == -1)
- warn("SIOCS80211POWER");
+ warn("%s: SIOCS80211POWER", power.i_name);
}
#endif
ojsz = jsz;
continue;
} else if (errno != ENOENT)
- warn("SIOCG80211JOINALL");
+ warn("%s: SIOCG80211JOINALL", ja.ja_ifname);
return;
}
break;
strlcpy(ca.i_name, ifname, sizeof(ca.i_name));
if (ioctl(sock, SIOCG80211ALLCHANS, &ca) != 0) {
- warn("SIOCG80211ALLCHANS");
+ warn("%s: SIOCG80211ALLCHANS", ca.i_name);
return;
}
printf("\t\t%4s %-8s %s\n", "chan", "freq", "properties");
strlcpy(na.na_ifname, ifname, sizeof(na.na_ifname));
if (ioctl(sock, SIOCG80211ALLNODES, &na) != 0) {
- warn("SIOCG80211ALLNODES");
+ warn("%s: SIOCG80211ALLNODES", na.na_ifname);
return;
}
* that there are more, so we can ignore it.
*/
if (errno != E2BIG)
- err(1, "SIOCGIFMEDIA");
+ err(1, "%s: SIOCGIFMEDIA", ifmr.ifm_name);
}
media_current = ifmr.ifm_current;
ifr.ifr_media = media_current;
if (ioctl(sock, SIOCSIFMEDIA, (caddr_t)&ifr) == -1)
- err(1, "SIOCSIFMEDIA");
+ err(1, "%s: SIOCSIFMEDIA", ifr.ifr_name);
}
void
ifmr.ifm_ulist = media_list;
if (ioctl(sock, SIOCGIFMEDIA, (caddr_t)&ifmr) == -1)
- err(1, "SIOCGIFMEDIA");
+ err(1, "%s: SIOCGIFMEDIA", ifmr.ifm_name);
printf("\tmedia: ");
print_media_word(ifmr.ifm_current, 1, 0);
errx(1, "parent: parent too long");
if (ioctl(sock, SIOCSIFPARENT, (caddr_t)&ifp) == -1)
- warn("SIOCSIFPARENT");
+ warn("%s: %s: SIOCSIFPARENT", ifp.ifp_name, ifp.ifp_parent);
}
void
strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname));
if (ioctl(sock, SIOCSTRUNKPORT, &rp) == -1)
- err(1, "SIOCSTRUNKPORT");
+ err(1, "%s %s: SIOCSTRUNKPORT", rp.rp_ifname, rp.rp_portname);
}
void
strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname));
if (ioctl(sock, SIOCSTRUNKDELPORT, &rp) == -1)
- err(1, "SIOCSTRUNKDELPORT");
+ err(1, "%s: %s: SIOCSTRUNKDELPORT", rp.rp_ifname,
+ rp.rp_portname);
}
void
strlcpy(ra.ra_ifname, ifname, sizeof(ra.ra_ifname));
if (ioctl(sock, SIOCSTRUNK, &ra) != 0)
- err(1, "SIOCSTRUNK");
+ err(1, "%s: SIOCSTRUNK", ra.ra_ifname);
}
void
strlcpy(ra.ra_ifname, ifname, sizeof(ra.ra_ifname));
if (ioctl(sock, SIOCGTRUNK, &ra) != 0)
- err(1, "SIOCGTRUNK");
+ err(1, "%s: SIOCGTRUNK", ra.ra_ifname);
if (ra.ra_proto != TRUNK_PROTO_LACP)
errx(1, "Invalid option for trunk: %s", ifname);
tops.to_lacpopts.lacp_mode = 0;
if (ioctl(sock, SIOCSTRUNKOPTS, &tops) != 0)
- err(1, "SIOCSTRUNKOPTS");
+ err(1, "%s: SIOCSTRUNKOPTS", tops.to_ifname);
}
void
strlcpy(ra.ra_ifname, ifname, sizeof(ra.ra_ifname));
if (ioctl(sock, SIOCGTRUNK, &ra) != 0)
- err(1, "SIOCGTRUNK");
+ err(1, "%s SIOCGTRUNK", ra.ra_ifname);
if (ra.ra_proto != TRUNK_PROTO_LACP)
errx(1, "Invalid option for trunk: %s", ifname);
tops.to_lacpopts.lacp_timeout = 0;
if (ioctl(sock, SIOCSTRUNKOPTS, &tops) != 0)
- err(1, "SIOCSTRUNKOPTS");
+ err(1, "%s: SIOCSTRUNKOPTS", tops.to_ifname);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
bzero(carpr.carpr_key, CARP_KEY_LEN);
strlcpy((char *)carpr.carpr_key, val, CARP_KEY_LEN);
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
carpr.carpr_vhids[0] = vhid;
carpr.carpr_vhids[1] = 0;
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
carpr.carpr_advskews[0] = advskew;
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
carpr.carpr_advbase = advbase;
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
bzero(&hints, sizeof(hints));
hints.ai_family = AF_INET;
peerres->ai_addr)->sin_addr.s_addr;
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
freeaddrinfo(peerres);
}
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
bzero(&carpr.carpr_peer, sizeof(carpr.carpr_peer));
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
for (i = 0; i <= CARP_MAXSTATE; i++) {
if (!strcasecmp(val, carp_states[i])) {
}
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
strlcpy(carpr.carpr_carpdev, val, sizeof(carpr.carpr_carpdev));
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
bzero(carpr.carpr_vhids, sizeof(carpr.carpr_vhids));
bzero(carpr.carpr_advskews, sizeof(carpr.carpr_advskews));
free(optlist);
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&carpr;
if (ioctl(sock, SIOCGVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCGVH");
+ err(1, "%s: SIOCGVH", ifr.ifr_name);
for (i = 0; i <= CARP_BAL_MAXID; i++)
if (!strcasecmp(val, carp_bal_modes[i]))
carpr.carpr_balancing = i;
if (ioctl(sock, SIOCSVH, (caddr_t)&ifr) == -1)
- err(1, "SIOCSVH");
+ err(1, "%s: SIOCSVH", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCGETPFSYNC");
+ err(1, "%s: SIOCGETPFSYNC", ifr.ifr_name);
strlcpy(preq.pfsyncr_syncdev, val, sizeof(preq.pfsyncr_syncdev));
if (ioctl(sock, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFSYNC");
+ err(1, "%s: SIOCSETPFSYNC", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCGETPFSYNC");
+ err(1, "%s: SIOCGETPFSYNC", ifr.ifr_name);
bzero(&preq.pfsyncr_syncdev, sizeof(preq.pfsyncr_syncdev));
if (ioctl(sock, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFSYNC");
+ err(1, "%s: SIOCSETPFSYNC", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCGETPFSYNC");
+ err(1, "%s: SIOCGETPFSYNC", ifr.ifr_name);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET;
peerres->ai_addr)->sin_addr.s_addr;
if (ioctl(sock, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFSYNC");
+ err(1, "%s: SIOCSETPFSYNC", ifr.ifr_name);
freeaddrinfo(peerres);
}
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCGETPFSYNC");
+ err(1, "%s: SIOCGETPFSYNC", ifr.ifr_name);
preq.pfsyncr_syncpeer.s_addr = 0;
if (ioctl(sock, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFSYNC");
+ err(1, "%s: SIOCSETPFSYNC", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCGETPFSYNC");
+ err(1, "%s: SIOCGETPFSYNC", ifr.ifr_name);
preq.pfsyncr_maxupdates = maxupdates;
if (ioctl(sock, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFSYNC");
+ err(1, "%s: SIOCSETPFSYNC", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCGETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCGETPFSYNC");
+ err(1, "%s: SIOCGETPFSYNC", ifr.ifr_name);
preq.pfsyncr_defer = d;
if (ioctl(sock, SIOCSETPFSYNC, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFSYNC");
+ err(1, "%s: SIOCSETPFSYNC", ifr.ifr_name);
}
void
pflow_addr(val, &preq.flowsrc);
if (ioctl(sock, SIOCSETPFLOW, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFLOW");
+ err(1, "%s: SIOCSETPFLOW", ifr.ifr_name);
}
void
preq.addrmask |= PFLOW_MASK_SRCIP;
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCSETPFLOW, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFLOW");
+ err(1, "%s: SIOCSETPFLOW", ifr.ifr_name);
}
void
pflow_addr(val, &preq.flowdst);
if (ioctl(sock, SIOCSETPFLOW, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFLOW");
+ err(1, "%s: SIOCSETPFLOW", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)&preq;
preq.addrmask |= PFLOW_MASK_DSTIP;
if (ioctl(sock, SIOCSETPFLOW, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFLOW");
+ err(1, "%s: SIOCSETPFLOW", ifr.ifr_name);
}
/* PFLOWPROTO XXX */
ifr.ifr_data = (caddr_t)&preq;
if (ioctl(sock, SIOCSETPFLOW, (caddr_t)&ifr) == -1)
- err(1, "SIOCSETPFLOW");
+ err(1, "%s: SIOCSETPFLOW", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)spa;
spa->cmd = d == 0 ? SPPPIOGMAUTH : SPPPIOGHAUTH;
if (ioctl(sock, SIOCGSPPPPARAMS, &ifr) == -1)
- err(1, "SIOCGSPPPPARAMS(SPPPIOGXAUTH)");
+ err(1, "%s: SIOCGSPPPPARAMS(SPPPIOGXAUTH)", ifr.ifr_name);
}
void
ifr.ifr_data = (caddr_t)spd;
spd->cmd = SPPPIOGDNS;
if (ioctl(sock, SIOCGSPPPPARAMS, &ifr) == -1)
- err(1, "SIOCGSPPPPARAMS(SPPPIOGDNS)");
+ err(1, "%s: SIOCGSPPPPARAMS(SPPPIOGDNS)", ifr.ifr_name);
}
void
spa.cmd = d == 0 ? SPPPIOSMAUTH : SPPPIOSHAUTH;
if (ioctl(sock, SIOCSSPPPPARAMS, &ifr) == -1)
- err(1, "SIOCSSPPPPARAMS(SPPPIOSXAUTH)");
+ err(1, "%s: SIOCSSPPPPARAMS(SPPPIOSXAUTH)", ifr.ifr_name);
}
void
spa.cmd = d == 0 ? SPPPIOSMAUTH : SPPPIOSHAUTH;
if (ioctl(sock, SIOCSSPPPPARAMS, &ifr) == -1)
- err(1, "SIOCSSPPPPARAMS(SPPPIOSXAUTH)");
+ err(1, "%s: SIOCSSPPPPARAMS(SPPPIOSXAUTH)", ifr.ifr_name);
}
void
spa.cmd = d == 0 ? SPPPIOSMAUTH : SPPPIOSHAUTH;
if (ioctl(sock, SIOCSSPPPPARAMS, &ifr) == -1)
- err(1, "SIOCSSPPPPARAMS(SPPPIOSXAUTH)");
+ err(1, "%s: SIOCSSPPPPARAMS(SPPPIOSXAUTH)", ifr.ifr_name);
}
void
spa.cmd = SPPPIOSHAUTH;
if (ioctl(sock, SIOCSSPPPPARAMS, &ifr) == -1)
- err(1, "SIOCSSPPPPARAMS(SPPPIOSXAUTH)");
+ err(1, "%s: SIOCSSPPPPARAMS(SPPPIOSXAUTH)", ifr.ifr_name);
}
void
strlcpy(wgdata.wgd_name, ifname, sizeof(wgdata.wgd_name));
if (ioctl(sock, SIOCSWG, (caddr_t)&wgdata) == -1)
- err(1, "SIOCSWG");
+ err(1, "%s: SIOCSWG", wgdata.wgd_name);
}
}
if (ioctl(sock, SIOCGWG, (caddr_t)&wgdata) < 0) {
if (errno == ENOTTY)
goto out;
- err(1, "SIOCGWG");
+ err(1, "%s: SIOCGWG", wgdata.wgd_name);
}
if (last_size >= wgdata.wgd_size)
break;
memset(&mp, 0, sizeof (mp));
ifr.ifr_data = (caddr_t)∓
if (ioctl(sock, SIOCGUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCGUMBPARAM");
+ err(1, "%s: SIOCGUMBPARAM", ifr.ifr_name);
mp.op = op;
mp.is_puk = is_puk;
}
if (ioctl(sock, SIOCSUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCSUMBPARAM");
+ err(1, "%s: SIOCSUMBPARAM", ifr.ifr_name);
}
void
memset(&mp, 0, sizeof (mp));
ifr.ifr_data = (caddr_t)∓
if (ioctl(sock, SIOCGUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCGUMBPARAM");
+ err(1, "%s: SIOCGUMBPARAM", ifr.ifr_name);
if (d != 0)
memset(mp.apn, 0, sizeof (mp.apn));
errx(1, "APN too long");
if (ioctl(sock, SIOCSUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCSUMBPARAM");
+ err(1, "%s: SIOCSUMBPARAM", ifr.ifr_name);
}
void
memset(&mp, 0, sizeof (mp));
ifr.ifr_data = (caddr_t)∓
if (ioctl(sock, SIOCGUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCGUMBPARAM");
+ err(1, "%s: SIOCGUMBPARAM", ifr.ifr_name);
if (d != -1)
mp.preferredclasses = umb_parse_classes(val);
else
mp.preferredclasses = MBIM_DATACLASS_NONE;
if (ioctl(sock, SIOCSUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCSUMBPARAM");
+ err(1, "%s: SIOCSUMBPARAM", ifr.ifr_name);
}
void
memset(&mp, 0, sizeof (mp));
ifr.ifr_data = (caddr_t)∓
if (ioctl(sock, SIOCGUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCGUMBPARAM");
+ err(1, "%s: SIOCGUMBPARAM", ifr.ifr_name);
mp.roaming = d;
if (ioctl(sock, SIOCSUMBPARAM, (caddr_t)&ifr) == -1)
- err(1, "SIOCSUMBPARAM");
+ err(1, "%s: SIOCSUMBPARAM", ifr.ifr_name);
}
void
if (errno == EINVAL || errno == ENOTTY)
return;
else
- err(1, "SIOCGIFGROUP");
+ err(1, "%s: SIOCGIFGROUP", ifgr.ifgr_name);
}
len = ifgr.ifgr_len;
if (ifgr.ifgr_groups == NULL)
err(1, "getifgroups");
if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1)
- err(1, "SIOCGIFGROUP");
+ err(1, "%s: SIOCGIFGROUP", ifgr.ifgr_name);
cnt = 0;
ifg = ifgr.ifgr_groups;
bzero(&ifrdat, sizeof(ifrdat));
ifr.ifr_data = (caddr_t)&ifrdat;
if (ioctl(sock, SIOCGIFDATA, (caddr_t)&ifr) == -1)
- err(1, "SIOCGIFDATA");
+ err(1, "%s: SIOCGIFDATA", ifr.ifr_name);
printb("\thwfeatures", (u_int)ifrdat.ifi_capabilities, HWFEATURESBITS);
if (ioctl(sock, SIOCGIFHARDMTU, (caddr_t)&ifr) != -1) {