CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: martin Date: Fri Jul 24 07:42:43 UTC 2015 Modified Files: src/sys/netinet [netbsd-5]: tcp_input.c tcp_output.c Log Message: Pull up following revision(s) (requested by matt in ticket #1973): sys/netinet/tcp_output.c: revision 1.184 sys/netinet/tcp_input.c: revision 1.343 If we are sending a window probe and there's unacked data in the socket, make sure at least the persist timer is running. Make sure that snd_win doesn't go negative. To generate a diff of this commit: cvs rdiff -u -r1.291.4.5 -r1.291.4.6 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.167.10.1 -r1.167.10.2 src/sys/netinet/tcp_output.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/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.291.4.5 src/sys/netinet/tcp_input.c:1.291.4.6 --- src/sys/netinet/tcp_input.c:1.291.4.5 Fri Jun 11 23:36:07 2010 +++ src/sys/netinet/tcp_input.c Fri Jul 24 07:42:43 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.291.4.5 2010/06/11 23:36:07 riz Exp $ */ +/* $NetBSD: tcp_input.c,v 1.291.4.6 2015/07/24 07:42:43 martin Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -145,7 +145,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.5 2010/06/11 23:36:07 riz Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.6 2015/07/24 07:42:43 martin Exp $); #include opt_inet.h #include opt_ipsec.h @@ -2438,7 +2438,10 @@ after_listen: tp-t_lastm = NULL; sbdrop(so-so_snd, acked); tp-t_lastoff -= acked; - tp-snd_wnd -= acked; + if (tp-snd_wnd acked) +tp-snd_wnd -= acked; + else +tp-snd_wnd = 0; ourfinisacked = 0; } sowwakeup(so); Index: src/sys/netinet/tcp_output.c diff -u src/sys/netinet/tcp_output.c:1.167.10.1 src/sys/netinet/tcp_output.c:1.167.10.2 --- src/sys/netinet/tcp_output.c:1.167.10.1 Tue Mar 29 20:12:14 2011 +++ src/sys/netinet/tcp_output.c Fri Jul 24 07:42:43 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_output.c,v 1.167.10.1 2011/03/29 20:12:14 riz Exp $ */ +/* $NetBSD: tcp_output.c,v 1.167.10.2 2015/07/24 07:42:43 martin Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -135,7 +135,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.167.10.1 2011/03/29 20:12:14 riz Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.167.10.2 2015/07/24 07:42:43 martin Exp $); #include opt_inet.h #include opt_ipsec.h @@ -1524,14 +1524,24 @@ send: * of retransmit time. */ timer: - if (TCP_TIMER_ISARMED(tp, TCPT_REXMT) == 0 - ((sack_rxmit tp-snd_nxt != tp-snd_max) || - tp-snd_nxt != tp-snd_una)) { - if (TCP_TIMER_ISARMED(tp, TCPT_PERSIST)) { -TCP_TIMER_DISARM(tp, TCPT_PERSIST); + if (TCP_TIMER_ISARMED(tp, TCPT_REXMT) == 0) { + if ((sack_rxmit tp-snd_nxt != tp-snd_max) + || tp-snd_nxt != tp-snd_una) { +if (TCP_TIMER_ISARMED(tp, TCPT_PERSIST)) { + TCP_TIMER_DISARM(tp, TCPT_PERSIST); + tp-t_rxtshift = 0; +} +TCP_TIMER_ARM(tp, TCPT_REXMT, tp-t_rxtcur); + } else if (len == 0 so-so_snd.sb_cc 0 + TCP_TIMER_ISARMED(tp, TCPT_PERSIST) == 0) { +/* + * If we are sending a window probe and there's + * unacked data in the socket, make sure at + * least the persist timer is running. + */ tp-t_rxtshift = 0; +tcp_setpersist(tp); } - TCP_TIMER_ARM(tp, TCPT_REXMT, tp-t_rxtcur); } } else if (SEQ_GT(tp-snd_nxt + len, tp-snd_max))
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: msaitoh Date: Sun Jun 9 16:39:43 UTC 2013 Modified Files: src/sys/netinet [netbsd-5]: ip_icmp.c Log Message: Pull up following revision(s) (requested by fair in ticket #1855): sys/netinet/ip_icmp.c: revision 1.130 PR/47693: Erik E. Fair: Add missing code to icmp handling. - While there, add the rest of the missing codes - Merge groups - Fix indentation To generate a diff of this commit: cvs rdiff -u -r1.120 -r1.120.6.1 src/sys/netinet/ip_icmp.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/netinet/ip_icmp.c diff -u src/sys/netinet/ip_icmp.c:1.120 src/sys/netinet/ip_icmp.c:1.120.6.1 --- src/sys/netinet/ip_icmp.c:1.120 Wed Jun 18 09:06:28 2008 +++ src/sys/netinet/ip_icmp.c Sun Jun 9 16:39:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.c,v 1.120 2008/06/18 09:06:28 yamt Exp $ */ +/* $NetBSD: ip_icmp.c,v 1.120.6.1 2013/06/09 16:39:43 msaitoh Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -94,7 +94,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ip_icmp.c,v 1.120 2008/06/18 09:06:28 yamt Exp $); +__KERNEL_RCSID(0, $NetBSD: ip_icmp.c,v 1.120.6.1 2013/06/09 16:39:43 msaitoh Exp $); #include opt_ipsec.h @@ -451,45 +451,42 @@ icmp_input(struct mbuf *m, ...) case ICMP_UNREACH: switch (code) { - case ICMP_UNREACH_NET: -code = PRC_UNREACH_NET; -break; - - case ICMP_UNREACH_HOST: -code = PRC_UNREACH_HOST; -break; - - case ICMP_UNREACH_PROTOCOL: -code = PRC_UNREACH_PROTOCOL; -break; + case ICMP_UNREACH_PROTOCOL: + code = PRC_UNREACH_PROTOCOL; + break; - case ICMP_UNREACH_PORT: -code = PRC_UNREACH_PORT; -break; + case ICMP_UNREACH_PORT: + code = PRC_UNREACH_PORT; + break; - case ICMP_UNREACH_SRCFAIL: -code = PRC_UNREACH_SRCFAIL; -break; + case ICMP_UNREACH_SRCFAIL: + code = PRC_UNREACH_SRCFAIL; + break; - case ICMP_UNREACH_NEEDFRAG: -code = PRC_MSGSIZE; -break; + case ICMP_UNREACH_NEEDFRAG: + code = PRC_MSGSIZE; + break; - case ICMP_UNREACH_NET_UNKNOWN: - case ICMP_UNREACH_NET_PROHIB: - case ICMP_UNREACH_TOSNET: -code = PRC_UNREACH_NET; -break; + case ICMP_UNREACH_NET: + case ICMP_UNREACH_NET_UNKNOWN: + case ICMP_UNREACH_NET_PROHIB: + case ICMP_UNREACH_TOSNET: + code = PRC_UNREACH_NET; + break; - case ICMP_UNREACH_HOST_UNKNOWN: - case ICMP_UNREACH_ISOLATED: - case ICMP_UNREACH_HOST_PROHIB: - case ICMP_UNREACH_TOSHOST: -code = PRC_UNREACH_HOST; -break; + case ICMP_UNREACH_HOST: + case ICMP_UNREACH_HOST_UNKNOWN: + case ICMP_UNREACH_ISOLATED: + case ICMP_UNREACH_HOST_PROHIB: + case ICMP_UNREACH_TOSHOST: + case ICMP_UNREACH_ADMIN_PROHIBIT: + case ICMP_UNREACH_HOST_PREC: + case ICMP_UNREACH_PREC_CUTOFF: + code = PRC_UNREACH_HOST; + break; - default: -goto badcode; + default: + goto badcode; } goto deliver;
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: msaitoh Date: Sun Jun 9 22:21:23 UTC 2013 Modified Files: src/sys/netinet [netbsd-5]: ip_icmp.h Log Message: Apply patch (in ticket #1855): Add some macros. This is a part of ip_icmp.h rev. 1.32. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.25.4.1 src/sys/netinet/ip_icmp.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet/ip_icmp.h diff -u src/sys/netinet/ip_icmp.h:1.25 src/sys/netinet/ip_icmp.h:1.25.4.1 --- src/sys/netinet/ip_icmp.h:1.25 Mon Sep 8 23:36:55 2008 +++ src/sys/netinet/ip_icmp.h Sun Jun 9 22:21:22 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_icmp.h,v 1.25 2008/09/08 23:36:55 gmcgarry Exp $ */ +/* $NetBSD: ip_icmp.h,v 1.25.4.1 2013/06/09 22:21:22 msaitoh Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -144,6 +144,9 @@ struct icmp { #define ICMP_UNREACH_ADMIN_PROHIBIT 13 /* communication administratively prohibited */ +#define ICMP_UNREACH_HOST_PREC 14 /* host precedence + violation */ +#define ICMP_UNREACH_PREC_CUTOFF 15 /* precedence cutoff */ #define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ #define ICMP_REDIRECT 5 /* shorter route, codes: */ #define ICMP_REDIRECT_NET 0 /* for network */
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: bouyer Date: Wed Aug 22 20:32:21 UTC 2012 Modified Files: src/sys/netinet [netbsd-5]: in.c Log Message: Pull up following revision(s) (requested by gdt in ticket #1776): sys/netinet/in.c: revision 1.143 Simply use the ifa_addr pointer, rather than taking its address. Resolves failure to match addresses in SIOC[GD]LIFADDR calls. Diagnosis and fix is due to Mark Keaton of BBN. To generate a diff of this commit: cvs rdiff -u -r1.127.4.3 -r1.127.4.4 src/sys/netinet/in.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/netinet/in.c diff -u src/sys/netinet/in.c:1.127.4.3 src/sys/netinet/in.c:1.127.4.4 --- src/sys/netinet/in.c:1.127.4.3 Thu May 20 05:05:58 2010 +++ src/sys/netinet/in.c Wed Aug 22 20:32:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: in.c,v 1.127.4.3 2010/05/20 05:05:58 snj Exp $ */ +/* $NetBSD: in.c,v 1.127.4.4 2012/08/22 20:32:20 bouyer Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.3 2010/05/20 05:05:58 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.4 2012/08/22 20:32:20 bouyer Exp $); #include opt_inet.h #include opt_inet_conf.h @@ -741,7 +741,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo continue; if (cmp == 0) break; - candidate.s_addr = ((struct sockaddr_in *)ifa-ifa_addr)-sin_addr.s_addr; + candidate.s_addr = ((struct sockaddr_in *)ifa-ifa_addr)-sin_addr.s_addr; candidate.s_addr = mask.s_addr; if (candidate.s_addr == match.s_addr) break;
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: riz Date: Tue Mar 29 20:12:14 UTC 2011 Modified Files: src/sys/netinet [netbsd-5]: tcp_output.c Log Message: Pull up following revision(s) (requested by spz in ticket #1586): sys/netinet/tcp_output.c: revision 1.170 Clean up setting ECN bit in TOS. Fixes PR 44742 To generate a diff of this commit: cvs rdiff -u -r1.167 -r1.167.10.1 src/sys/netinet/tcp_output.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/netinet/tcp_output.c diff -u src/sys/netinet/tcp_output.c:1.167 src/sys/netinet/tcp_output.c:1.167.10.1 --- src/sys/netinet/tcp_output.c:1.167 Mon Apr 28 20:24:09 2008 +++ src/sys/netinet/tcp_output.c Tue Mar 29 20:12:14 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_output.c,v 1.167 2008/04/28 20:24:09 martin Exp $ */ +/* $NetBSD: tcp_output.c,v 1.167.10.1 2011/03/29 20:12:14 riz Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -135,7 +135,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.167 2008/04/28 20:24:09 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.167.10.1 2011/03/29 20:12:14 riz Exp $); #include opt_inet.h #include opt_ipsec.h @@ -573,6 +573,7 @@ bool alwaysfrag; int sack_rxmit; int sack_bytes_rxmt; + int ecn_tos; struct sackhole *p; #ifdef TCP_SIGNATURE int sigoff = 0; @@ -698,6 +699,7 @@ txsegsize_nosack = txsegsize; again: + ecn_tos = 0; use_tso = has_tso; if ((tp-t_flags (TF_ECN_SND_CWR|TF_ECN_SND_ECE)) != 0) { /* don't duplicate CWR/ECE. */ @@ -1344,18 +1346,7 @@ */ if (len 0 SEQ_GEQ(tp-snd_nxt, tp-snd_max) !(tp-t_force len == 1)) { - switch (af) { -#ifdef INET - case AF_INET: -tp-t_inpcb-inp_ip.ip_tos |= IPTOS_ECN_ECT0; -break; -#endif -#ifdef INET6 - case AF_INET6: -ip6-ip6_flow |= htonl(IPTOS_ECN_ECT0 20); -break; -#endif - } + ecn_tos = IPTOS_ECN_ECT0; TCP_STATINC(TCP_STAT_ECN_ECT); } @@ -1569,12 +1560,12 @@ packetlen = m-m_pkthdr.len; if (tp-t_inpcb) { ip-ip_ttl = tp-t_inpcb-inp_ip.ip_ttl; - ip-ip_tos = tp-t_inpcb-inp_ip.ip_tos; + ip-ip_tos = tp-t_inpcb-inp_ip.ip_tos | ecn_tos; } #ifdef INET6 else if (tp-t_in6pcb) { ip-ip_ttl = in6_selecthlim(tp-t_in6pcb, NULL); /*XXX*/ - ip-ip_tos = 0; /*XXX*/ + ip-ip_tos = ecn_tos; /*XXX*/ } #endif break; @@ -1594,7 +1585,8 @@ (rt = rtcache_validate(ro)) != NULL ? rt-rt_ifp : NULL); } - /* ip6-ip6_flow = ??? */ + ip6-ip6_flow |= htonl(ecn_tos 20); + /* ip6-ip6_flow = ??? (from template) */ /* ip6_plen will be filled in ip6_output(). */ break; #endif
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: riz Date: Fri Jun 11 23:36:08 UTC 2010 Modified Files: src/sys/netinet [netbsd-5]: tcp_input.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #1382): sys/netinet/tcp_input.c: revision 1.304 sys/netinet/tcp_input.c: revision 1.305 syn_cache_put(): defer all pool_put() to the callout. Reschedule the callout if needed so frees are not delayed too much. syn_cache_timer(): we can't call syn_cache_put() here any more, so move code deleted from syn_cache_put() here. Avoid KASSERT() in kern_timeout.c because pool_put() is called from ipintr context, as reported in http://mail-index.netbsd.org/tech-kern/2010/03/19/msg007762.html Thanks to Andrew Doran and Mindaugas Rasiukevicius for help and review. Make sure SYN_CACHE_TIMER_ARM() has been run before calling syn_cache_put() as it will reschedule the timer. Fixes PR kern/43318. To generate a diff of this commit: cvs rdiff -u -r1.291.4.4 -r1.291.4.5 src/sys/netinet/tcp_input.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/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.291.4.4 src/sys/netinet/tcp_input.c:1.291.4.5 --- src/sys/netinet/tcp_input.c:1.291.4.4 Thu May 20 05:42:06 2010 +++ src/sys/netinet/tcp_input.c Fri Jun 11 23:36:07 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.291.4.4 2010/05/20 05:42:06 snj Exp $ */ +/* $NetBSD: tcp_input.c,v 1.291.4.5 2010/06/11 23:36:07 riz Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -145,7 +145,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.4 2010/05/20 05:42:06 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.5 2010/06/11 23:36:07 riz Exp $); #include opt_inet.h #include opt_ipsec.h @@ -3343,12 +3343,9 @@ if (sc-sc_ipopts) (void) m_free(sc-sc_ipopts); rtcache_free(sc-sc_route); - if (callout_invoking(sc-sc_timer)) - sc-sc_flags |= SCF_DEAD; - else { - callout_destroy(sc-sc_timer); - pool_put(syn_cache_pool, sc); - } + sc-sc_flags |= SCF_DEAD; + if (!callout_invoking(sc-sc_timer)) + callout_schedule((sc)-sc_timer, 1); } void @@ -3509,7 +3506,11 @@ dropit: TCP_STATINC(TCP_STAT_SC_TIMED_OUT); syn_cache_rm(sc); - syn_cache_put(sc); /* calls pool_put but see spl above */ + if (sc-sc_ipopts) + (void) m_free(sc-sc_ipopts); + rtcache_free(sc-sc_route); + callout_destroy(sc-sc_timer); + pool_put(syn_cache_pool, sc); KERNEL_UNLOCK_ONE(NULL); mutex_exit(softnet_lock); } @@ -4182,6 +4183,11 @@ syn_cache_insert(sc, tp); } else { s = splsoftnet(); + /* + * syn_cache_put() will try to schedule the timer, so + * we need to initialize it + */ + SYN_CACHE_TIMER_ARM(sc); syn_cache_put(sc); splx(s); TCP_STATINC(TCP_STAT_SC_DROPPED);
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Thu May 20 05:05:58 UTC 2010 Modified Files: src/sys/netinet [netbsd-5]: in.c Log Message: Revert ticket 1357. To generate a diff of this commit: cvs rdiff -u -r1.127.4.2 -r1.127.4.3 src/sys/netinet/in.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/netinet/in.c diff -u src/sys/netinet/in.c:1.127.4.2 src/sys/netinet/in.c:1.127.4.3 --- src/sys/netinet/in.c:1.127.4.2 Mon Mar 29 00:29:44 2010 +++ src/sys/netinet/in.c Thu May 20 05:05:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: in.c,v 1.127.4.2 2010/03/29 00:29:44 snj Exp $ */ +/* $NetBSD: in.c,v 1.127.4.3 2010/05/20 05:05:58 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.2 2010/03/29 00:29:44 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.3 2010/05/20 05:05:58 snj Exp $); #include opt_inet.h #include opt_inet_conf.h @@ -398,7 +398,6 @@ if (ia == 0) return (ENOBUFS); bzero((void *)ia, sizeof *ia); - mutex_enter(softnet_lock); TAILQ_INSERT_TAIL(in_ifaddrhead, ia, ia_list); IFAREF(ia-ia_ifa); ifa_insert(ifp, ia-ia_ifa); @@ -418,7 +417,6 @@ ia-ia_ifp = ifp; ia-ia_idsalt = arc4random() % 65535; LIST_INIT(ia-ia_multiaddrs); - mutex_exit(softnet_lock); newifaddr = 1; } break; @@ -466,14 +464,12 @@ case SIOCSIFDSTADDR: if ((ifp-if_flags IFF_POINTOPOINT) == 0) return (EINVAL); - mutex_enter(softnet_lock); oldaddr = ia-ia_dstaddr; ia-ia_dstaddr = *satocsin(ifreq_getdstaddr(cmd, ifr)); if (ifp-if_ioctl != NULL (error = (*ifp-if_ioctl)(ifp, SIOCSIFDSTADDR, (void *)ia)) != 0) { ia-ia_dstaddr = oldaddr; - mutex_exit(softnet_lock); return error; } if (ia-ia_flags IFA_ROUTE) { @@ -482,7 +478,6 @@ ia-ia_ifa.ifa_dstaddr = sintosa(ia-ia_dstaddr); rtinit(ia-ia_ifa, RTM_ADD, RTF_HOST|RTF_UP); } - mutex_exit(softnet_lock); break; case SIOCSIFBRDADDR: @@ -492,7 +487,6 @@ break; case SIOCSIFADDR: - mutex_enter(softnet_lock); error = in_ifinit(ifp, ia, satocsin(ifreq_getaddr(cmd, ifr)), 1); #ifdef PFIL_HOOKS @@ -500,22 +494,18 @@ (void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCSIFADDR, ifp, PFIL_IFADDR); #endif - mutex_exit(softnet_lock); break; case SIOCSIFNETMASK: - mutex_enter(softnet_lock); in_ifscrub(ifp, ia); ia-ia_sockmask = *satocsin(ifreq_getaddr(cmd, ifr)); ia-ia_subnetmask = ia-ia_sockmask.sin_addr.s_addr; error = in_ifinit(ifp, ia, NULL, 0); - mutex_exit(softnet_lock); break; case SIOCAIFADDR: maskIsNew = 0; hostIsNew = 1; - mutex_enter(softnet_lock); if (ia-ia_addr.sin_family != AF_INET) ; else if (ifra-ifra_addr.sin_len == 0) { @@ -548,7 +538,6 @@ (void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCAIFADDR, ifp, PFIL_IFADDR); #endif - mutex_exit(softnet_lock); break; case SIOCGIFALIAS: @@ -565,13 +554,11 @@ break; case SIOCDIFADDR: - mutex_enter(softnet_lock); in_purgeaddr(ia-ia_ifa); #ifdef PFIL_HOOKS (void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCDIFADDR, ifp, PFIL_IFADDR); #endif - mutex_exit(softnet_lock); break; #ifdef MROUTING
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Thu May 20 05:21:54 UTC 2010 Modified Files: src/sys/netinet [netbsd-5]: tcp_input.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #1382): sys/netinet/tcp_input.c: revision 1.304 syn_cache_put(): defer all pool_put() to the callout. Reschedule the callout if needed so frees are not delayed too much. syn_cache_timer(): we can't call syn_cache_put() here any more, so move code deleted from syn_cache_put() here. Avoid KASSERT() in kern_timeout.c because pool_put() is called from ipintr context, as reported in http://mail-index.netbsd.org/tech-kern/2010/03/19/msg007762.html Thanks to Andrew Doran and Mindaugas Rasiukevicius for help and review. To generate a diff of this commit: cvs rdiff -u -r1.291.4.2 -r1.291.4.3 src/sys/netinet/tcp_input.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/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.291.4.2 src/sys/netinet/tcp_input.c:1.291.4.3 --- src/sys/netinet/tcp_input.c:1.291.4.2 Sat Sep 26 18:34:29 2009 +++ src/sys/netinet/tcp_input.c Thu May 20 05:21:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.291.4.2 2009/09/26 18:34:29 snj Exp $ */ +/* $NetBSD: tcp_input.c,v 1.291.4.3 2010/05/20 05:21:54 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -145,7 +145,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.2 2009/09/26 18:34:29 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.3 2010/05/20 05:21:54 snj Exp $); #include opt_inet.h #include opt_ipsec.h @@ -3343,12 +3343,9 @@ if (sc-sc_ipopts) (void) m_free(sc-sc_ipopts); rtcache_free(sc-sc_route); - if (callout_invoking(sc-sc_timer)) - sc-sc_flags |= SCF_DEAD; - else { - callout_destroy(sc-sc_timer); - pool_put(syn_cache_pool, sc); - } + sc-sc_flags |= SCF_DEAD; + if (!callout_invoking(sc-sc_timer)) + callout_schedule((sc)-sc_timer, 1); } void @@ -3509,7 +3506,11 @@ dropit: TCP_STATINC(TCP_STAT_SC_TIMED_OUT); syn_cache_rm(sc); - syn_cache_put(sc); /* calls pool_put but see spl above */ + if (sc-sc_ipopts) + (void) m_free(sc-sc_ipopts); + rtcache_free(sc-sc_route); + callout_destroy(sc-sc_timer); + pool_put(syn_cache_pool, sc); KERNEL_UNLOCK_ONE(NULL); mutex_exit(softnet_lock); }
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Mon Mar 29 00:29:44 UTC 2010 Modified Files: src/sys/netinet [netbsd-5]: in.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #1357): sys/netinet/in.c: revision 1.137 via patch Fixed a number of race conditions in the case of receiving ipv4 packet. found by iij seil team. To generate a diff of this commit: cvs rdiff -u -r1.127.4.1 -r1.127.4.2 src/sys/netinet/in.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/netinet/in.c diff -u src/sys/netinet/in.c:1.127.4.1 src/sys/netinet/in.c:1.127.4.2 --- src/sys/netinet/in.c:1.127.4.1 Fri Jan 9 02:57:34 2009 +++ src/sys/netinet/in.c Mon Mar 29 00:29:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: in.c,v 1.127.4.1 2009/01/09 02:57:34 snj Exp $ */ +/* $NetBSD: in.c,v 1.127.4.2 2010/03/29 00:29:44 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.1 2009/01/09 02:57:34 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: in.c,v 1.127.4.2 2010/03/29 00:29:44 snj Exp $); #include opt_inet.h #include opt_inet_conf.h @@ -398,6 +398,7 @@ if (ia == 0) return (ENOBUFS); bzero((void *)ia, sizeof *ia); + mutex_enter(softnet_lock); TAILQ_INSERT_TAIL(in_ifaddrhead, ia, ia_list); IFAREF(ia-ia_ifa); ifa_insert(ifp, ia-ia_ifa); @@ -417,6 +418,7 @@ ia-ia_ifp = ifp; ia-ia_idsalt = arc4random() % 65535; LIST_INIT(ia-ia_multiaddrs); + mutex_exit(softnet_lock); newifaddr = 1; } break; @@ -464,12 +466,14 @@ case SIOCSIFDSTADDR: if ((ifp-if_flags IFF_POINTOPOINT) == 0) return (EINVAL); + mutex_enter(softnet_lock); oldaddr = ia-ia_dstaddr; ia-ia_dstaddr = *satocsin(ifreq_getdstaddr(cmd, ifr)); if (ifp-if_ioctl != NULL (error = (*ifp-if_ioctl)(ifp, SIOCSIFDSTADDR, (void *)ia)) != 0) { ia-ia_dstaddr = oldaddr; + mutex_exit(softnet_lock); return error; } if (ia-ia_flags IFA_ROUTE) { @@ -478,6 +482,7 @@ ia-ia_ifa.ifa_dstaddr = sintosa(ia-ia_dstaddr); rtinit(ia-ia_ifa, RTM_ADD, RTF_HOST|RTF_UP); } + mutex_exit(softnet_lock); break; case SIOCSIFBRDADDR: @@ -487,6 +492,7 @@ break; case SIOCSIFADDR: + mutex_enter(softnet_lock); error = in_ifinit(ifp, ia, satocsin(ifreq_getaddr(cmd, ifr)), 1); #ifdef PFIL_HOOKS @@ -494,18 +500,22 @@ (void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCSIFADDR, ifp, PFIL_IFADDR); #endif + mutex_exit(softnet_lock); break; case SIOCSIFNETMASK: + mutex_enter(softnet_lock); in_ifscrub(ifp, ia); ia-ia_sockmask = *satocsin(ifreq_getaddr(cmd, ifr)); ia-ia_subnetmask = ia-ia_sockmask.sin_addr.s_addr; error = in_ifinit(ifp, ia, NULL, 0); + mutex_exit(softnet_lock); break; case SIOCAIFADDR: maskIsNew = 0; hostIsNew = 1; + mutex_enter(softnet_lock); if (ia-ia_addr.sin_family != AF_INET) ; else if (ifra-ifra_addr.sin_len == 0) { @@ -538,6 +548,7 @@ (void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCAIFADDR, ifp, PFIL_IFADDR); #endif + mutex_exit(softnet_lock); break; case SIOCGIFALIAS: @@ -554,11 +565,13 @@ break; case SIOCDIFADDR: + mutex_enter(softnet_lock); in_purgeaddr(ia-ia_ifa); #ifdef PFIL_HOOKS (void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCDIFADDR, ifp, PFIL_IFADDR); #endif + mutex_exit(softnet_lock); break; #ifdef MROUTING
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Sat Sep 26 18:30:50 UTC 2009 Modified Files: src/sys/netinet [netbsd-5]: in_selsrc.c Log Message: Pull up following revision(s) (requested by dyoung in ticket #937): sys/netinet/in_selsrc.c: revision 1.7 Stop the admin from creating nodes under net.inet.ip.interfaces or net.inet.ip.interfaces.ifname. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.26.1 src/sys/netinet/in_selsrc.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/netinet/in_selsrc.c diff -u src/sys/netinet/in_selsrc.c:1.6 src/sys/netinet/in_selsrc.c:1.6.26.1 --- src/sys/netinet/in_selsrc.c:1.6 Tue Dec 4 10:33:11 2007 +++ src/sys/netinet/in_selsrc.c Sat Sep 26 18:30:50 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: in_selsrc.c,v 1.6 2007/12/04 10:33:11 dyoung Exp $ */ +/* $NetBSD: in_selsrc.c,v 1.6.26.1 2009/09/26 18:30:50 snj Exp $ */ /*- * Copyright (c) 2005 David Young. All rights reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in_selsrc.c,v 1.6 2007/12/04 10:33:11 dyoung Exp $); +__KERNEL_RCSID(0, $NetBSD: in_selsrc.c,v 1.6.26.1 2009/09/26 18:30:50 snj Exp $); #include opt_inet.h #include opt_inet_conf.h @@ -508,7 +508,7 @@ const struct sysctlnode *rnode; if ((rc = sysctl_createv(isc-isc_log, 0, NULL, rnode, - CTLFLAG_READWRITE, CTLTYPE_NODE, + CTLFLAG_READONLY, CTLTYPE_NODE, interfaces, NULL, NULL, 0, NULL, 0, CTL_NET, PF_INET, IPPROTO_IP, CTL_CREATE, @@ -518,7 +518,7 @@ return NULL; } if ((rc = sysctl_createv(isc-isc_log, 0, rnode, rnode, - CTLFLAG_READWRITE, CTLTYPE_NODE, + CTLFLAG_READONLY, CTLTYPE_NODE, isc-isc_ifp-if_xname, SYSCTL_DESCR(interface ip options), NULL, 0, NULL, 0, CTL_CREATE, CTL_EOL)) != 0) {
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Sat Sep 26 18:34:30 UTC 2009 Modified Files: src/sys/netinet [netbsd-5]: tcp_input.c tcp_usrreq.c tcp_var.h Log Message: Pull up following revision(s) (requested by darran in ticket #950): sys/netinet/tcp_input.c: revision 1.299 sys/netinet/tcp_usrreq.c: revision 1.156 sys/netinet/tcp_var.h: revision 1.161 Make tcp msl (max segment life) tunable via sysctl net.inet.tcp.msl. Okayed by t...@. To generate a diff of this commit: cvs rdiff -u -r1.291.4.1 -r1.291.4.2 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.149.4.1 -r1.149.4.2 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.158 -r1.158.4.1 src/sys/netinet/tcp_var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.291.4.1 src/sys/netinet/tcp_input.c:1.291.4.2 --- src/sys/netinet/tcp_input.c:1.291.4.1 Sat Jul 18 21:38:09 2009 +++ src/sys/netinet/tcp_input.c Sat Sep 26 18:34:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.291.4.1 2009/07/18 21:38:09 snj Exp $ */ +/* $NetBSD: tcp_input.c,v 1.291.4.2 2009/09/26 18:34:29 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -145,7 +145,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.1 2009/07/18 21:38:09 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.2 2009/09/26 18:34:29 snj Exp $); #include opt_inet.h #include opt_ipsec.h @@ -242,6 +242,7 @@ int tcp_do_autorcvbuf = 0; int tcp_autorcvbuf_inc = 16 * 1024; int tcp_autorcvbuf_max = 256 * 1024; +int tcp_msl = (TCPTV_MSL / PR_SLOWHZ); static int tcp_rst_ppslim_count = 0; static struct timeval tcp_rst_ppslim_last; @@ -2488,7 +2489,8 @@ if (ourfinisacked) { tp-t_state = TCPS_TIME_WAIT; tcp_canceltimers(tp); -TCP_TIMER_ARM(tp, TCPT_2MSL, 2 * TCPTV_MSL); +TCP_TIMER_ARM(tp, TCPT_2MSL, + 2 * PR_SLOWHZ * tcp_msl); soisdisconnected(so); } break; @@ -2512,7 +2514,7 @@ * it and restart the finack timer. */ case TCPS_TIME_WAIT: - TCP_TIMER_ARM(tp, TCPT_2MSL, 2 * TCPTV_MSL); + TCP_TIMER_ARM(tp, TCPT_2MSL, 2 * PR_SLOWHZ * tcp_msl); goto dropafterack; } } @@ -2696,7 +2698,7 @@ case TCPS_FIN_WAIT_2: tp-t_state = TCPS_TIME_WAIT; tcp_canceltimers(tp); - TCP_TIMER_ARM(tp, TCPT_2MSL, 2 * TCPTV_MSL); + TCP_TIMER_ARM(tp, TCPT_2MSL, 2 * PR_SLOWHZ * tcp_msl); soisdisconnected(so); break; @@ -2704,7 +2706,7 @@ * In TIME_WAIT state restart the 2 MSL time_wait timer. */ case TCPS_TIME_WAIT: - TCP_TIMER_ARM(tp, TCPT_2MSL, 2 * TCPTV_MSL); + TCP_TIMER_ARM(tp, TCPT_2MSL, 2 * PR_SLOWHZ * tcp_msl); break; } } Index: src/sys/netinet/tcp_usrreq.c diff -u src/sys/netinet/tcp_usrreq.c:1.149.4.1 src/sys/netinet/tcp_usrreq.c:1.149.4.2 --- src/sys/netinet/tcp_usrreq.c:1.149.4.1 Wed Jun 17 20:29:33 2009 +++ src/sys/netinet/tcp_usrreq.c Sat Sep 26 18:34:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.149.4.1 2009/06/17 20:29:33 bouyer Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.149.4.2 2009/09/26 18:34:29 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -95,7 +95,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.149.4.1 2009/06/17 20:29:33 bouyer Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.149.4.2 2009/09/26 18:34:29 snj Exp $); #include opt_inet.h #include opt_ipsec.h @@ -1700,6 +1700,12 @@ CTL_NET, pf, IPPROTO_TCP, CTL_CREATE, CTL_EOL); sysctl_createv(clog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READWRITE, + CTLTYPE_INT, msl, + SYSCTL_DESCR(Maximum Segment Life), + NULL, 0, tcp_msl, 0, + CTL_NET, pf, IPPROTO_TCP, TCPCTL_MSL, CTL_EOL); + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_INT, syn_cache_limit, SYSCTL_DESCR(Maximum number of entries in the TCP compressed state engine), Index: src/sys/netinet/tcp_var.h diff -u src/sys/netinet/tcp_var.h:1.158 src/sys/netinet/tcp_var.h:1.158.4.1 --- src/sys/netinet/tcp_var.h:1.158 Wed Aug 6 15:01:23 2008 +++ src/sys/netinet/tcp_var.h Sat Sep 26 18:34:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_var.h,v 1.158 2008/08/06 15:01:23 plunky Exp $ */ +/* $NetBSD: tcp_var.h,v 1.158.4.1 2009/09/26 18:34:29 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -686,7 +686,8 @@ #define TCPCTL_DEBUG 31 /* TCP debug sockets */ #define TCPCTL_DEBX 32 /* # of tcp debug sockets */ #define TCPCTL_DROP 33 /* drop tcp connection */ -#define TCPCTL_MAXID 34 +#define TCPCTL_MSL 34 /* Max Segment Life */ +#define TCPCTL_MAXID 35 #define TCPCTL_NAMES { \ { 0, 0 }, \ @@ -723,6 +724,7 @@ { debug, CTLTYPE_STRUCT }, \ { debx, CTLTYPE_INT }, \ { drop, CTLTYPE_STRUCT }, \ + { msl, CTLTYPE_INT }, \ }
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Sat Jul 18 21:38:09 UTC 2009 Modified Files: src/sys/netinet [netbsd-5]: tcp_input.c Log Message: Pull up following revision(s) (requested by is in ticket #859): sys/netinet/tcp_input.c: revision 1.296 Follow exactly the recommendation of draft-ietf-tcpm-tcpsecure-11.txt: Don't check gainst the last ack received, but the expected sequence number. This makes RST handling independent of delayed ACK. From Joanne M Mikkelson. To generate a diff of this commit: cvs rdiff -u -r1.291 -r1.291.4.1 src/sys/netinet/tcp_input.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/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.291 src/sys/netinet/tcp_input.c:1.291.4.1 --- src/sys/netinet/tcp_input.c:1.291 Mon Aug 4 04:08:47 2008 +++ src/sys/netinet/tcp_input.c Sat Jul 18 21:38:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.291 2008/08/04 04:08:47 tls Exp $ */ +/* $NetBSD: tcp_input.c,v 1.291.4.1 2009/07/18 21:38:09 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -145,7 +145,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291 2008/08/04 04:08:47 tls Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.291.4.1 2009/07/18 21:38:09 snj Exp $); #include opt_inet.h #include opt_ipsec.h @@ -2097,7 +2097,7 @@ tcps[TCP_STAT_RCVDUPBYTE] += todrop; TCP_STAT_PUTREF(); } else if ((tiflags TH_RST) - th-th_seq != tp-last_ack_sent) { + th-th_seq != tp-rcv_nxt) { /* * Test for reset before adjusting the sequence * number for overlapping data. @@ -2223,7 +2223,7 @@ * Close the tcb. */ if (tiflags TH_RST) { - if (th-th_seq != tp-last_ack_sent) + if (th-th_seq != tp-rcv_nxt) goto dropafterack_ratelim; switch (tp-t_state) {
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Thu Jul 9 19:38:27 UTC 2009 Modified Files: src/sys/netinet [netbsd-5]: ip_output.c Log Message: Pull up following revision(s) (requested by martin in ticket #847): sys/netinet/ip_output.c: revision 1.203 From Wolfgang Stukenbrock in PR kern/41659: add missing splx(). To generate a diff of this commit: cvs rdiff -u -r1.200 -r1.200.4.1 src/sys/netinet/ip_output.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/netinet/ip_output.c diff -u src/sys/netinet/ip_output.c:1.200 src/sys/netinet/ip_output.c:1.200.4.1 --- src/sys/netinet/ip_output.c:1.200 Sun Oct 12 11:15:54 2008 +++ src/sys/netinet/ip_output.c Thu Jul 9 19:38:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_output.c,v 1.200 2008/10/12 11:15:54 plunky Exp $ */ +/* $NetBSD: ip_output.c,v 1.200.4.1 2009/07/09 19:38:27 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ip_output.c,v 1.200 2008/10/12 11:15:54 plunky Exp $); +__KERNEL_RCSID(0, $NetBSD: ip_output.c,v 1.200.4.1 2009/07/09 19:38:27 snj Exp $); #include opt_pfil_hooks.h #include opt_inet.h @@ -671,8 +671,10 @@ if (!ipsec_outdone(m)) { s = splsoftnet(); if (inp != NULL -IPSEC_PCB_SKIP_IPSEC(inp-inp_sp, IPSEC_DIR_OUTBOUND)) + IPSEC_PCB_SKIP_IPSEC(inp-inp_sp, IPSEC_DIR_OUTBOUND)) { + splx(s); goto spd_done; + } sp = ipsec4_checkpolicy(m, IPSEC_DIR_OUTBOUND, flags, error, inp); /*
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: bouyer Date: Wed Jun 17 20:29:33 UTC 2009 Modified Files: src/sys/netinet [netbsd-5]: tcp_usrreq.c Log Message: Pull up following revision(s) (requested by rmind in ticket #812): sys/netinet/tcp_usrreq.c: revision 1.155 sysctl_inpcblist: fix a lock leak in error path (hi matt). To generate a diff of this commit: cvs rdiff -u -r1.149 -r1.149.4.1 src/sys/netinet/tcp_usrreq.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/netinet/tcp_usrreq.c diff -u src/sys/netinet/tcp_usrreq.c:1.149 src/sys/netinet/tcp_usrreq.c:1.149.4.1 --- src/sys/netinet/tcp_usrreq.c:1.149 Sat Oct 11 13:40:57 2008 +++ src/sys/netinet/tcp_usrreq.c Wed Jun 17 20:29:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.149 2008/10/11 13:40:57 pooka Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.149.4.1 2009/06/17 20:29:33 bouyer Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -95,7 +95,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.149 2008/10/11 13:40:57 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.149.4.1 2009/06/17 20:29:33 bouyer Exp $); #include opt_inet.h #include opt_ipsec.h @@ -1553,8 +1553,10 @@ if (len = elem_size elem_count 0) { error = copyout(pcb, dp, out_size); - if (error) + if (error) { +mutex_exit(softnet_lock); return (error); + } dp += elem_size; len -= elem_size; }
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Tue Jun 9 17:31:46 UTC 2009 Modified Files: src/sys/netinet [netbsd-5]: ip_carp.c Log Message: Pull up following revision(s) (requested by taca in ticket #796): sys/netinet/ip_carp.c: revision 1.38 Make ip_carp.c compile, fixing usage of CARP_LOG(). To generate a diff of this commit: cvs rdiff -u -r1.26.10.1 -r1.26.10.2 src/sys/netinet/ip_carp.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/netinet/ip_carp.c diff -u src/sys/netinet/ip_carp.c:1.26.10.1 src/sys/netinet/ip_carp.c:1.26.10.2 --- src/sys/netinet/ip_carp.c:1.26.10.1 Fri Jun 5 18:24:01 2009 +++ src/sys/netinet/ip_carp.c Tue Jun 9 17:31:46 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_carp.c,v 1.26.10.1 2009/06/05 18:24:01 snj Exp $ */ +/* $NetBSD: ip_carp.c,v 1.26.10.2 2009/06/09 17:31:46 snj Exp $ */ /* $OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $ */ /* @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ip_carp.c,v 1.26.10.1 2009/06/05 18:24:01 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: ip_carp.c,v 1.26.10.2 2009/06/09 17:31:46 snj Exp $); /* * TODO: @@ -697,7 +697,7 @@ if (timercmp(sc_tv, ch_tv, ) || timercmp(sc_tv, ch_tv, ==)) { callout_stop(sc-sc_ad_tmo); - CARP_LOG(sc, MASTER - BACKUP (more frequent advertisement received)); + CARP_LOG(sc, (MASTER - BACKUP (more frequent advertisement received))); carp_set_state(sc, BACKUP); carp_setrun(sc, 0); carp_setroute(sc, RTM_DELETE); @@ -709,7 +709,7 @@ * and this one claims to be slower, treat him as down. */ if (carp_opts[CARPCTL_PREEMPT] timercmp(sc_tv, ch_tv, )) { - CARP_LOG(sc, BACKUP - MASTER (preempting a slower master)); + CARP_LOG(sc, (BACKUP - MASTER (preempting a slower master))); carp_master_down(sc); break; } @@ -721,7 +721,7 @@ */ sc_tv.tv_sec = sc-sc_advbase * 3; if (timercmp(sc_tv, ch_tv, )) { - CARP_LOG(sc, BACKUP - MASTER (master timed out)) + CARP_LOG(sc, (BACKUP - MASTER (master timed out))); carp_master_down(sc); break; } @@ -1392,7 +1392,7 @@ case MASTER: break; case BACKUP: - CARP_LOG(sc, INIT - MASTER (preempting)); + CARP_LOG(sc, (INIT - MASTER (preempting))); carp_set_state(sc, MASTER); carp_send_ad(sc); carp_send_arp(sc);
CVS commit: [netbsd-5] src/sys/netinet
Module Name:src Committed By: snj Date: Sun May 10 20:45:45 UTC 2009 Modified Files: src/sys/netinet [netbsd-5]: in_pcb.c Log Message: Apply patch (requested by sborrill in ticket #745): Fix compilation with IPNOPRIVPORTS option. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.129.4.1 src/sys/netinet/in_pcb.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/netinet/in_pcb.c diff -u src/sys/netinet/in_pcb.c:1.129 src/sys/netinet/in_pcb.c:1.129.4.1 --- src/sys/netinet/in_pcb.c:1.129 Sat Oct 11 13:40:57 2008 +++ src/sys/netinet/in_pcb.c Sun May 10 20:45:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: in_pcb.c,v 1.129 2008/10/11 13:40:57 pooka Exp $ */ +/* $NetBSD: in_pcb.c,v 1.129.4.1 2009/05/10 20:45:45 snj Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in_pcb.c,v 1.129 2008/10/11 13:40:57 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: in_pcb.c,v 1.129.4.1 2009/05/10 20:45:45 snj Exp $); #include opt_inet.h #include opt_ipsec.h @@ -232,7 +232,9 @@ struct sockaddr_in *sin = NULL; /* XXXGCC */ u_int16_t lport = 0; int wild = 0, reuseport = (so-so_options SO_REUSEPORT); +#ifndef IPNOPRIVPORTS kauth_cred_t cred = l-l_cred; +#endif if (inp-inp_af != AF_INET) return (EINVAL);