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 <laur...@vivier.eu> Message-Id: <20180814161904.12216-3-laur...@vivier.eu> --- linux-user/syscall.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e66faf1c62..da1fcaf4ca 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2659,12 +2659,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 RTA_GATEWAY: case RTA_DST: case RTA_PREFSRC: break; + /* u8 */ + case RTA_PREF: + break; /* u32 */ case RTA_PRIORITY: case RTA_TABLE: @@ -2672,6 +2677,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 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; -- 2.17.1