Skip to content

Commit 017fc66

Browse files
committed
linux-user: netlink: Add IP_PKTINFO cmsg parsing
Fixes those warnings: Unsupported host ancillary data: 0/8 Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
1 parent b97f8d1 commit 017fc66

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

linux-user/syscall.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,16 @@ static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh,
19981998
(void *) &errh->offender, sizeof(errh->offender));
19991999
break;
20002000
}
2001+
case IP_PKTINFO:
2002+
{
2003+
struct in_pktinfo *pkti = data;
2004+
struct target_in_pktinfo *target_pi = target_data;
2005+
2006+
__put_user(pkti->ipi_ifindex, &target_pi->ipi_ifindex);
2007+
target_pi->ipi_spec_dst.s_addr = pkti->ipi_spec_dst.s_addr;
2008+
target_pi->ipi_addr.s_addr = pkti->ipi_addr.s_addr;
2009+
break;
2010+
}
20012011
default:
20022012
goto unimplemented;
20032013
}

linux-user/syscall_defs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,6 +2622,12 @@ struct target_ucred {
26222622
abi_uint gid;
26232623
};
26242624

2625+
struct target_in_pktinfo {
2626+
abi_int ipi_ifindex;
2627+
struct target_in_addr ipi_spec_dst;
2628+
struct target_in_addr ipi_addr;
2629+
};
2630+
26252631
typedef abi_int target_timer_t;
26262632

26272633
#define TARGET_SIGEV_MAX_SIZE 64

0 commit comments

Comments
 (0)