mirror of
https://passt.top/passt
synced 2025-05-20 16:35:33 +02:00
icmp: Obtain destination addresses from the flowsides
icmp_sock_handler() obtains the guest address from it's most recently observed IP. However, this can now be obtained from the common flowside information. icmp_tap_handler() builds its socket address for sendto() directly from the destination address supplied by the incoming tap packet. This can instead be generated from the flow. Using the flowsides as the common source of truth here prepares us for allowing more flexible NAT and forwarding by properly initialising that flowside information. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
5cffb1bf64
commit
6d76278c21
3 changed files with 17 additions and 22 deletions
11
tap.c
11
tap.c
|
@ -90,17 +90,6 @@ void tap_send_single(const struct ctx *c, const void *data, size_t l2len)
|
|||
tap_send_frames(c, iov, iovcnt, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* tap_ip4_daddr() - Normal IPv4 destination address for inbound packets
|
||||
* @c: Execution context
|
||||
*
|
||||
* Return: IPv4 address
|
||||
*/
|
||||
struct in_addr tap_ip4_daddr(const struct ctx *c)
|
||||
{
|
||||
return c->ip4.addr_seen;
|
||||
}
|
||||
|
||||
/**
|
||||
* tap_ip6_daddr() - Normal IPv6 destination address for inbound packets
|
||||
* @c: Execution context
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue