Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net/agr Use if_flags_set() and if_addr_init() instead of...
details: https://anonhg.NetBSD.org/src/rev/7ba5f6b3dfab
branches: trunk
changeset: 770500:7ba5f6b3dfab
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Oct 19 01:49:50 2011 +0000
description:
Use if_flags_set() and if_addr_init() instead of ifp->if_ioctl().
diffstat:
sys/net/agr/if_agr.c | 19 +++++++------------
sys/net/agr/if_agrether.c | 13 +++++--------
2 files changed, 12 insertions(+), 20 deletions(-)
diffs (111 lines):
diff -r 4b4657b5635f -r 7ba5f6b3dfab sys/net/agr/if_agr.c
--- a/sys/net/agr/if_agr.c Wed Oct 19 01:48:30 2011 +0000
+++ b/sys/net/agr/if_agr.c Wed Oct 19 01:49:50 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_agr.c,v 1.29 2010/08/11 11:47:29 pgoyette Exp $ */
+/* $NetBSD: if_agr.c,v 1.30 2011/10/19 01:49:50 dyoung Exp $ */
/*-
* Copyright (c)2005 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.29 2010/08/11 11:47:29 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.30 2011/10/19 01:49:50 dyoung Exp $");
#include "opt_inet.h"
@@ -235,7 +235,6 @@
{
struct ifnet *ifp = port->port_ifp;
struct ethercom *ec_port = (void *)ifp;
- struct ifreq ifr;
int error=0;
if (ec_port->ec_nvlans++ == 0 &&
@@ -246,9 +245,7 @@
*/
ec_port->ec_capenable |= ETHERCAP_VLAN_MTU;
if (p->if_flags & IFF_UP) {
- ifr.ifr_flags = p->if_flags;
- error = (*p->if_ioctl)(p, SIOCSIFFLAGS,
- (void *) &ifr);
+ error = if_flags_set(p, p->if_flags);
if (error) {
if (ec_port->ec_nvlans-- == 1)
ec_port->ec_capenable &=
@@ -268,7 +265,6 @@
agr_vlan_del(struct agr_port *port, void *arg)
{
struct ethercom *ec_port = (void *)port->port_ifp;
- struct ifreq ifr;
/* Disable vlan support */
if (ec_port->ec_nvlans-- == 1) {
@@ -277,9 +273,8 @@
*/
ec_port->ec_capenable &= ~ETHERCAP_VLAN_MTU;
if (port->port_ifp->if_flags & IFF_UP) {
- ifr.ifr_flags = port->port_ifp->if_flags;
- (void) (*port->port_ifp->if_ioctl)(port->port_ifp,
- SIOCSIFFLAGS, (void *) &ifr);
+ (void)if_flags_set(port->port_ifp,
+ port->port_ifp->if_flags);
}
}
@@ -641,10 +636,10 @@
* of each port to that of the first port. No need for arps
* since there are no inet addresses assigned to the ports.
*/
- error = (*ifp_port->if_ioctl)(ifp_port, SIOCINITIFADDR, ifp->if_dl);
+ error = if_addr_init(ifp_port, ifp->if_dl, true);
if (error) {
- printf("%s: SIOCINITIFADDR error %d\n", __func__, error);
+ printf("%s: if_addr_init error %d\n", __func__, error);
goto cleanup;
}
port->port_flags |= AGRPORT_LADDRCHANGED;
diff -r 4b4657b5635f -r 7ba5f6b3dfab sys/net/agr/if_agrether.c
--- a/sys/net/agr/if_agrether.c Wed Oct 19 01:48:30 2011 +0000
+++ b/sys/net/agr/if_agrether.c Wed Oct 19 01:49:50 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_agrether.c,v 1.8 2009/06/09 22:26:49 yamt Exp $ */
+/* $NetBSD: if_agrether.c,v 1.9 2011/10/19 01:49:50 dyoung Exp $ */
/*-
* Copyright (c)2005 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_agrether.c,v 1.8 2009/06/09 22:26:49 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_agrether.c,v 1.9 2011/10/19 01:49:50 dyoung Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -175,9 +175,7 @@
*/
ec_port->ec_capenable |= ETHERCAP_VLAN_MTU;
if (p->if_flags & IFF_UP) {
- ifr.ifr_flags = p->if_flags;
- error = (*p->if_ioctl)(p, SIOCSIFFLAGS,
- (void *) &ifr);
+ error = if_flags_set(p, p->if_flags);
if (error) {
if (ec_port->ec_nvlans-- == 1)
ec_port->ec_capenable &=
@@ -234,9 +232,8 @@
*/
ec_port->ec_capenable &= ~ETHERCAP_VLAN_MTU;
if (port->port_ifp->if_flags & IFF_UP) {
- ifr.ifr_flags = port->port_ifp->if_flags;
- (void) (*port->port_ifp->if_ioctl)(port->port_ifp,
- SIOCSIFFLAGS, (void *) &ifr);
+ (void)if_flags_set(port->port_ifp,
+ port->port_ifp->if_flags);
}
}
Home |
Main Index |
Thread Index |
Old Index