summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2013-08-17 19:23:35 +0000
committerhrs <hrs@FreeBSD.org>2013-08-17 19:23:35 +0000
commita8298dcc377707c8e7f1295e9e503cad9057196e (patch)
treebedf18c1abac1c39ad63158f9651e64df8e432c2 /usr.sbin
parent06c57264bc4627b043244c3f34745e71aa626651 (diff)
downloadFreeBSD-src-a8298dcc377707c8e7f1295e9e503cad9057196e.zip
FreeBSD-src-a8298dcc377707c8e7f1295e9e503cad9057196e.tar.gz
- Remove struct ifinfo *iflist. It is no longer used.
- Suppress warnings about increase of alignment requirement.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rtsold/dump.c2
-rw-r--r--usr.sbin/rtsold/if.c7
-rw-r--r--usr.sbin/rtsold/probe.c2
-rw-r--r--usr.sbin/rtsold/rtsock.c10
-rw-r--r--usr.sbin/rtsold/rtsol.c8
-rw-r--r--usr.sbin/rtsold/rtsold.c1
-rw-r--r--usr.sbin/rtsold/rtsold.h1
7 files changed, 14 insertions, 17 deletions
diff --git a/usr.sbin/rtsold/dump.c b/usr.sbin/rtsold/dump.c
index ddf0d3c..a0bf2c2 100644
--- a/usr.sbin/rtsold/dump.c
+++ b/usr.sbin/rtsold/dump.c
@@ -50,8 +50,6 @@
static FILE *fp;
-extern struct ifinfo *iflist;
-
static void dump_interface_status(void);
static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"};
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
index 58ec514..2bf946d 100644
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -61,7 +61,6 @@
#include <ifaddrs.h>
#include "rtsold.h"
-extern int rssock;
static int ifsock;
static int get_llflag(const char *);
@@ -304,13 +303,13 @@ if_nametosdl(char *name)
lim = buf + len;
for (next = buf; next < lim; next += ifm->ifm_msglen) {
- ifm = (struct if_msghdr *)next;
+ ifm = (struct if_msghdr *)(void *)next;
if (ifm->ifm_type == RTM_IFINFO) {
sa = (struct sockaddr *)(ifm + 1);
get_rtaddrs(ifm->ifm_addrs, sa, rti_info);
if ((sa = rti_info[RTAX_IFP]) != NULL) {
if (sa->sa_family == AF_LINK) {
- sdl = (struct sockaddr_dl *)sa;
+ sdl = (struct sockaddr_dl *)(void *)sa;
if (strlen(name) != sdl->sdl_nlen)
continue; /* not same len */
if (strncmp(&sdl->sdl_data[0],
@@ -397,7 +396,7 @@ get_llflag(const char *name)
continue;
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
- sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
+ sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr;
if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
continue;
diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c
index 657ae40..ac733c9 100644
--- a/usr.sbin/rtsold/probe.c
+++ b/usr.sbin/rtsold/probe.c
@@ -164,7 +164,7 @@ sendprobe(struct in6_addr *addr, struct ifinfo *ifinfo)
cm->cmsg_level = IPPROTO_IPV6;
cm->cmsg_type = IPV6_PKTINFO;
cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
- pi = (struct in6_pktinfo *)CMSG_DATA(cm);
+ pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm);
memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/
pi->ipi6_ifindex = ifindex;
diff --git a/usr.sbin/rtsold/rtsock.c b/usr.sbin/rtsold/rtsock.c
index fe22bc7..702ffe1 100644
--- a/usr.sbin/rtsold/rtsock.c
+++ b/usr.sbin/rtsold/rtsock.c
@@ -103,7 +103,7 @@ rtsock_input(int s)
lim = msg + n;
for (next = msg; next < lim; next += len) {
- rtm = (struct rt_msghdr *)next;
+ rtm = (struct rt_msghdr *)(void *)next;
if (lim - next < lenlim)
break;
len = rtm->rtm_msglen;
@@ -138,7 +138,7 @@ static int
rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim)
{
struct if_announcemsghdr *ifan;
- struct ifinfo *ifinfo;
+ struct ifinfo *ifi;
ifan = (struct if_announcemsghdr *)rtm;
if ((char *)(ifan + 1) > lim)
@@ -158,14 +158,14 @@ rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim)
case IFAN_DEPARTURE:
warnmsg(LOG_WARNING, __func__,
"interface %s removed", ifan->ifan_name);
- ifinfo = find_ifinfo(ifan->ifan_index);
- if (ifinfo) {
+ ifi = find_ifinfo(ifan->ifan_index);
+ if (ifi) {
if (dflag > 1) {
warnmsg(LOG_INFO, __func__,
"bring interface %s to DOWN state",
ifan->ifan_name);
}
- ifinfo->state = IFS_DOWN;
+ ifi->state = IFS_DOWN;
}
break;
}
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c
index f7210f6..c9b3d44 100644
--- a/usr.sbin/rtsold/rtsol.c
+++ b/usr.sbin/rtsold/rtsol.c
@@ -205,7 +205,7 @@ sendpacket(struct ifinfo *ifi)
cm->cmsg_level = IPPROTO_IPV6;
cm->cmsg_type = IPV6_PKTINFO;
cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
- pi = (struct in6_pktinfo *)CMSG_DATA(cm);
+ pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm);
memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/
pi->ipi6_ifindex = ifi->sdl->sdl_index;
@@ -275,13 +275,13 @@ rtsol_input(int s)
if (cm->cmsg_level == IPPROTO_IPV6 &&
cm->cmsg_type == IPV6_PKTINFO &&
cm->cmsg_len == CMSG_LEN(sizeof(struct in6_pktinfo))) {
- pi = (struct in6_pktinfo *)(CMSG_DATA(cm));
+ pi = (struct in6_pktinfo *)(void *)(CMSG_DATA(cm));
ifindex = pi->ipi6_ifindex;
}
if (cm->cmsg_level == IPPROTO_IPV6 &&
cm->cmsg_type == IPV6_HOPLIMIT &&
cm->cmsg_len == CMSG_LEN(sizeof(int)))
- hlimp = (int *)CMSG_DATA(cm);
+ hlimp = (int *)(void *)CMSG_DATA(cm);
}
if (ifindex == 0) {
@@ -417,7 +417,7 @@ rtsol_input(int s)
break;
}
- addr = (struct in6_addr *)(raoptp + sizeof(*rdnss));
+ addr = (struct in6_addr *)(void *)(raoptp + sizeof(*rdnss));
while ((char *)addr < (char *)RA_OPT_NEXT_HDR(raoptp)) {
if (inet_ntop(AF_INET6, addr, ntopbuf,
sizeof(ntopbuf)) == NULL) {
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index e62e9ff..a97b884 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -67,7 +67,6 @@
#define RTSOL_DUMPFILE "/var/run/rtsold.dump";
#define RTSOL_PIDFILE "/var/run/rtsold.pid";
-struct ifinfo *iflist;
struct timespec tm_max;
static int log_upto = 999;
static int fflag = 0;
diff --git a/usr.sbin/rtsold/rtsold.h b/usr.sbin/rtsold/rtsold.h
index 69f9c35..56b4185 100644
--- a/usr.sbin/rtsold/rtsold.h
+++ b/usr.sbin/rtsold/rtsold.h
@@ -176,6 +176,7 @@ extern int getinet6sysctl(int);
extern int setinet6sysctl(int, int);
/* rtsol.c */
+extern int rssock;
extern int sockopen(void);
extern void sendpacket(struct ifinfo *);
extern void rtsol_input(int);
OpenPOWER on IntegriCloud