From 48582bf47f5ef7a1bf136ca455d182addad08028 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sat, 26 Mar 2022 07:23:21 +0100 Subject: treewide: Mark constant references as const Signed-off-by: Stefano Brivio --- icmp.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'icmp.c') diff --git a/icmp.c b/icmp.c index 075bc4c..94093d2 100644 --- a/icmp.c +++ b/icmp.c @@ -65,8 +65,8 @@ static uint8_t icmp_act [IP_VERSIONS][USHRT_MAX / 8]; * @events: epoll events bitmap * @now: Current timestamp, unused */ -void icmp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events, - struct timespec *now) +void icmp_sock_handler(const struct ctx *c, union epoll_ref ref, + uint32_t events, const struct timespec *now) { struct in6_addr a6 = { .s6_addr = { 0, 0, 0, 0, 0, 0, 0, 0, @@ -136,13 +136,14 @@ void icmp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events, * icmp_tap_handler() - Handle packets from tap * @c: Execution context * @af: Address family, AF_INET or AF_INET6 + * @addr: Destination address * @p: Packet pool, single packet with ICMP/ICMPv6 header * @now: Current timestamp * * Return: count of consumed packets (always 1, even if malformed) */ -int icmp_tap_handler(struct ctx *c, int af, void *addr, struct pool *p, - struct timespec *now) +int icmp_tap_handler(const struct ctx *c, int af, const void *addr, + const struct pool *p, const struct timespec *now) { size_t plen; @@ -227,8 +228,8 @@ fail_sock: * @id: Echo identifier, host order * @ts: Timestamp from caller */ -static void icmp_timer_one(struct ctx *c, int v6, uint16_t id, - struct timespec *ts) +static void icmp_timer_one(const struct ctx *c, int v6, uint16_t id, + const struct timespec *ts) { struct icmp_id_sock *id_map = &icmp_id_map[v6 ? V6 : V4][id]; @@ -247,7 +248,7 @@ static void icmp_timer_one(struct ctx *c, int v6, uint16_t id, * @c: Execution context * @ts: Timestamp from caller */ -void icmp_timer(struct ctx *c, struct timespec *ts) +void icmp_timer(const struct ctx *c, const struct timespec *ts) { long *word, tmp; unsigned int i; -- cgit v1.2.3