1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-15 11:55:34 +02:00

Make substructures for IPv4 and IPv6 specific context information

The context structure contains a batch of fields specific to IPv4 and to
IPv6 connectivity.  Split those out into a sub-structure.

This allows the conf_ip4() and conf_ip6() functions, which take the
entire context but touch very little of it, to be given more specific
parameters, making it clearer what it affects without stepping through the
code.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2022-07-22 15:31:18 +10:00 committed by Stefano Brivio
parent 5e12d23acb
commit 16f5586bb8
12 changed files with 232 additions and 212 deletions

2
arp.c
View file

@ -66,7 +66,7 @@ int arp(const struct ctx *c, const struct pool *p)
return 1;
/* Don't resolve our own address, either. */
if (!memcmp(am->tip, &c->addr4, sizeof(am->tip)))
if (!memcmp(am->tip, &c->ip4.addr, sizeof(am->tip)))
return 1;
ah->ar_op = htons(ARPOP_REPLY);