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>
This commit is contained in:
committed by
Stefano Brivio
parent
70d43f9c05
commit
a325121759
4
passt.c
4
passt.c
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user