diff options
author | Ethan Sommer <e5ten.arch@gmail.com> | 2020-05-27 15:30:32 -0400 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-05-27 17:18:27 -0500 |
commit | 5d9ef963b1d6c7c036eaeb337e97c5a1ca69c1fa (patch) | |
tree | 0eb28dabe6bce91b70741fa2ac6792d5e5cc9e50 | |
parent | 1e12560bc40d68270dd922c8d3cdfc3e842bafcb (diff) | |
download | toybox-5d9ef963b1d6c7c036eaeb337e97c5a1ca69c1fa.tar.gz |
route: remove unused get_hostname()
-rw-r--r-- | toys/pending/route.c | 20 |
1 files changed, 0 insertions, 20 deletions
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; |