summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2007-05-31 01:04:57 +0000
committerhenning <henning@openbsd.org>2007-05-31 01:04:57 +0000
commit826322a363ca5ac807f9bba573231f96acc2cc90 (patch)
tree7b708c8e0e06f7af2dd533813a42c3bd6a70adcb
parent1000 != 0x1000 (4096) (diff)
downloadwireguard-openbsd-826322a363ca5ac807f9bba573231f96acc2cc90.tar.xz
wireguard-openbsd-826322a363ca5ac807f9bba573231f96acc2cc90.zip
only call em_init() when IFF_UP is set, not unconditional.
prevents another round of autonegotiation (and thus, few seconds outage) with every address change that had to be reintroduced a few revs ago because of the watchdog timeout problems people were seeing. this gives the benifit from both with the problems of neither ;) tested by daniel polak on a system that saw the watchdog timeouts before ok theo
-rw-r--r--sys/dev/pci/if_em.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 37b7753e372..21889c0f8eb 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.171 2007/05/31 00:47:53 ckuethe Exp $ */
+/* $OpenBSD: if_em.c,v 1.172 2007/05/31 01:04:57 henning Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -503,8 +503,10 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
case SIOCSIFADDR:
IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFADDR (Set Interface "
"Addr)");
- ifp->if_flags |= IFF_UP;
- em_init(sc);
+ if (!(ifp->if_flags & IFF_UP)) {
+ ifp->if_flags |= IFF_UP;
+ em_init(sc);
+ }
#ifdef INET
if (ifa->ifa_addr->sa_family == AF_INET)
arp_ifinit(&sc->interface_data, ifa);