diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2009-06-03 20:35:38 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2009-06-03 20:35:38 +0000 |
commit | 6471d8d5406f69e0f7c4f7922e4fce768c184562 (patch) | |
tree | 418a08a90c49ebeb7f84f4151f4b0ef9b49ec5b9 | |
parent | 76e75159d25ac0cfa6fff1317a7a6108bff7bebe (diff) |
make wireless interfaces priority 4 by default. other interfaces remain
priority 0. while we are in here make sure we add wi interfaces to group "wlan"
in the same way the net80211 stuff already is.
this makes dhcp multiple default routes useful on laptops.
ok claudio@
-rw-r--r-- | sys/dev/ic/if_wi.c | 7 | ||||
-rw-r--r-- | sys/net/if.h | 6 | ||||
-rw-r--r-- | sys/net80211/ieee80211.c | 3 |
3 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index 24e2f5f2b2b..ea18da0516e 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.143 2008/11/28 02:44:17 brad Exp $ */ +/* $OpenBSD: if_wi.c,v 1.144 2009/06/03 20:35:37 beck Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -126,7 +126,7 @@ u_int32_t widebug = WIDEBUG; #if !defined(lint) && !defined(__OpenBSD__) static const char rcsid[] = - "$OpenBSD: if_wi.c,v 1.143 2008/11/28 02:44:17 brad Exp $"; + "$OpenBSD: if_wi.c,v 1.144 2009/06/03 20:35:37 beck Exp $"; #endif /* lint */ #ifdef foo @@ -448,6 +448,9 @@ wi_attach(struct wi_softc *sc, struct wi_funcs *funcs) sc->sc_sdhook = shutdownhook_establish(wi_shutdown, sc); + if_addgroup(ifp, "wlan"); + ifp->if_priority = IF_WIRELESS_DEFAULT_PRIORITY; + wi_init(sc); wi_stop(sc); diff --git a/sys/net/if.h b/sys/net/if.h index 18e3fd153c8..c033499060b 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.103 2009/01/27 09:17:51 dlg Exp $ */ +/* $OpenBSD: if.h,v 1.104 2009/06/03 20:35:37 beck Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -757,6 +757,10 @@ do { \ #define IFQ_INC_DROPS(ifq) ((ifq)->ifq_drops++) #define IFQ_SET_MAXLEN(ifq, len) ((ifq)->ifq_maxlen = (len)) +/* default interface priorities */ +#define IF_WIRED_DEFAULT_PRIORITY 0 +#define IF_WIRELESS_DEFAULT_PRIORITY 4 + extern int ifqmaxlen; extern struct ifnet_head ifnet; extern struct ifnet **ifindex2ifnet; diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 40985239dad..2682c92ddc8 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211.c,v 1.35 2008/08/29 12:14:53 damien Exp $ */ +/* $OpenBSD: ieee80211.c,v 1.36 2009/06/03 20:35:37 beck Exp $ */ /* $NetBSD: ieee80211.c,v 1.19 2004/06/06 05:45:29 dyoung Exp $ */ /*- @@ -152,6 +152,7 @@ ieee80211_ifattach(struct ifnet *ifp) ieee80211_proto_attach(ifp); if_addgroup(ifp, "wlan"); + ifp->if_priority = IF_WIRELESS_DEFAULT_PRIORITY; } void |