aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
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;