diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-01-16 16:16:15 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-01-22 23:36:51 +0100 |
commit | a325121759ad5a78bd79749f0a520d2ebfb72120 (patch) | |
tree | f52547a183171cfa3d570170f880fb62652b321a /passt.c | |
parent | 70d43f9c0523a380a8451808b344c34685296725 (diff) | |
download | passt-a325121759ad5a78bd79749f0a520d2ebfb72120.tar passt-a325121759ad5a78bd79749f0a520d2ebfb72120.tar.gz passt-a325121759ad5a78bd79749f0a520d2ebfb72120.tar.bz2 passt-a325121759ad5a78bd79749f0a520d2ebfb72120.tar.lz passt-a325121759ad5a78bd79749f0a520d2ebfb72120.tar.xz passt-a325121759ad5a78bd79749f0a520d2ebfb72120.tar.zst passt-a325121759ad5a78bd79749f0a520d2ebfb72120.zip |
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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.c')
-rw-r--r-- | passt.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -392,10 +392,10 @@ loop: udp_sock_handler(&c, ref, eventmask, &now); break; case EPOLL_TYPE_ICMP: - icmp_sock_handler(&c, ref); + icmp_sock_handler(&c, AF_INET, ref); break; case EPOLL_TYPE_ICMPV6: - icmpv6_sock_handler(&c, ref); + icmp_sock_handler(&c, AF_INET6, ref); break; default: /* Can't happen */ |