summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-11-03 01:59:32 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-11-03 01:59:32 +0000
commit0456df64819f7d86e86fef6766fcb54a96338719 (patch)
tree0a9b7c609a563e02ee7b0d27a5354d4445bc6204
parentba7b89ef08bec24c730a8ef5fc5f9f59ce889abc (diff)
While this identical idiom caused problems when building an ifaliasreq
to *add* an address, here (building an ifaliasreq to delete an address) it worked fine. But change it to the bcopy() dance that works in the adding case just to be consistant until a sparc64/gcc guru is cornered in a bar with a full keg of guiness.
-rw-r--r--sbin/dhclient/kroute.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c
index 07625c8eaeb..732622449b8 100644
--- a/sbin/dhclient/kroute.c
+++ b/sbin/dhclient/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.4 2012/11/02 20:21:32 krw Exp $ */
+/* $OpenBSD: kroute.c,v 1.5 2012/11/03 01:59:31 krw Exp $ */
/*
* Copyright 2012 Kenneth R Westerback <krw@openbsd.org>
@@ -420,6 +420,7 @@ priv_delete_old_address(char *ifname, int rdomain, struct iaddr addr)
struct rt_msghdr rtm;
struct sockaddr_in dest, gateway;
struct iovec iov[3];
+ in_addr_t bozo;
struct sockaddr_in *in;
int s, iovcnt = 0;
@@ -437,7 +438,8 @@ priv_delete_old_address(char *ifname, int rdomain, struct iaddr addr)
in->sin_family = AF_INET;
in->sin_len = sizeof(ifaliasreq.ifra_addr);
- in->sin_addr.s_addr = inet_addr(piaddr(addr));
+ bozo = inet_addr(piaddr(addr));
+ bcopy(&bozo, &in->sin_addr.s_addr, sizeof(bozo));
/* SIOCDIFADDR will result in a RTM_DELADDR message we must catch! */
if (ioctl(s, SIOCDIFADDR, &ifaliasreq) == -1) {