From 5d9ef963b1d6c7c036eaeb337e97c5a1ca69c1fa Mon Sep 17 00:00:00 2001 From: Ethan Sommer Date: Wed, 27 May 2020 15:30:32 -0400 Subject: route: remove unused get_hostname() --- toys/pending/route.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'toys') diff --git a/toys/pending/route.c b/toys/pending/route.c index 0d5e4449..39ba160b 100644 --- a/toys/pending/route.c +++ b/toys/pending/route.c @@ -94,26 +94,6 @@ void addAttr(struct nlmsghdr *nl, int maxlen, void *attr, int type, int len) nl->nlmsg_len = NLMSG_ALIGN(nl->nlmsg_len) + rtlen; } -// to get the host name from the given ip. -static int get_hostname(char *ipstr, struct sockaddr_in *sockin) -{ - struct hostent *host; - - sockin->sin_family = AF_INET; - sockin->sin_port = 0; - - if (!strcmp(ipstr, "default")) { - sockin->sin_addr.s_addr = INADDR_ANY; - return 1; - } - - if (inet_aton(ipstr, &sockin->sin_addr)) return 0; - if (!(host = gethostbyname(ipstr))) perror_exit("resolving '%s'", ipstr); - memcpy(&sockin->sin_addr, host->h_addr_list[0], sizeof(struct in_addr)); - - return 0; -} - static void display_routes(sa_family_t family) { int fd, msg_hdr_len, route_protocol; -- cgit v1.2.3