1
0
mirror of https://passt.top/passt synced 2024-12-22 13:45:32 +00:00

ndp: Remove redundant update to addr_seen

ndp() updates addr_seen or addr_ll_seen based on the source address of the
received packet.  This is redundant since tap6_handler() has already
updated addr_seen for any type of packet, not just NDP.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2024-11-14 14:33:03 +11:00 committed by Stefano Brivio
parent 0588163b1f
commit 71f228d04b
2 changed files with 4 additions and 9 deletions

9
ndp.c
View File

@ -179,8 +179,8 @@ struct ndp_ns {
*
* Return: 0 if not handled here, 1 if handled, -1 on failure
*/
int ndp(struct ctx *c, const struct icmp6hdr *ih, const struct in6_addr *saddr,
const struct pool *p)
int ndp(const struct ctx *c, const struct icmp6hdr *ih,
const struct in6_addr *saddr, const struct pool *p)
{
struct ndp_na na = {
.ih = {
@ -336,11 +336,6 @@ dns_done:
return 1;
}
if (IN6_IS_ADDR_LINKLOCAL(saddr))
c->ip6.addr_ll_seen = *saddr;
else
c->ip6.addr_seen = *saddr;
rsaddr = &c->ip6.our_tap_ll;
if (ih->icmp6_type == NS) {

4
ndp.h
View File

@ -6,7 +6,7 @@
#ifndef NDP_H
#define NDP_H
int ndp(struct ctx *c, const struct icmp6hdr *ih, const struct in6_addr *saddr,
const struct pool *p);
int ndp(const struct ctx *c, const struct icmp6hdr *ih,
const struct in6_addr *saddr, const struct pool *p);
#endif /* NDP_H */