summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2018-08-20 19:15:56 +0200
committerLaurent Vivier <laurent@vivier.eu>2018-08-20 22:07:19 +0200
commit90cce2a106e4f0f7b568f45ab1c1d175bb1ffa28 (patch)
treed01228c45e4ce877fe67c3824fbe609b4864925d /linux-user
parent3c3ab559c137af711e857e0ccfc2d44b5a13d993 (diff)
linux-user: update netlink route types
Add RTA_PREF and RTA_CACHEINFO. Fix following errors when we start gedit: Unknown host RTA type: 12 Unknown host RTA type: 20 Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20180820171557.7734-4-laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9effbb316a..c0840107c9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2693,12 +2693,17 @@ static abi_long host_to_target_data_addr_rtattr(struct rtattr *rtattr)
static abi_long host_to_target_data_route_rtattr(struct rtattr *rtattr)
{
uint32_t *u32;
+ struct rta_cacheinfo *ci;
+
switch (rtattr->rta_type) {
/* binary: depends on family type */
case QEMU_RTA_GATEWAY:
case QEMU_RTA_DST:
case QEMU_RTA_PREFSRC:
break;
+ /* u8 */
+ case QEMU_RTA_PREF:
+ break;
/* u32 */
case QEMU_RTA_PRIORITY:
case QEMU_RTA_TABLE:
@@ -2706,6 +2711,20 @@ static abi_long host_to_target_data_route_rtattr(struct rtattr *rtattr)
u32 = RTA_DATA(rtattr);
*u32 = tswap32(*u32);
break;
+ /* struct rta_cacheinfo */
+ case QEMU_RTA_CACHEINFO:
+ ci = RTA_DATA(rtattr);
+ ci->rta_clntref = tswap32(ci->rta_clntref);
+ ci->rta_lastuse = tswap32(ci->rta_lastuse);
+ ci->rta_expires = tswap32(ci->rta_expires);
+ ci->rta_error = tswap32(ci->rta_error);
+ ci->rta_used = tswap32(ci->rta_used);
+#if defined(RTNETLINK_HAVE_PEERINFO)
+ ci->rta_id = tswap32(ci->rta_id);
+ ci->rta_ts = tswap32(ci->rta_ts);
+ ci->rta_tsage = tswap32(ci->rta_tsage);
+#endif
+ break;
default:
gemu_log("Unknown host RTA type: %d\n", rtattr->rta_type);
break;