From 1feabfef63d697a970c6524a39ef86c159b08e65 Mon Sep 17 00:00:00 2001 From: Bastian Blank Date: Sun, 7 Aug 2022 12:44:19 +0200 Subject: Use target address from Neighbor Advertisement The IPv6 support in libslirp fails to work with any NDP proxy. The code used to interpret the NA packets uses the wrong address to insert into it's neighbor table, the address of the source of the packet, aka the proxy itself. However the NA packet got the real target address readily available. Just use it directly instead. Signed-off-by: Bastian Blank --- src/ip6_icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ip6_icmp.c b/src/ip6_icmp.c index 3168457..732b202 100644 --- a/src/ip6_icmp.c +++ b/src/ip6_icmp.c @@ -367,7 +367,7 @@ static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip, ntohs(ip->ip_pl) >= ICMP6_NDP_NA_MINLEN && !IN6_IS_ADDR_MULTICAST(&icmp->icmp6_nna.target) && (!IN6_IS_ADDR_MULTICAST(&ip->ip_dst) || icmp->icmp6_nna.S == 0)) { - ndp_table_add(slirp, ip->ip_src, eth->h_source); + ndp_table_add(slirp, icmp->icmp6_nna.target, eth->h_source); } break; -- cgit v1.1