From cb1edae3b5cac6df68116ebce8e4194d4153d688 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 19 Oct 2022 11:43:54 +1100 Subject: ndp: Remove unneeded eh_source parameter ndp() takes a parameter giving the ethernet source address of the packet it is to respond to, which it uses to determine the destination address to send the reply packet to. This is not necessary, because the address will always be the guest's MAC address. Even if the guest has just changed MAC address, then either tap_handler_passt() or tap_handler_pasta() - which are the only call paths leading to ndp() will have updated c->mac_guest with the new value. So, remove the parameter, and just use c->mac_guest, making it more consistent with other paths where we construct packets to send inwards. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tap.c') diff --git a/tap.c b/tap.c index 135d799..0031d82 100644 --- a/tap.c +++ b/tap.c @@ -576,7 +576,7 @@ resume: if (l4_len < sizeof(struct icmp6hdr)) continue; - if (ndp(c, (struct icmp6hdr *)l4h, eh->h_source, saddr)) + if (ndp(c, (struct icmp6hdr *)l4h, saddr)) continue; tap_packet_debug(NULL, ip6h, NULL, proto, NULL, 1); -- cgit v1.2.3