From c0329673fa987eb2d493babb54c8aaa86ac7f9b3 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 25 Jul 2017 21:39:10 +0200 Subject: ax25ipd: Remove code for ICMP mode. Supposedly it didn't work and it was never being built anyway. Signed-off-by: Ralf Baechle --- ax25ipd/io.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/ax25ipd/io.c b/ax25ipd/io.c index 0f8077e..d17f9fd 100644 --- a/ax25ipd/io.c +++ b/ax25ipd/io.c @@ -9,8 +9,6 @@ * than just I/O stuff. */ -#undef USE_ICMP /* not implemented yet, sorry */ - #include "ax25ipd.h" #include @@ -20,9 +18,6 @@ #include #include #include -#ifdef USE_ICMP -#include -#endif #include #include #include @@ -41,9 +36,6 @@ static struct termio nterm; int ttyfd = -1; static int udpsock = -1; static int sock = -1; -#ifdef USE_ICMP -static int icmpsock = -1; -#endif static struct sockaddr_in udpbind; static struct sockaddr_in to; static struct sockaddr_in from; @@ -62,9 +54,6 @@ int ttyfd_bpq = 0; #define IP_MODE 0x10 #define UDP_MODE 0x20 #define TTY_MODE 0x30 -#ifdef USE_ICMP -#define ICMP_MODE 0x40 -#endif #ifndef FNDELAY #define FNDELAY O_NDELAY @@ -258,12 +247,6 @@ void io_init(void) close(udpsock); udpsock = -1; } -#ifdef USE_ICMP - if (icmpsock >= 0) { - close(icmpsock); - icmpsock = -1; - } -#endif /* * The bzero is not strictly required - it simply zeros out the @@ -301,17 +284,6 @@ void io_open(void) perror("setting non-blocking I/O on raw socket"); exit(1); } -#ifdef USE_ICMP - icmpsock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); - if (icmpsock < 0) { - perror("opening raw ICMP socket"); - exit(1); - } - if (fcntl(icmpsock, F_SETFL, FNDELAY) < 0) { - perror("setting non-blocking I/O on ICMP socket"); - exit(1); - } -#endif } if (udp_mode) { @@ -555,9 +527,6 @@ void io_start(void) { if (ip_mode) { FD_SET(sock, &readfds); -#ifdef USE_ICMP - FD_SET(icmpsock, &readfds); -#endif } if (udp_mode) { @@ -637,19 +606,6 @@ out_ttyfd: if (n > hdr_len) from_ip(buf + hdr_len, n - hdr_len); } -#ifdef USE_ICMP - if (FD_ISSET(icmpsock, &readfds)) { - do { - fromlen = sizeof from; - n = recvfrom(icmpsock, buf, MAX_FRAME, 0, (struct sockaddr *) &from, &fromlen); - } - while (io_error(n, buf, n, READ_MSG, ICMP_MODE, __LINE__)); - ipptr = (struct iphdr *) buf; - hdr_len = 4 * ipptr-> ihl; - LOGL4("icmpdata from=%s l=%d, hl=%d\n", - inet_ntoa(from. sin_addr), n, hdr_len); - } -#endif } /* if ip_mode */ } /* for forever */ -- cgit v1.2.3