From a325121759ad5a78bd79749f0a520d2ebfb72120 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 16 Jan 2024 16:16:15 +1100 Subject: icmp: Consolidate icmp_sock_handler() with icmpv6_sock_handler() Currently we have separate handlers for ICMP and ICMPv6 ping replies. Although there are a number of points of difference, with some creative refactoring we can combine these together sensibly. Although it doesn't save a vast amount of code, it does make it clearer that we're performing basically the same steps for each case. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- icmp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'icmp.h') diff --git a/icmp.h b/icmp.h index 4096c65..0083597 100644 --- a/icmp.h +++ b/icmp.h @@ -10,8 +10,7 @@ struct ctx; -void icmp_sock_handler(const struct ctx *c, union epoll_ref ref); -void icmpv6_sock_handler(const struct ctx *c, union epoll_ref ref); +void icmp_sock_handler(const struct ctx *c, int af, union epoll_ref ref); 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); -- cgit v1.2.3