diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-03-26 07:23:21 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-03-29 15:35:38 +0200 |
commit | 48582bf47f5ef7a1bf136ca455d182addad08028 (patch) | |
tree | af17ec9ede424ec7931731fc13af914da13dcbb3 /icmp.c | |
parent | 965f603238a92b6ab8cd8a0592e0fb65c096b3e1 (diff) | |
download | passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.gz passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.bz2 passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.lz passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.xz passt-48582bf47f5ef7a1bf136ca455d182addad08028.tar.zst passt-48582bf47f5ef7a1bf136ca455d182addad08028.zip |
treewide: Mark constant references as const
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'icmp.c')
-rw-r--r-- | icmp.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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; |