From a91b5e2200fcf2ed659d59524940a14b5d672c08 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 2 Jul 2014 10:57:10 -0400 Subject: [PATCH] Correctly remove icmp echo reply Continuing the tradition of being stingy with neighbor table entries. ICMP echo requests are common stray traffic in some environments and stray responses are not actually a good indicator of what those services are hoping to find anyway. --- src/net/icmp.c | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/net/icmp.c b/src/net/icmp.c index 3191fed1..e6d7de04 100644 --- a/src/net/icmp.c +++ b/src/net/icmp.c @@ -125,33 +125,6 @@ int icmp_tx_echo_request ( struct io_buffer *iobuf, return 0; } -/** - * Transmit ICMP echo reply - * - * @v iobuf I/O buffer - * @v st_dest Destination socket address - * @ret rc Return status code - */ -static int icmp_tx_echo_reply ( struct io_buffer *iobuf, - struct sockaddr_tcpip *st_dest, - struct icmp_echo_protocol *echo_protocol ) { -/* - struct icmp_echo *echo = iobuf->data; - int rc; - - /* Set type */ - echo->icmp.type = echo_protocol->reply; - - /* Transmit reply */ - DBGC ( icmpcol ( st_dest ), "ICMP TX echo reply id %04x seq %04x\n", - ntohs ( echo->ident ), ntohs ( echo->sequence ) ); - if ( ( rc = icmp_tx_echo ( iobuf, st_dest, echo_protocol ) ) != 0 ) - return rc; -*/ - - return 0; -} - /** * Process a received ICMP echo request * @@ -164,7 +137,7 @@ int icmp_rx_echo_request ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src, struct icmp_echo_protocol *echo_protocol ) { struct icmp_echo *echo = iobuf->data; - int rc; + (void)(echo_protocol); /* Sanity check */ if ( iob_len ( iobuf ) < sizeof ( *echo ) ) { @@ -177,10 +150,6 @@ int icmp_rx_echo_request ( struct io_buffer *iobuf, DBGC ( icmpcol ( st_src ), "ICMP RX echo request id %04x seq %04x\n", ntohs ( echo->ident ), ntohs ( echo->sequence ) ); - /* Transmit echo reply */ - if ( ( rc = icmp_tx_echo_reply ( iobuf, st_src, echo_protocol ) ) != 0 ) - return rc; - return 0; }