Module Name: src
Committed By: matt
Date: Fri Oct 5 04:26:06 UTC 2012
Modified Files:
src/sys/net: if_ethersubr.c
Log Message:
When setting a link address, don't bring up the interface automatically.
To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/net/if_ethersubr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.190 src/sys/net/if_ethersubr.c:1.191
--- src/sys/net/if_ethersubr.c:1.190 Tue Jul 17 18:08:20 2012
+++ src/sys/net/if_ethersubr.c Fri Oct 5 04:26:06 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ethersubr.c,v 1.190 2012/07/17 18:08:20 christos Exp $ */
+/* $NetBSD: if_ethersubr.c,v 1.191 2012/10/05 04:26:06 matt Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.190 2012/07/17 18:08:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.191 2012/10/05 04:26:06 matt Exp $");
#include "opt_inet.h"
#include "opt_atalk.h"
@@ -1502,21 +1502,21 @@ ether_ioctl(struct ifnet *ifp, u_long cm
switch (cmd) {
case SIOCINITIFADDR:
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) !=
- (IFF_UP|IFF_RUNNING)) {
+ {
+ struct ifaddr *ifa = (struct ifaddr *)data;
+ if (ifa->ifa_addr->sa_family != AF_LINK
+ && (ifp->if_flags & (IFF_UP|IFF_RUNNING)) !=
+ (IFF_UP|IFF_RUNNING)) {
ifp->if_flags |= IFF_UP;
if ((error = (*ifp->if_init)(ifp)) != 0)
return error;
}
#ifdef INET
- {
- struct ifaddr *ifa = (struct ifaddr *)data;
-
- if (ifa->ifa_addr->sa_family == AF_INET)
- arp_ifinit(ifp, ifa);
- }
+ if (ifa->ifa_addr->sa_family == AF_INET)
+ arp_ifinit(ifp, ifa);
#endif /* INET */
return 0;
+ }
case SIOCSIFMTU:
{