diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 2 | ||||
-rw-r--r-- | sys/netgraph/ng_base.c | 2 | ||||
-rw-r--r-- | sys/netinet/ip_fw2.c | 10 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 3 | ||||
-rw-r--r-- | sys/netinet/ip_mroute.c | 2 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 8 | ||||
-rw-r--r-- | sys/netinet/tcp_hostcache.c | 17 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 17 | ||||
-rw-r--r-- | sys/netinet/tcp_syncache.c | 6 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 3 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 1 | ||||
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 5 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 1 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 9 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 3 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 6 | ||||
-rw-r--r-- | sys/vm/vm_meter.c | 1 |
18 files changed, 58 insertions, 44 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index a3ef17d..cfb16aa 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -176,7 +176,7 @@ ifnet_byindex(u_short idx) return (ifp); } -static void +void ifnet_setbyindex(u_short idx, struct ifnet *ifp) { diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 487fd25..b41d57d 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -646,7 +646,7 @@ ng_make_node_common(struct ng_type *type, node_p *nodepp) mtx_lock(&ng_idhash_mtx); for (;;) { /* wrap protection, even if silly */ node_p node2 = NULL; - node->nd_ID = V_nextID++; /* 137/second for 1 year before wrap */ + node->nd_ID = V_nextID++; /* 137/sec for 1 year before wrap */ /* Is there a problem with the new number? */ NG_IDHASH_FIND(node->nd_ID, node2); /* already taken? */ diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 7cfe653..f58899a 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -4090,11 +4090,12 @@ ipfw_getrules(struct ip_fw_chain *chain, void *buf, size_t space) if (bp + i <= ep) { bcopy(rule, bp, i); /* - * XXX HACK. Store the disable mask in the "next" pointer - * in a wild attempt to keep the ABI the same. + * XXX HACK. Store the disable mask in the "next" + * pointer in a wild attempt to keep the ABI the same. * Why do we do this on EVERY rule? */ - bcopy(&V_set_disable, &(((struct ip_fw *)bp)->next_rule), + bcopy(&V_set_disable, + &(((struct ip_fw *)bp)->next_rule), sizeof(V_set_disable)); if (((struct ip_fw *)bp)->timestamp) ((struct ip_fw *)bp)->timestamp += boot_seconds; @@ -4483,7 +4484,8 @@ ipfw_tick(void * __unused unused) ip_output(m, NULL, NULL, 0, NULL, NULL); } done: - callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period*hz, ipfw_tick, NULL); + callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period * hz, + ipfw_tick, NULL); } int diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 4ab975e6..7230408 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -798,7 +798,8 @@ ip_reass(struct mbuf *m) for (i = 0; i < IPREASS_NHASH; i++) { struct ipq *r = TAILQ_LAST(&V_ipq[i], ipqhead); if (r) { - V_ipstat.ips_fragtimeout += r->ipq_nfrags; + V_ipstat.ips_fragtimeout += + r->ipq_nfrags; ip_freef(&V_ipq[i], r); break; } diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 0476a36..730f0af 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1891,7 +1891,7 @@ X_rsvp_input(struct mbuf *m, int off) struct ifnet *ifp; if (rsvpdebug) - printf("rsvp_input: rsvp_on %d\n",V_rsvp_on); + printf("rsvp_input: rsvp_on %d\n", V_rsvp_on); /* Can still get packets with rsvp_on = 0 if there is a local member * of the group to which the RSVP packet is addressed. But in this diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 7ea0113..9e70ceb 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -178,10 +178,10 @@ rip_init(void) INP_INFO_LOCK_INIT(&V_ripcbinfo, "rip"); LIST_INIT(&V_ripcb); V_ripcbinfo.ipi_listhead = &V_ripcb; - V_ripcbinfo.ipi_hashbase = hashinit(INP_PCBHASH_RAW_SIZE, M_PCB, - &V_ripcbinfo.ipi_hashmask); - V_ripcbinfo.ipi_porthashbase = hashinit(1, M_PCB, - &V_ripcbinfo.ipi_porthashmask); + V_ripcbinfo.ipi_hashbase = + hashinit(INP_PCBHASH_RAW_SIZE, M_PCB, &V_ripcbinfo.ipi_hashmask); + V_ripcbinfo.ipi_porthashbase = + hashinit(1, M_PCB, &V_ripcbinfo.ipi_porthashmask); V_ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb), NULL, NULL, rip_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(V_ripcbinfo.ipi_zone, maxsockets); diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index bf8f616..3a7e9e1 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -248,15 +248,17 @@ tcp_hc_init(void) /* * Allocate the hostcache entries. */ - V_tcp_hostcache.zone = uma_zcreate("hostcache", sizeof(struct hc_metrics), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + V_tcp_hostcache.zone = + uma_zcreate("hostcache", sizeof(struct hc_metrics), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); uma_zone_set_max(V_tcp_hostcache.zone, V_tcp_hostcache.cache_limit); /* * Set up periodic cache cleanup. */ callout_init(&V_tcp_hc_callout, CALLOUT_MPSAFE); - callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, tcp_hc_purge, 0); + callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, + tcp_hc_purge, 0); } /* @@ -667,8 +669,9 @@ tcp_hc_purge(void *arg) for (i = 0; i < V_tcp_hostcache.hashsize; i++) { THC_LOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); - TAILQ_FOREACH_SAFE(hc_entry, &V_tcp_hostcache.hashbase[i].hch_bucket, - rmx_q, hc_next) { + TAILQ_FOREACH_SAFE(hc_entry, + &V_tcp_hostcache.hashbase[i].hch_bucket, + rmx_q, hc_next) { if (all || hc_entry->rmx_expire <= 0) { TAILQ_REMOVE(&V_tcp_hostcache.hashbase[i].hch_bucket, hc_entry, rmx_q); @@ -680,5 +683,7 @@ tcp_hc_purge(void *arg) } THC_UNLOCK(&V_tcp_hostcache.hashbase[i].hch_mtx); } - callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, tcp_hc_purge, 0); + + callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz, + tcp_hc_purge, arg); } diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index fae2ba6..f8ae94e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -212,7 +212,6 @@ do { \ (tp->t_flags & TF_RXWIN0SENT) == 0) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) - /* * TCP input handling is split into multiple parts: * tcp6_input is a thin wrapper around tcp_input for the extended @@ -654,8 +653,9 @@ findpcb: log(LOG_DEBUG, "%s; %s: Listen socket: " "Socket allocation failed due to " "limits or memory shortage, %s\n", - s, __func__, (V_tcp_sc_rst_sock_fail ? - "sending RST" : "try again")); + s, __func__, + V_tcp_sc_rst_sock_fail ? + "sending RST" : "try again"); if (V_tcp_sc_rst_sock_fail) { rstreason = BANDLIM_UNLIMITED; goto dropwithreset; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 659626c..5f98078 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -941,8 +941,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) return (ENOMEM); INP_INFO_RLOCK(&V_tcbinfo); - for (inp = LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; inp != NULL && i - < n; inp = LIST_NEXT(inp, inp_list)) { + for (inp = LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; + inp != NULL && i < n; inp = LIST_NEXT(inp, inp_list)) { INP_RLOCK(inp); if (inp->inp_gencnt <= gencnt) { /* @@ -1037,8 +1037,8 @@ tcp_getcred(SYSCTL_HANDLER_ARGS) if (error) return (error); INP_INFO_RLOCK(&V_tcbinfo); - inp = in_pcblookup_hash(&V_tcbinfo, addrs[1].sin_addr, addrs[1].sin_port, - addrs[0].sin_addr, addrs[0].sin_port, 0, NULL); + inp = in_pcblookup_hash(&V_tcbinfo, addrs[1].sin_addr, + addrs[1].sin_port, addrs[0].sin_addr, addrs[0].sin_port, 0, NULL); if (inp != NULL) { INP_RLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); @@ -1209,7 +1209,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) if (!mtu) mtu = ip_next_mtu(ip->ip_len, 1); - if (mtu < max(296, (V_tcp_minmss) + if (mtu < max(296, V_tcp_minmss + sizeof(struct tcpiphdr))) mtu = 0; if (!mtu) @@ -1757,7 +1757,8 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq) * If inflight_enable is disabled in the middle of a tcp connection, * make sure snd_bwnd is effectively disabled. */ - if (V_tcp_inflight_enable == 0 || tp->t_rttlow < V_tcp_inflight_rttthresh) { + if (V_tcp_inflight_enable == 0 || + tp->t_rttlow < V_tcp_inflight_rttthresh) { tp->snd_bwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_bandwidth = 0; return; @@ -2039,8 +2040,8 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) break; #endif case AF_INET: - inp = in_pcblookup_hash(&V_tcbinfo, fin->sin_addr, fin->sin_port, - lin->sin_addr, lin->sin_port, 0, NULL); + inp = in_pcblookup_hash(&V_tcbinfo, fin->sin_addr, + fin->sin_port, lin->sin_addr, lin->sin_port, 0, NULL); break; } if (inp != NULL) { diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index fd580d2..df2a682 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -286,7 +286,8 @@ syncache_init(void) &V_tcp_syncache.hashsize); TUNABLE_INT_FETCH("net.inet.tcp.syncache.bucketlimit", &V_tcp_syncache.bucket_limit); - if (!powerof2(V_tcp_syncache.hashsize) || V_tcp_syncache.hashsize == 0) { + if (!powerof2(V_tcp_syncache.hashsize) || + V_tcp_syncache.hashsize == 0) { printf("WARNING: syncache hash size is not a power of 2.\n"); V_tcp_syncache.hashsize = TCP_SYNCACHE_HASHSIZE; } @@ -1569,7 +1570,8 @@ syncookie_generate(struct syncache_head *sch, struct syncache *sc, off = sc->sc_iss & 0x7; /* iss was randomized before */ /* Maximum segment size calculation. */ - pmss = max( min(sc->sc_peer_mss, tcp_mssopt(&sc->sc_inc)), V_tcp_minmss); + pmss = + max( min(sc->sc_peer_mss, tcp_mssopt(&sc->sc_inc)), V_tcp_minmss); for (mss = sizeof(tcp_sc_msstab) / sizeof(int) - 1; mss > 0; mss--) if (tcp_sc_msstab[mss] <= pmss) break; diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index cddb3ab..1b0350e 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2152,7 +2152,8 @@ in6_setmaxmtu(void) struct ifnet *ifp; IFNET_RLOCK(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { + for (ifp = TAILQ_FIRST(&V_ifnet); ifp; + ifp = TAILQ_NEXT(ifp, if_list)) { /* this function can be called during ifnet initialization */ if (!ifp->if_afdata[AF_INET6]) continue; diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 1220244..bdee674 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include <sys/queue.h> #include <sys/syslog.h> #include <sys/protosw.h> - #include <sys/malloc.h> #include <sys/vimage.h> diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index a1b832b..beadb75 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -868,14 +868,14 @@ in6_tmpaddrtimer(void *ignored_arg) struct nd_ifinfo *ndi; u_int8_t nullbuf[8]; struct ifnet *ifp; - int s = splnet(); callout_reset(&V_in6_tmpaddrtimer_ch, (V_ip6_temp_preferred_lifetime - V_ip6_desync_factor - V_ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, NULL); bzero(nullbuf, sizeof(nullbuf)); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { + for (ifp = TAILQ_FIRST(&V_ifnet); ifp; + ifp = TAILQ_NEXT(ifp, if_list)) { ndi = ND_IFINFO(ifp); if (bcmp(ndi->randomid, nullbuf, sizeof(nullbuf)) != 0) { /* @@ -887,7 +887,6 @@ in6_tmpaddrtimer(void *ignored_arg) } } - splx(s); } static void diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index c60d8f6..979ddbd 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include <netinet/tcp_var.h> #include <netinet/ip6.h> #include <netinet/ip_var.h> + #include <netinet6/ip6_var.h> #include <netinet6/nd6.h> #include <netinet/in_pcb.h> diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index e02ceab..88fae3e 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -140,13 +140,13 @@ nd6_init(void) /* initialization of the default router list */ TAILQ_INIT(&V_nd_defrouter); - - nd6_init_done = 1; - /* start timer */ callout_init(&V_nd6_slowtimo_ch, 0); callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, NULL); + + nd6_init_done = 1; + } struct nd_ifinfo * @@ -1891,7 +1891,8 @@ nd6_slowtimo(void *ignored_arg) callout_reset(&V_nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL * hz, nd6_slowtimo, NULL); IFNET_RLOCK(); - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { + for (ifp = TAILQ_FIRST(&V_ifnet); ifp; + ifp = TAILQ_NEXT(ifp, if_list)) { nd6if = ND_IFINFO(ifp); if (nd6if->basereachable && /* already initialized */ (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) { diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index b8dacc9..73ce04e 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -846,7 +846,8 @@ nd6_prefix_lookup(struct nd_prefixctl *key) { struct nd_prefix *search; - for (search = V_nd_prefix.lh_first; search; search = search->ndpr_next) { + for (search = V_nd_prefix.lh_first; + search; search = search->ndpr_next) { if (key->ndpr_ifp == search->ndpr_ifp && key->ndpr_plen == search->ndpr_plen && in6_are_prefix_equal(&key->ndpr_prefix.sin6_addr, diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index bec41c0..e556098 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -215,8 +215,8 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); /* This constructs a "raw" MIB oid. */ #define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ static struct sysctl_oid sysctl__##parent##_##name = { \ - &sysctl_##parent##_children, { 0 }, \ - nbr, kind, a1, a2, #name, handler, fmt, 0, __DESCR(descr) }; \ + &sysctl_##parent##_children, { 0 }, nbr, kind, \ + a1, a2, #name, handler, fmt, 0, __DESCR(descr), 0, 0 }; \ DATA_SET(sysctl_set, sysctl__##parent##_##name) #define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ @@ -226,7 +226,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define SYSCTL_NODE(parent, nbr, name, access, handler, descr) \ struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name); \ SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access), \ - (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, \ + (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, \ "N", descr) #define SYSCTL_ADD_NODE(ctx, parent, nbr, name, access, handler, descr) \ diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index c644631..be9ee1e 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -76,6 +76,7 @@ SYSCTL_UINT(_vm, OID_AUTO, v_free_severe, static int sysctl_vm_loadavg(SYSCTL_HANDLER_ARGS) { + #ifdef SCTL_MASK32 u_int32_t la[4]; |