diff options
author | Helge Deller <deller@gmx.de> | 2025-01-20 22:20:41 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2025-01-24 13:58:40 +0100 |
commit | 5f01c60879f0a1dd540c2c25757a57908847e055 (patch) | |
tree | 09296ad3a5ce3cf37934e6a0c03c23d574b7f6d6 | |
parent | 0e3aff9ec34059512d597eacfcf4d1b5d4570c50 (diff) | |
download | qemu-5f01c60879f0a1dd540c2c25757a57908847e055.zip qemu-5f01c60879f0a1dd540c2c25757a57908847e055.tar.gz qemu-5f01c60879f0a1dd540c2c25757a57908847e055.tar.bz2 |
linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()
Fix this warning:
Unknown host IFA type: 11
While adding IFA_PROTO, convert all IFA_XXX values over to QEMU_IFA_XXX values
to avoid a build failure on Ubuntu 22.04 (kernel v5.18 which does not know
IFA_PROTO yet).
Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
-rw-r--r-- | linux-user/fd-trans.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index c04a97c..2e714c8 100644 --- a/linux-user/fd-trans.c +++ b/linux-user/fd-trans.c @@ -32,6 +32,22 @@ #include "signal-common.h" enum { + QEMU_IFA_UNSPEC, + QEMU_IFA_ADDRESS, + QEMU_IFA_LOCAL, + QEMU_IFA_LABEL, + QEMU_IFA_BROADCAST, + QEMU_IFA_ANYCAST, + QEMU_IFA_CACHEINFO, + QEMU_IFA_MULTICAST, + QEMU_IFA_FLAGS, + QEMU_IFA_RT_PRIORITY, + QEMU_IFA_TARGET_NETNSID, + QEMU_IFA_PROTO, + QEMU__IFA__MAX, +}; + +enum { QEMU_IFLA_BR_UNSPEC, QEMU_IFLA_BR_FORWARD_DELAY, QEMU_IFLA_BR_HELLO_TIME, @@ -1138,20 +1154,21 @@ static abi_long host_to_target_data_addr_rtattr(struct rtattr *rtattr) switch (rtattr->rta_type) { /* binary: depends on family type */ - case IFA_ADDRESS: - case IFA_LOCAL: + case QEMU_IFA_ADDRESS: + case QEMU_IFA_LOCAL: + case QEMU_IFA_PROTO: break; /* string */ - case IFA_LABEL: + case QEMU_IFA_LABEL: break; /* u32 */ - case IFA_FLAGS: - case IFA_BROADCAST: + case QEMU_IFA_FLAGS: + case QEMU_IFA_BROADCAST: u32 = RTA_DATA(rtattr); *u32 = tswap32(*u32); break; /* struct ifa_cacheinfo */ - case IFA_CACHEINFO: + case QEMU_IFA_CACHEINFO: ci = RTA_DATA(rtattr); ci->ifa_prefered = tswap32(ci->ifa_prefered); ci->ifa_valid = tswap32(ci->ifa_valid); @@ -1398,8 +1415,8 @@ static abi_long target_to_host_data_addr_rtattr(struct rtattr *rtattr) { switch (rtattr->rta_type) { /* binary: depends on family type */ - case IFA_LOCAL: - case IFA_ADDRESS: + case QEMU_IFA_LOCAL: + case QEMU_IFA_ADDRESS: break; default: qemu_log_mask(LOG_UNIMP, "Unknown target IFA type: %d\n", |