From a491308f0b3f70183deb54e8ae690a4a55fb8562 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Thu, 12 Feb 2004 00:08:15 +0000 Subject: we need to memcpy out the ifmsghdr, it has different alignent requirements then the char buffer and sparc64 hates unaligned shitz, ryan hshoexer ok --- usr.sbin/ifstated/ifstated.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c index a0bfdd2be99..f10bbff8e46 100644 --- a/usr.sbin/ifstated/ifstated.c +++ b/usr.sbin/ifstated/ifstated.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifstated.c,v 1.4 2004/02/12 00:04:08 henning Exp $ */ +/* $OpenBSD: ifstated.c,v 1.5 2004/02/12 00:08:14 henning Exp $ */ /* * Copyright (c) 2004 Marco Pfatschbacher @@ -200,7 +200,7 @@ load_config(void) void rt_msg_handler(int fd, short event, void *arg) { - struct if_msghdr *ifm; + struct if_msghdr ifm; char msg[2048]; struct rt_msghdr *rtm = (struct rt_msghdr *)&msg; int len; @@ -217,13 +217,13 @@ rt_msg_handler(int fd, short event, void *arg) if (rtm->rtm_type != RTM_IFINFO) return; - ifm = (struct if_msghdr *)rtm; + memcpy(&ifm, rtm, sizeof(ifm)); - if (scan_ifstate(ifm->ifm_index, ifm->ifm_data.ifi_link_state, + if (scan_ifstate(ifm.ifm_index, ifm.ifm_data.ifi_link_state, &conf.always)) eval_state(&conf.always); - if ((conf.curstate != NULL) && scan_ifstate(ifm->ifm_index, - ifm->ifm_data.ifi_link_state, conf.curstate)) + if ((conf.curstate != NULL) && scan_ifstate(ifm.ifm_index, + ifm.ifm_data.ifi_link_state, conf.curstate)) eval_state(conf.curstate); } -- cgit v1.2.3