aboutgitcodebugslistschat
path: root/icmp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-07 12:40:16 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-11-07 09:53:45 +0100
commitf6d8dc235553761a2541f7a6b782488160db03a7 (patch)
treebd91d104ba900c99cc9dbabdc277e95bf628d845 /icmp.c
parent732e24937618f5848e182dc8a38eb170cf079394 (diff)
downloadpasst-f6d8dc235553761a2541f7a6b782488160db03a7.tar
passt-f6d8dc235553761a2541f7a6b782488160db03a7.tar.gz
passt-f6d8dc235553761a2541f7a6b782488160db03a7.tar.bz2
passt-f6d8dc235553761a2541f7a6b782488160db03a7.tar.lz
passt-f6d8dc235553761a2541f7a6b782488160db03a7.tar.xz
passt-f6d8dc235553761a2541f7a6b782488160db03a7.tar.zst
passt-f6d8dc235553761a2541f7a6b782488160db03a7.zip
pif: Pass originating pif to tap handler functions
For now, packets passed to the various *_tap_handler() functions always come from the single "tap" interface. We want to allow the possibility to broaden that in future. As preparation for that, have the code in tap.c pass the pif id of the originating interface to each of those handler functions. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'icmp.c')
-rw-r--r--icmp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/icmp.c b/icmp.c
index 41b9f8b..a1de8ae 100644
--- a/icmp.c
+++ b/icmp.c
@@ -148,6 +148,7 @@ void icmpv6_sock_handler(const struct ctx *c, union epoll_ref ref)
/**
* icmp_tap_handler() - Handle packets from tap
* @c: Execution context
+ * @pif: pif on which the packet is arriving
* @af: Address family, AF_INET or AF_INET6
* @saddr: Source address
* @daddr: Destination address
@@ -156,13 +157,14 @@ void icmpv6_sock_handler(const struct ctx *c, union epoll_ref ref)
*
* Return: count of consumed packets (always 1, even if malformed)
*/
-int icmp_tap_handler(const struct ctx *c, int af,
+int icmp_tap_handler(const struct ctx *c, uint8_t pif, int af,
const void *saddr, const void *daddr,
const struct pool *p, const struct timespec *now)
{
size_t plen;
(void)saddr;
+ (void)pif;
if (af == AF_INET) {
struct sockaddr_in sa = {