net: enhance decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP
* net.c (print_group_req): Allow option length greater than sizeof(struct group_req) to match the kernel behaviour. When the option length is invalid, print the address. * NEWS: Mention this.
This commit is contained in:
parent
92fa2ce23c
commit
7bcb1dcdbc
3
NEWS
3
NEWS
@ -7,7 +7,8 @@ Noteworthy changes in release ?.?? (????-??-??)
|
||||
* Enhanced decoding of SO_PEERCRED option of getsockopt syscall.
|
||||
* Enhanced decoding of IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP,
|
||||
IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, IPV6_JOIN_ANYCAST,
|
||||
and IPV6_LEAVE_ANYCAST options of setsockopt syscall.
|
||||
IPV6_LEAVE_ANYCAST, MCAST_JOIN_GROUP, and MCAST_LEAVE_GROUP options
|
||||
of setsockopt syscall.
|
||||
* Implemented decoding of linux socket filter programs specified
|
||||
for SO_ATTACH_FILTER and SO_ATTACH_REUSEPORT_CBPF socket options.
|
||||
|
||||
|
16
net.c
16
net.c
@ -684,20 +684,18 @@ print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr,
|
||||
|
||||
#ifdef MCAST_JOIN_GROUP
|
||||
static void
|
||||
print_group_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
|
||||
print_group_req(struct tcb *const tcp, const kernel_ulong_t addr,
|
||||
const int len)
|
||||
{
|
||||
struct group_req greq;
|
||||
|
||||
if (len != sizeof(greq) ||
|
||||
umove(tcp, addr, &greq) < 0) {
|
||||
if (len < (int) sizeof(greq)) {
|
||||
printaddr(addr);
|
||||
return;
|
||||
} else if (!umove_or_printaddr(tcp, addr, &greq)) {
|
||||
PRINT_FIELD_IFINDEX("{", greq, gr_interface);
|
||||
PRINT_FIELD_SOCKADDR(", ", greq, gr_group);
|
||||
tprints("}");
|
||||
}
|
||||
|
||||
PRINT_FIELD_IFINDEX("{", greq, gr_interface);
|
||||
PRINT_FIELD_SOCKADDR(", ", greq, gr_group);
|
||||
tprints("}");
|
||||
|
||||
}
|
||||
#endif /* MCAST_JOIN_GROUP */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user