#endif
#include <net/if.h>
-extern const struct xlat addrfams[];
-
static const struct xlat iffflags[] = {
{ IFF_UP, "IFF_UP" },
{ IFF_BROADCAST, "IFF_BROADCAST" },
static void
-print_addr(tcp, addr, ifr)
-struct tcb *tcp;
-long addr;
-struct ifreq *ifr;
+print_addr(struct tcb *tcp, long addr, struct ifreq *ifr)
{
if (ifr->ifr_addr.sa_family == AF_INET) {
struct sockaddr_in *sinp;
"AF_???");
tprintf(", ");
print_addr(tcp, ((long) tcp->u_arg[2]
- + offsetof (struct ifreq,
+ + offsetof(struct ifreq,
ifr_addr.sa_data)),
&ifr);
tprintf("}");
int i;
unsigned nifra = ifc.ifc_len / sizeof(struct ifreq);
struct ifreq ifra[nifra];
- umoven(tcp, (unsigned long) ifc.ifc_buf, sizeof(ifra),
- (char *) ifra);
+
+ if (umoven(tcp, (unsigned long) ifc.ifc_buf,
+ sizeof(ifra), (char *) ifra) < 0) {
+ tprintf("%lx}", (unsigned long) ifc.ifc_buf);
+ return 1;
+ }
tprintf("{");
for (i = 0; i < nifra; ++i ) {
if (i > 0)
"AF_???");
tprintf(", ");
print_addr(tcp, ((long) tcp->u_arg[2]
- + offsetof (struct ifreq,
+ + offsetof(struct ifreq,
ifr_addr.sa_data)
+ ((char *) &ifra[i]
- (char *) &ifra[0])),