Skip to content

Commit

Permalink
Add support for SIOCGMIIPHY ioctl.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardu committed May 2, 2024
1 parent 4ed1b81 commit 5ee0ed4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/record_syscall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,7 @@ static Switchable prepare_ioctl(RecordTask* t,
case SIOCGIFNETMASK:
case SIOCGIFMETRIC:
case SIOCGIFMAP:
case SIOCGMIIPHY:
syscall_state.reg_parameter<typename Arch::ifreq>(3);
syscall_state.after_syscall_action(record_page_below_stack_ptr);
return PREVENT_SWITCH;
Expand Down
8 changes: 8 additions & 0 deletions src/test/sioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ static int generic_request_by_name(int sockfd, struct ifreq* req, int nr,
atomic_printf("(errno:%d/%s)\n", errno, strerror(errno));
return 0;
}
if (errno == EPERM) {
atomic_printf("(errno:%d/%s)\n", errno, strerror(errno));
return 0;
}
}

test_assert(0 == ret);
Expand Down Expand Up @@ -525,6 +529,10 @@ int main(void) {
atomic_printf("wireless ESSID:%s\n", buf);
}

if (GENERIC_REQUEST_BY_NAME(SIOCGMIIPHY)) {
atomic_printf("flags is %d\n", req->ifr_ifru.ifru_flags);
}

atomic_puts("EXIT-SUCCESS");
return 0;
}

0 comments on commit 5ee0ed4

Please sign in to comment.