unsigned char *bytes;
if (entering(tcp)) {
- if (code == SIOCGIFCONF) {
+ switch (code) {
+ case SIOCGIFCONF:
if (umove(tcp, tcp->u_arg[2], &ifc) >= 0
&& ifc.ifc_buf == NULL)
tprintf(", {%d -> ", ifc.ifc_len);
else
tprints(", {");
+ break;
+ case SIOCSIFNAME:
+ if (umove(tcp, tcp->u_arg[2], &ifr) < 0)
+ tprintf(", %#lx", tcp->u_arg[2]);
+ else
+ tprintf(", {ifr_name=\"%.*s\", ifr_newname=\"%.*s\"}",
+ IFNAMSIZ, ifr.ifr_name,
+ IFNAMSIZ, ifr.ifr_newname);
+ break;
}
return 0;
}
case SIOCATMARK:
#endif
printnum(tcp, arg, ", %#d");
+ case SIOCSIFNAME:
return 1;
case SIOCGIFNAME:
- case SIOCSIFNAME:
case SIOCGIFINDEX:
case SIOCGIFADDR:
case SIOCSIFADDR:
tprintf(", {ifr_index=%d, ifr_name=???}",
ifr.ifr_ifindex);
} else {
- tprintf(", {ifr_name=\"%.*s\", ",
+ tprintf(", {ifr_name=\"%.*s\", ???}",
IFNAMSIZ, ifr.ifr_name);
-
- if (code == SIOCSIFNAME)
- tprintf("ifr_newname=\"%.*s\"}",
- IFNAMSIZ, ifr.ifr_newname);
- else
- tprintf("???}");
}
} else if (code == SIOCGIFNAME) {
tprintf(", {ifr_index=%d, ifr_name=\"%.*s\"}",
case SIOCSIFMTU:
tprintf("ifr_mtu=%d", ifr.ifr_mtu);
break;
- case SIOCSIFNAME:
- tprintf("ifr_newname=\"%.*s\"",
- IFNAMSIZ, ifr.ifr_newname);
- break;
case SIOCGIFSLAVE:
case SIOCSIFSLAVE:
tprintf("ifr_slave=\"%s\"", ifr.ifr_slave);