aboutsummaryrefslogtreecommitdiff
path: root/contrib/bsnmp
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2009-02-18 19:59:27 +0000
committerWarner Losh <imp@FreeBSD.org>2009-02-18 19:59:27 +0000
commit26ea346865df84a5f36598066028a4d9d392467f (patch)
tree4eb8fb026d197346124849ab87ceb37435eb9f78 /contrib/bsnmp
parent217dc6b01cac4dbc2424c542f260581c3fae273d (diff)
downloadsrc-26ea346865df84a5f36598066028a4d9d392467f.tar.gz
src-26ea346865df84a5f36598066028a4d9d392467f.zip
Add an extra (void *) cast. The struct if_msghdr has an 8 byte
alignment requirement, while rt_msghdr has a 4 byte alignment requirement. The root cause is that if_msghdr has an struct if_data which has an 8-byte alignment requirement due to a time_t that's embedded in it. On MIPS, time_t is a 64-bit number, so must be 64-bit aligned. Since we don't access ifm_data.ifi_epoch, a simple cast is all that's necessary here. It is likely the case that ifi_epoch should *NOT* be a time_t because it is an uptime (time delta) an not an absolute time since 1970. u_long is likely sufficient there since that gives an uptime of 136 years will suffice for the foreseeable future.
Notes
Notes: svn path=/head/; revision=188760
Diffstat (limited to 'contrib/bsnmp')
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/bsnmp/snmp_mibII/mibII.c b/contrib/bsnmp/snmp_mibII/mibII.c
index 83e2317665b3..cd4caacdd5eb 100644
--- a/contrib/bsnmp/snmp_mibII/mibII.c
+++ b/contrib/bsnmp/snmp_mibII/mibII.c
@@ -1013,7 +1013,7 @@ handle_rtmsg(struct rt_msghdr *rtm)
break;
case RTM_IFINFO:
- ifm = (struct if_msghdr *)rtm;
+ ifm = (struct if_msghdr *)(void *)rtm;
mib_extract_addrs(ifm->ifm_addrs, (u_char *)(ifm + 1), addrs);
if ((ifp = mib_find_if_sys(ifm->ifm_index)) == NULL)
break;