From 6415c44bf5d6263151b272911b1c0d0eccb32788 Mon Sep 17 00:00:00 2001 From: markj Date: Sat, 20 Oct 2018 17:44:23 +0000 Subject: [PATCH] Remove dead code. No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- usr.sbin/rtsold/if.c | 31 ------------------------------- usr.sbin/rtsold/rtsock.c | 8 -------- usr.sbin/rtsold/rtsold.c | 18 ------------------ usr.sbin/rtsold/rtsold.h | 3 --- 4 files changed, 60 deletions(-) diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c index 8fe8ba3c6df..5b9adc8edb6 100644 --- a/usr.sbin/rtsold/if.c +++ b/usr.sbin/rtsold/if.c @@ -332,37 +332,6 @@ if_nametosdl(char *name) return (ret_sdl); } -int -getinet6sysctl(int code) -{ - int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 }; - int value; - size_t size; - - mib[3] = code; - size = sizeof(value); - if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) < 0) - return (-1); - else - return (value); -} - -int -setinet6sysctl(int code, int newval) -{ - int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 }; - int value; - size_t size; - - mib[3] = code; - size = sizeof(value); - if (sysctl(mib, nitems(mib), &value, &size, - &newval, sizeof(newval)) < 0) - return (-1); - else - return (value); -} - /*------------------------------------------------------------*/ /* get ia6_flags for link-local addr on if. returns -1 on error. */ diff --git a/usr.sbin/rtsold/rtsock.c b/usr.sbin/rtsold/rtsock.c index bd25c901a79..c87f1b511e6 100644 --- a/usr.sbin/rtsold/rtsock.c +++ b/usr.sbin/rtsold/rtsock.c @@ -57,14 +57,6 @@ #include #include "rtsold.h" -#define ROUNDUP(a, size) \ - (((a) & ((size)-1)) ? (1 + ((a) | ((size)-1))) : (a)) - -#define NEXT_SA(ap) (ap) = (struct sockaddr *) \ - ((caddr_t)(ap) + \ - ((ap)->sa_len ? ROUNDUP((ap)->sa_len, sizeof(u_long)) \ - : sizeof(u_long))) - static int rtsock_input_ifannounce(int, struct rt_msghdr *, char *); static struct { diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 7fb27d5a010..eecbbff7f13 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -431,21 +431,6 @@ ifconfig(char *ifname) return (-1); } -void -iflist_init(void) -{ - struct ifinfo *ifi; - - while ((ifi = TAILQ_FIRST(&ifinfo_head)) != NULL) { - TAILQ_REMOVE(&ifinfo_head, ifi, ifi_next); - if (ifi->sdl != NULL) - free(ifi->sdl); - if (ifi->rs_data != NULL) - free(ifi->rs_data); - free(ifi); - } -} - struct rainfo * find_rainfo(struct ifinfo *ifi, struct sockaddr_in6 *sin6) { @@ -727,9 +712,6 @@ rtsol_timer_update(struct ifinfo *ifi) #undef MILLION } -/* timer related utility functions */ -#define MILLION 1000000 - #ifndef SMALL static void rtsold_set_dump_file(int sig __unused) diff --git a/usr.sbin/rtsold/rtsold.h b/usr.sbin/rtsold/rtsold.h index 0c0acea5cde..0a0632b8e6f 100644 --- a/usr.sbin/rtsold/rtsold.h +++ b/usr.sbin/rtsold/rtsold.h @@ -157,7 +157,6 @@ extern int Fflag; extern int uflag; extern const char *otherconf_script; extern const char *resolvconf_script; -extern void iflist_init(void); struct ifinfo *find_ifinfo(int); struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *); void rtsol_timer_update(struct ifinfo *); @@ -172,8 +171,6 @@ extern int interface_status(struct ifinfo *); extern int lladdropt_length(struct sockaddr_dl *); extern void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *); extern struct sockaddr_dl *if_nametosdl(char *); -extern int getinet6sysctl(int); -extern int setinet6sysctl(int, int); /* rtsol.c */ extern int rssock; -- 2.45.0