ndp: Store link-local or global address on any NDP message received
The guest might not send other types of traffic before we try to communicate to it, so take also this chance to store its configured addresses. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
5ec9ad7e9d
commit
7fa3e90290
1 changed files with 5 additions and 0 deletions
5
ndp.c
5
ndp.c
|
@ -162,6 +162,11 @@ int ndp(struct ctx *c, struct ethhdr *eh, size_t len)
|
||||||
|
|
||||||
len = (uintptr_t)p - (uintptr_t)ihr - sizeof(*ihr);
|
len = (uintptr_t)p - (uintptr_t)ihr - sizeof(*ihr);
|
||||||
|
|
||||||
|
if (IN6_IS_ADDR_LINKLOCAL(&ip6h->saddr))
|
||||||
|
c->addr6_ll_seen = ip6h->saddr;
|
||||||
|
else
|
||||||
|
c->addr6_seen = ip6h->saddr;
|
||||||
|
|
||||||
ip6hr->daddr = ip6h->saddr;
|
ip6hr->daddr = ip6h->saddr;
|
||||||
ip6hr->saddr = c->gw6;
|
ip6hr->saddr = c->gw6;
|
||||||
ip6hr->payload_len = htons(sizeof(*ihr) + len);
|
ip6hr->payload_len = htons(sizeof(*ihr) + len);
|
||||||
|
|
Loading…
Reference in a new issue