diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-02-12 00:08:15 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-02-12 00:08:15 +0000 |
commit | a491308f0b3f70183deb54e8ae690a4a55fb8562 (patch) | |
tree | 018ab94d9c522456f629b85e25c8bcf216254017 /usr.sbin | |
parent | 60ed5c7eee7b8a43d660774b91825241ab198757 (diff) |
we need to memcpy out the ifmsghdr, it has different alignent requirements
then the char buffer and sparc64 hates unaligned shitz, ryan hshoexer ok
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ifstated/ifstated.c | 12 |
1 files 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 <mpf@openbsd.org> @@ -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); } |