diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-03-26 13:19:27 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-03-26 13:19:27 +0000 |
commit | cb517b0a9901ec325abd58be7956c791fca9ca9d (patch) | |
tree | 49353f01ea14a290f95ef54de80b6705bb794455 | |
parent | 3394e2b40fdfaf47946051fdcc269dec29ff9a82 (diff) |
Remove various read-only *maxlen variables and use IFQ_MAXLEN directly.
ok beck@, mikeb@
-rw-r--r-- | sys/net/if.c | 6 | ||||
-rw-r--r-- | sys/net/if.h | 3 | ||||
-rw-r--r-- | sys/net/if_bridge.c | 4 | ||||
-rw-r--r-- | sys/net/if_gif.c | 4 | ||||
-rw-r--r-- | sys/net/if_mpe.c | 4 | ||||
-rw-r--r-- | sys/net/if_pflog.c | 4 | ||||
-rw-r--r-- | sys/net/if_pflow.c | 4 | ||||
-rw-r--r-- | sys/net/if_pfsync.c | 4 | ||||
-rw-r--r-- | sys/net/if_ppp.c | 10 | ||||
-rw-r--r-- | sys/net/if_tun.c | 4 | ||||
-rw-r--r-- | sys/net/if_vether.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_carp.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 5 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 5 | ||||
-rw-r--r-- | sys/netmpls/mpls.h | 3 | ||||
-rw-r--r-- | sys/netmpls/mpls_input.c | 5 |
16 files changed, 33 insertions, 40 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 6d6f5cc70fb..19ea4bfb961 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.252 2013/03/20 10:34:12 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.253 2013/03/26 13:19:25 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -137,8 +137,6 @@ void if_attachsetup(struct ifnet *); void if_attachdomain1(struct ifnet *); void if_attach_common(struct ifnet *); -int ifqmaxlen = IFQ_MAXLEN; - void if_detach_queues(struct ifnet *, struct ifqueue *); void if_detached_start(struct ifnet *); int if_detached_ioctl(struct ifnet *, u_long, caddr_t); @@ -280,7 +278,7 @@ if_attachsetup(struct ifnet *ifp) ifindex2ifnet[if_index] = ifp; if (ifp->if_snd.ifq_maxlen == 0) - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); #ifdef ALTQ ifp->if_snd.altq_type = 0; ifp->if_snd.altq_disc = NULL; diff --git a/sys/net/if.h b/sys/net/if.h index f496059d9d9..a6302312bf4 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.140 2013/03/20 10:34:12 mpi Exp $ */ +/* $OpenBSD: if.h,v 1.141 2013/03/26 13:19:25 mpi Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -796,7 +796,6 @@ do { \ #define IF_WIRED_DEFAULT_PRIORITY 0 #define IF_WIRELESS_DEFAULT_PRIORITY 4 -extern int ifqmaxlen; extern struct ifnet_head ifnet; extern struct ifnet *lo0ifp; diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index decc0ed545b..04751e17f38 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.206 2013/03/15 20:45:34 tedu Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.207 2013/03/26 13:19:25 mpi Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -219,7 +219,7 @@ bridge_clone_create(struct if_clone *ifc, int unit) ifp->if_start = bridge_start; ifp->if_type = IFT_BRIDGE; ifp->if_hdrlen = ETHER_HDR_LEN; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); IFQ_SET_READY(&ifp->if_snd); if_attach(ifp); diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 709cadb0a89..36f33a2c462 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gif.c,v 1.59 2013/01/17 00:48:04 henning Exp $ */ +/* $OpenBSD: if_gif.c,v 1.60 2013/03/26 13:19:25 mpi Exp $ */ /* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */ /* @@ -105,7 +105,7 @@ gif_clone_create(struct if_clone *ifc, int unit) sc->gif_if.if_start = gif_start; sc->gif_if.if_output = gif_output; sc->gif_if.if_type = IFT_GIF; - IFQ_SET_MAXLEN(&sc->gif_if.if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&sc->gif_if.if_snd, IFQ_MAXLEN); IFQ_SET_READY(&sc->gif_if.if_snd); sc->gif_if.if_softc = sc; if_attach(&sc->gif_if); diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index 8018fb93f3e..fd8bdb5c334 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.27 2012/04/14 09:39:47 yasuoka Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.28 2013/03/26 13:19:25 mpi Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -105,7 +105,7 @@ mpe_clone_create(struct if_clone *ifc, int unit) ifp->if_start = mpestart; ifp->if_type = IFT_MPLS; ifp->if_hdrlen = MPE_HDRLEN; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); IFQ_SET_READY(&ifp->if_snd); if_attach(ifp); if_alloc_sadl(ifp); diff --git a/sys/net/if_pflog.c b/sys/net/if_pflog.c index 41832bb6463..5070fa5c4e6 100644 --- a/sys/net/if_pflog.c +++ b/sys/net/if_pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflog.c,v 1.52 2012/11/06 12:32:41 henning Exp $ */ +/* $OpenBSD: if_pflog.c,v 1.53 2013/03/26 13:19:25 mpi Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -156,7 +156,7 @@ pflog_clone_create(struct if_clone *ifc, int unit) ifp->if_output = pflogoutput; ifp->if_start = pflogstart; ifp->if_type = IFT_PFLOG; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); ifp->if_hdrlen = PFLOG_HDRLEN; if_attach(ifp); if_alloc_sadl(ifp); diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c index cf137f4ce4a..ef70b10bc87 100644 --- a/sys/net/if_pflow.c +++ b/sys/net/if_pflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflow.c,v 1.24 2013/02/05 11:58:39 florian Exp $ */ +/* $OpenBSD: if_pflow.c,v 1.25 2013/03/26 13:19:25 mpi Exp $ */ /* * Copyright (c) 2011 Florian Obser <florian@narrans.de> @@ -231,7 +231,7 @@ pflow_clone_create(struct if_clone *ifc, int unit) ifp->if_output = pflowoutput; ifp->if_start = pflowstart; ifp->if_type = IFT_PFLOW; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); ifp->if_hdrlen = PFLOW_HDRLEN; ifp->if_flags = IFF_UP; ifp->if_flags &= ~IFF_RUNNING; /* not running, need receiver */ diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index c9ae79f4f49..ded05e0602c 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.195 2012/10/30 12:09:05 florian Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.196 2013/03/26 13:19:26 mpi Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -326,7 +326,7 @@ pfsync_clone_create(struct if_clone *ifc, int unit) ifp->if_output = pfsyncoutput; ifp->if_start = pfsyncstart; ifp->if_type = IFT_PFSYNC; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); ifp->if_hdrlen = sizeof(struct pfsync_header); ifp->if_mtu = ETHERMTU; timeout_set(&sc->sc_tmo, pfsync_timeout, sc); diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 2e3a5a7329c..a6200c136cf 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ppp.c,v 1.67 2012/11/29 22:56:08 yasuoka Exp $ */ +/* $OpenBSD: if_ppp.c,v 1.68 2013/03/26 13:19:26 mpi Exp $ */ /* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */ /* @@ -244,10 +244,10 @@ ppp_clone_create(struct if_clone *ifc, int unit) sc->sc_if.if_ioctl = pppsioctl; sc->sc_if.if_output = pppoutput; sc->sc_if.if_start = ppp_ifstart; - IFQ_SET_MAXLEN(&sc->sc_if.if_snd, ifqmaxlen); - IFQ_SET_MAXLEN(&sc->sc_inq, ifqmaxlen); - IFQ_SET_MAXLEN(&sc->sc_fastq, ifqmaxlen); - IFQ_SET_MAXLEN(&sc->sc_rawq, ifqmaxlen); + IFQ_SET_MAXLEN(&sc->sc_if.if_snd, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&sc->sc_inq, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&sc->sc_fastq, IFQ_MAXLEN); + IFQ_SET_MAXLEN(&sc->sc_rawq, IFQ_MAXLEN); IFQ_SET_READY(&sc->sc_if.if_snd); if_attach(&sc->sc_if); if_alloc_sadl(&sc->sc_if); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 63a4df98f9c..55d2e07f9ca 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.112 2011/07/09 00:47:18 henning Exp $ */ +/* $OpenBSD: if_tun.c,v 1.113 2013/03/26 13:19:26 mpi Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -186,7 +186,7 @@ tun_create(struct if_clone *ifc, int unit, int flags) ifp->if_start = tunstart; ifp->if_hardmtu = TUNMRU; ifp->if_link_state = LINK_STATE_DOWN; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); IFQ_SET_READY(&ifp->if_snd); if ((flags & TUN_LAYER2) == 0) { diff --git a/sys/net/if_vether.c b/sys/net/if_vether.c index 0442b76b64e..4c7604c9f9a 100644 --- a/sys/net/if_vether.c +++ b/sys/net/if_vether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vether.c,v 1.16 2011/07/22 15:59:40 deraadt Exp $ */ +/* $OpenBSD: if_vether.c,v 1.17 2013/03/26 13:19:26 mpi Exp $ */ /* * Copyright (c) 2009 Theo de Raadt @@ -86,7 +86,7 @@ vether_clone_create(struct if_clone *ifc, int unit) ifp->if_softc = sc; ifp->if_ioctl = vetherioctl; ifp->if_start = vetherstart; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); IFQ_SET_READY(&ifp->if_snd); ifp->if_capabilities = IFCAP_VLAN_MTU; diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 35cce892b9e..ebd27775b2c 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.200 2013/03/25 14:40:56 mpi Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.201 2013/03/26 13:19:26 mpi Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -894,7 +894,7 @@ carp_clone_create(ifc, unit) ifp->if_addrlen = ETHER_ADDR_LEN; ifp->if_hdrlen = ETHER_HDR_LEN; ifp->if_mtu = ETHERMTU; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); IFQ_SET_READY(&ifp->if_snd); if_attach(ifp); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index f31d70a15cd..e55f1f2d14c 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.201 2013/03/22 01:41:12 tedu Exp $ */ +/* $OpenBSD: ip_input.c,v 1.202 2013/03/26 13:19:26 mpi Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -135,7 +135,6 @@ int *ipctl_vars[IPCTL_MAXID] = IPCTL_VARS; extern struct domain inetdomain; extern struct protosw inetsw[]; u_char ip_protox[IPPROTO_MAX]; -int ipqmaxlen = IFQ_MAXLEN; struct in_ifaddrhead in_ifaddr; struct ifqueue ipintrq; @@ -206,7 +205,7 @@ ip_init(void) pr->pr_protocol < IPPROTO_MAX) ip_protox[pr->pr_protocol] = pr - inetsw; LIST_INIT(&ipq); - IFQ_SET_MAXLEN(&ipintrq, ipqmaxlen); + IFQ_SET_MAXLEN(&ipintrq, IFQ_MAXLEN); TAILQ_INIT(&in_ifaddr); if (ip_mtudisc != 0) ip_mtudisc_timeout_q = diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index aa18db46f59..27a92bf94d3 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.108 2013/03/25 14:40:57 mpi Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.109 2013/03/26 13:19:26 mpi Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -121,7 +121,6 @@ extern struct domain inet6domain; extern struct ip6protosw inet6sw[]; u_char ip6_protox[IPPROTO_MAX]; -static int ip6qmaxlen = IFQ_MAXLEN; struct in6_ifaddrhead in6_ifaddr; struct ifqueue ip6intrq; @@ -154,7 +153,7 @@ ip6_init(void) pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW && pr->pr_protocol < IPPROTO_MAX) ip6_protox[pr->pr_protocol] = pr - inet6sw; - IFQ_SET_MAXLEN(&ip6intrq, ip6qmaxlen); + IFQ_SET_MAXLEN(&ip6intrq, IFQ_MAXLEN); TAILQ_INIT(&in6_ifaddr); ip6_randomid_init(); nd6_init(); diff --git a/sys/netmpls/mpls.h b/sys/netmpls/mpls.h index 64122e8679d..666ed0fdb32 100644 --- a/sys/netmpls/mpls.h +++ b/sys/netmpls/mpls.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls.h,v 1.25 2010/09/08 08:00:56 claudio Exp $ */ +/* $OpenBSD: mpls.h,v 1.26 2013/03/26 13:19:26 mpi Exp $ */ /* * Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project. @@ -166,7 +166,6 @@ extern int mpls_raw_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *); extern struct ifqueue mplsintrq; /* MPLS input queue */ -extern int mplsqmaxlen; /* MPLS input queue length */ extern int mpls_defttl; extern int mpls_mapttl_ip; extern int mpls_mapttl_ip6; diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c index a08abbb2a1a..de1a2242278 100644 --- a/sys/netmpls/mpls_input.c +++ b/sys/netmpls/mpls_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls_input.c,v 1.32 2011/07/06 02:42:28 henning Exp $ */ +/* $OpenBSD: mpls_input.c,v 1.33 2013/03/26 13:19:26 mpi Exp $ */ /* * Copyright (c) 2008 Claudio Jeker <claudio@openbsd.org> @@ -47,7 +47,6 @@ #include <netmpls/mpls.h> struct ifqueue mplsintrq; -int mplsqmaxlen = IFQ_MAXLEN; extern int mpls_inkloop; #ifdef MPLS_DEBUG @@ -65,7 +64,7 @@ struct mbuf *mpls_do_error(struct mbuf *, int, int, int); void mpls_init(void) { - IFQ_SET_MAXLEN(&mplsintrq, mplsqmaxlen); + IFQ_SET_MAXLEN(&mplsintrq, IFQ_MAXLEN); } void |