2008-11-11 Dmitry V. Levin <ldv@altlinux.org>
* sock.c [LINUX] (sock_ioctl): Parse more SIOCS* ioctls.
diff --git a/ChangeLog b/ChangeLog
index f096911..1d2cc4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-11-11 Dmitry V. Levin <ldv@altlinux.org>
+
+ * sock.c [LINUX] (sock_ioctl): Parse more SIOCS* ioctls.
+
2008-12-09 Roland McGrath <roland@redhat.com>
* strace.1 (DIAGNOSTICS): New section, describe exit behavior.
diff --git a/sock.c b/sock.c
index 187ca5d..5e2ab57 100644
--- a/sock.c
+++ b/sock.c
@@ -134,26 +134,38 @@
return 1;
#ifdef LINUX
case SIOCGIFNAME:
+ case SIOCSIFNAME:
case SIOCGIFINDEX:
case SIOCGIFADDR:
+ case SIOCSIFADDR:
case SIOCGIFDSTADDR:
+ case SIOCSIFDSTADDR:
case SIOCGIFBRDADDR:
+ case SIOCSIFBRDADDR:
case SIOCGIFNETMASK:
+ case SIOCSIFNETMASK:
case SIOCGIFFLAGS:
+ case SIOCSIFFLAGS:
case SIOCGIFMETRIC:
+ case SIOCSIFMETRIC:
case SIOCGIFMTU:
+ case SIOCSIFMTU:
case SIOCGIFSLAVE:
+ case SIOCSIFSLAVE:
case SIOCGIFHWADDR:
+ case SIOCSIFHWADDR:
case SIOCGIFTXQLEN:
+ case SIOCSIFTXQLEN:
case SIOCGIFMAP:
+ case SIOCSIFMAP:
if (umove(tcp, tcp->u_arg[2], &ifr) < 0)
tprintf(", %#lx", tcp->u_arg[2]);
else if (syserror(tcp)) {
- if (code == SIOCGIFNAME)
+ if (code == SIOCGIFNAME || code == SIOCSIFNAME)
tprintf(", {ifr_index=%d, ifr_name=???}", ifr.ifr_ifindex);
else
tprintf(", {ifr_name=\"%s\", ???}", ifr.ifr_name);
- } else if (code == SIOCGIFNAME)
+ } else if (code == SIOCGIFNAME || code == SIOCSIFNAME)
tprintf(", {ifr_index=%d, ifr_name=\"%s\"}",
ifr.ifr_ifindex, ifr.ifr_name);
else {
@@ -163,15 +175,19 @@
tprintf("ifr_index=%d", ifr.ifr_ifindex);
break;
case SIOCGIFADDR:
+ case SIOCSIFADDR:
str = "ifr_addr";
case SIOCGIFDSTADDR:
- if (str == NULL)
+ case SIOCSIFDSTADDR:
+ if (!str)
str = "ifr_dstaddr";
case SIOCGIFBRDADDR:
- if (str == NULL)
+ case SIOCSIFBRDADDR:
+ if (!str)
str = "ifr_broadaddr";
case SIOCGIFNETMASK:
- if (str == NULL)
+ case SIOCSIFNETMASK:
+ if (!str)
str = "ifr_netmask";
tprintf("%s={", str);
printxval(addrfams,
@@ -185,6 +201,7 @@
tprintf("}");
break;
case SIOCGIFHWADDR:
+ case SIOCSIFHWADDR:
/* XXX Are there other hardware addresses
than 6-byte MACs? */
bytes = (unsigned char *) &ifr.ifr_hwaddr.sa_data;
@@ -193,22 +210,28 @@
bytes[3], bytes[4], bytes[5]);
break;
case SIOCGIFFLAGS:
+ case SIOCSIFFLAGS:
tprintf("ifr_flags=");
printflags(iffflags, ifr.ifr_flags, "IFF_???");
break;
case SIOCGIFMETRIC:
+ case SIOCSIFMETRIC:
tprintf("ifr_metric=%d", ifr.ifr_metric);
break;
case SIOCGIFMTU:
+ case SIOCSIFMTU:
tprintf("ifr_mtu=%d", ifr.ifr_mtu);
break;
case SIOCGIFSLAVE:
+ case SIOCSIFSLAVE:
tprintf("ifr_slave=\"%s\"", ifr.ifr_slave);
break;
case SIOCGIFTXQLEN:
+ case SIOCSIFTXQLEN:
tprintf("ifr_qlen=%d", ifr.ifr_qlen);
break;
case SIOCGIFMAP:
+ case SIOCSIFMAP:
tprintf("ifr_map={mem_start=%#lx, "
"mem_end=%#lx, base_addr=%#x, "
"irq=%u, dma=%u, port=%u}",