CVS commit: src/share/misc
Module Name:src Committed By: rtr Date: Wed Apr 29 22:17:38 UTC 2020 Modified Files: src/share/misc: acronyms.comp Log Message: LSO large send offload To generate a diff of this commit: cvs rdiff -u -r1.301 -r1.302 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.301 src/share/misc/acronyms.comp:1.302 --- src/share/misc/acronyms.comp:1.301 Mon Apr 27 09:10:45 2020 +++ src/share/misc/acronyms.comp Wed Apr 29 22:17:38 2020 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.301 2020/04/27 09:10:45 plunky Exp $ +$NetBSD: acronyms.comp,v 1.302 2020/04/29 22:17:38 rtr Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -882,6 +882,7 @@ LSL load segment limit LSM log structured merge LSN Large Scale NAT LSN log sequence number +LSO large send offload LSR label switch router LTCC low temperature co-fired ceramic LTO linear tape-open
CVS commit: src/share/misc
Module Name:src Committed By: rtr Date: Wed Apr 29 22:17:38 UTC 2020 Modified Files: src/share/misc: acronyms.comp Log Message: LSO large send offload To generate a diff of this commit: cvs rdiff -u -r1.301 -r1.302 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/misc
Module Name:src Committed By: rtr Date: Sun Sep 17 21:55:07 UTC 2017 Modified Files: src/share/misc: acronyms.comp Log Message: GVFS git virtual file system To generate a diff of this commit: cvs rdiff -u -r1.184 -r1.185 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/misc/acronyms.comp diff -u src/share/misc/acronyms.comp:1.184 src/share/misc/acronyms.comp:1.185 --- src/share/misc/acronyms.comp:1.184 Fri Aug 11 16:03:14 2017 +++ src/share/misc/acronyms.comp Sun Sep 17 21:55:07 2017 @@ -1,4 +1,4 @@ -$NetBSD: acronyms.comp,v 1.184 2017/08/11 16:03:14 ginsbach Exp $ +$NetBSD: acronyms.comp,v 1.185 2017/09/17 21:55:07 rtr Exp $ 3WHS three-way handshake 8VSB 8-state vestigial side band modulation AA anti-aliasing @@ -522,6 +522,7 @@ GRE generic routing encapsulation GSI global system interrupt GUI graphical user interface GUID globally unique identifier +GVFSgit virtual file system HA high availability HAL hardware abstraction layer HAT hashed array tree
CVS commit: src/share/misc
Module Name:src Committed By: rtr Date: Sun Sep 17 21:55:07 UTC 2017 Modified Files: src/share/misc: acronyms.comp Log Message: GVFS git virtual file system To generate a diff of this commit: cvs rdiff -u -r1.184 -r1.185 src/share/misc/acronyms.comp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/lib/libkern
Module Name:src Committed By: rtr Date: Wed May 11 03:17:22 UTC 2016 Modified Files: src/sys/lib/libkern: libkern.h Log Message: provide const versions of container_of macros. discussed with riastradh@ by email To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/sys/lib/libkern/libkern.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/lib/libkern/libkern.h diff -u src/sys/lib/libkern/libkern.h:1.122 src/sys/lib/libkern/libkern.h:1.123 --- src/sys/lib/libkern/libkern.h:1.122 Mon May 2 19:18:29 2016 +++ src/sys/lib/libkern/libkern.h Wed May 11 03:17:22 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: libkern.h,v 1.122 2016/05/02 19:18:29 christos Exp $ */ +/* $NetBSD: libkern.h,v 1.123 2016/05/11 03:17:22 rtr Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -337,15 +337,22 @@ tolower(int ch) */ #ifdef __COVERITY__ #define __validate_container_of(PTR, TYPE, FIELD) 0 +#define __validate_const_container_of(PTR, TYPE, FIELD) 0 #else #define __validate_container_of(PTR, TYPE, FIELD) \ (0 * sizeof((PTR) - &((TYPE *)(((char *)(PTR)) - \ offsetof(TYPE, FIELD)))->FIELD)) +#define __validate_const_container_of(PTR, TYPE, FIELD) \ +(0 * sizeof((PTR) - &((const TYPE *)(((const char *)(PTR)) - \ +offsetof(TYPE, FIELD)))->FIELD)) #endif #define container_of(PTR, TYPE, FIELD) \ ((TYPE *)(((char *)(PTR)) - offsetof(TYPE, FIELD)) \ + __validate_container_of(PTR, TYPE, FIELD)) +#define const_container_of(PTR, TYPE, FIELD)\ +((const TYPE *)(((const char *)(PTR)) - offsetof(TYPE, FIELD)) \ + + __validate_const_container_of(PTR, TYPE, FIELD)) #define MTPRNG_RLEN 624 struct mtprng_state {
CVS commit: src/sys/lib/libkern
Module Name:src Committed By: rtr Date: Wed May 11 03:17:22 UTC 2016 Modified Files: src/sys/lib/libkern: libkern.h Log Message: provide const versions of container_of macros. discussed with riastradh@ by email To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/sys/lib/libkern/libkern.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Mon Feb 15 19:00:42 UTC 2016 Modified Files: src/sys/netinet: sctp_indata.c sctputil.c Log Message: Fix building of IPv4-Mapped IPv6 addresses. As discussed on tech-net@ use in6_sin_2_v4mapsin6() to build mapped addresses. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/sctp_indata.c cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/sctputil.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/sctp_indata.c diff -u src/sys/netinet/sctp_indata.c:1.2 src/sys/netinet/sctp_indata.c:1.3 --- src/sys/netinet/sctp_indata.c:1.2 Sun Dec 13 18:53:57 2015 +++ src/sys/netinet/sctp_indata.c Mon Feb 15 19:00:42 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: sctp_indata.c,v 1.2 2015/12/13 18:53:57 christos Exp $ */ +/* $NetBSD: sctp_indata.c,v 1.3 2016/02/15 19:00:42 rtr Exp $ */ /* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sctp_indata.c,v 1.2 2015/12/13 18:53:57 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctp_indata.c,v 1.3 2016/02/15 19:00:42 rtr Exp $"); #ifdef _KERNEL_OPT #include "opt_ipsec.h" @@ -424,13 +424,7 @@ sctp_deliver_data(struct sctp_tcb *stcb, const struct sockaddr_in *sin; sin = (const struct sockaddr_in *)to; - memset(, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_addr.s6_addr16[2] = 0x; - bcopy(>sin_addr, _addr.s6_addr16[3], - sizeof(sin6.sin6_addr.s6_addr16[3])); - sin6.sin6_port = sin->sin_port; + in6_sin_2_v4mapsin6(sin, ); to = (struct sockaddr *) } /* check and strip embedded scope junk */ @@ -653,14 +647,7 @@ sctp_service_reassembly(struct sctp_tcb const struct sockaddr_in *sin; sin = satocsin(to); -memset(, 0, sizeof(sin6)); -sin6.sin6_family = AF_INET6; -sin6.sin6_len = sizeof(struct sockaddr_in6); -sin6.sin6_addr.s6_addr16[2] = 0x; -bcopy(>sin_addr, - _addr.s6_addr16[3], - sizeof(sin6.sin6_addr.s6_addr16[3])); -sin6.sin6_port = sin->sin_port; +in6_sin_2_v4mapsin6(sin, ); to = (struct sockaddr *) } /* check and strip embedded scope junk */ @@ -1962,14 +1949,7 @@ sctp_process_a_data_chunk(struct sctp_tc const struct sockaddr_in *sin; sin = satocsin(to); - memset(, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_addr.s6_addr16[2] = 0x; - bcopy(>sin_addr, - _addr.s6_addr16[3], - sizeof(sin6.sin6_addr.s6_addr16[3])); - sin6.sin6_port = sin->sin_port; + in6_sin_2_v4mapsin6(sin, ); to = (struct sockaddr *) } Index: src/sys/netinet/sctputil.c diff -u src/sys/netinet/sctputil.c:1.1 src/sys/netinet/sctputil.c:1.2 --- src/sys/netinet/sctputil.c:1.1 Tue Oct 13 21:28:35 2015 +++ src/sys/netinet/sctputil.c Mon Feb 15 19:00:42 2016 @@ -1,5 +1,5 @@ /* $KAME: sctputil.c,v 1.39 2005/06/16 20:54:06 jinmei Exp $ */ -/* $NetBSD: sctputil.c,v 1.1 2015/10/13 21:28:35 rjs Exp $ */ +/* $NetBSD: sctputil.c,v 1.2 2016/02/15 19:00:42 rtr Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.1 2015/10/13 21:28:35 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.2 2016/02/15 19:00:42 rtr Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -2087,13 +2087,7 @@ sctp_notify_assoc_change(u_int32_t event const struct sockaddr_in *sin; sin = (const struct sockaddr_in *)to; - memset(, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_addr.s6_addr16[2] = 0x; - memcpy(_addr.s6_addr16[3], >sin_addr, - sizeof(sin6.sin6_addr.s6_addr16[3])); - sin6.sin6_port = sin->sin_port; + in6_sin_2_v4mapsin6(sin, ); to = (struct sockaddr *) } /* check and strip embedded scope junk */ @@ -2179,13 +2173,7 @@ sctp_notify_peer_addr_change(struct sctp const struct sockaddr_in *sin; sin = (const struct sockaddr_in *)to; - memset(, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_addr.s6_addr16[2] = 0x; - bcopy(>sin_addr, _addr.s6_addr16[3], - sizeof(sin6.sin6_addr.s6_addr16[3])); - sin6.sin6_port = sin->sin_port; + in6_sin_2_v4mapsin6(sin, ); to = (struct sockaddr *) } /* check and strip embedded scope junk */ @@ -2279,13 +2267,7 @@ sctp_notify_send_failed(struct sctp_tcb const struct sockaddr_in *sin; sin = satocsin(to); - memset(, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_addr.s6_addr16[2] = 0x; - bcopy(>sin_addr, _addr.s6_addr16[3], - sizeof(sin6.sin6_addr.s6_addr16[3])); - sin6.sin6_port = sin->sin_port; +
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Mon Feb 15 19:00:42 UTC 2016 Modified Files: src/sys/netinet: sctp_indata.c sctputil.c Log Message: Fix building of IPv4-Mapped IPv6 addresses. As discussed on tech-net@ use in6_sin_2_v4mapsin6() to build mapped addresses. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/sctp_indata.c cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/sctputil.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Mon Feb 15 14:59:03 UTC 2016 Modified Files: src/sys/netinet: in_pcb.c tcp_input.c tcp_subr.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: in6.c in6.h Log Message: Reduce code duplication. Split creation of IPv4-Mapped IPv6 addresses into its own function and use it. No functional change intended. As posted to tech-net@ To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.344 -r1.345 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.264 -r1.265 src/sys/netinet/tcp_subr.c cvs rdiff -u -r1.210 -r1.211 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.223 -r1.224 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.194 -r1.195 src/sys/netinet6/in6.c cvs rdiff -u -r1.86 -r1.87 src/sys/netinet6/in6.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/in_pcb.c diff -u src/sys/netinet/in_pcb.c:1.162 src/sys/netinet/in_pcb.c:1.163 --- src/sys/netinet/in_pcb.c:1.162 Mon Aug 24 22:21:26 2015 +++ src/sys/netinet/in_pcb.c Mon Feb 15 14:59:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: in_pcb.c,v 1.162 2015/08/24 22:21:26 pooka Exp $ */ +/* $NetBSD: in_pcb.c,v 1.163 2016/02/15 14:59:03 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.162 2015/08/24 22:21:26 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.163 2016/02/15 14:59:03 rtr Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -347,10 +347,7 @@ in_pcbbind_port(struct inpcb *inp, struc return (EACCES); #ifdef INET6 - memset(, 0, sizeof(mapped)); - mapped.s6_addr16[5] = 0x; - memcpy(_addr32[3], >sin_addr, - sizeof(mapped.s6_addr32[3])); + in6_in_2_v4mapin6(>sin_addr, ); t6 = in6_pcblookup_port(table, , sin->sin_port, wild, ); if (t6 && (reuseport & t6->in6p_socket->so_options) == 0) return (EADDRINUSE); Index: src/sys/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.344 src/sys/netinet/tcp_input.c:1.345 --- src/sys/netinet/tcp_input.c:1.344 Mon Aug 24 22:21:26 2015 +++ src/sys/netinet/tcp_input.c Mon Feb 15 14:59:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.344 2015/08/24 22:21:26 pooka Exp $ */ +/* $NetBSD: tcp_input.c,v 1.345 2016/02/15 14:59:03 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -148,7 +148,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.344 2015/08/24 22:21:26 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.345 2016/02/15 14:59:03 rtr Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1424,12 +1424,8 @@ findpcb: struct in6_addr s, d; /* mapped addr case */ - memset(, 0, sizeof(s)); - s.s6_addr16[5] = htons(0x); - bcopy(>ip_src, _addr32[3], sizeof(ip->ip_src)); - memset(, 0, sizeof(d)); - d.s6_addr16[5] = htons(0x); - bcopy(>ip_dst, _addr32[3], sizeof(ip->ip_dst)); + in6_in_2_v4mapin6(>ip_src, ); + in6_in_2_v4mapin6(>ip_dst, ); in6p = in6_pcblookup_connect(, , th->th_sport, , th->th_dport, 0, ); @@ -4086,14 +4082,7 @@ syn_cache_get(struct sockaddr *src, stru memcpy(, src, src->sa_len); if (src->sa_family == AF_INET) { /* IPv4 packet to AF_INET6 socket */ - memset(, 0, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(sin6); - sin6.sin6_port = ((struct sockaddr_in *)src)->sin_port; - sin6.sin6_addr.s6_addr16[5] = htons(0x); - bcopy(&((struct sockaddr_in *)src)->sin_addr, -_addr.s6_addr32[3], -sizeof(sin6.sin6_addr.s6_addr32[3])); + in6_sin_2_v4mapsin6((struct sockaddr_in *)src, ); } if (in6_pcbconnect(in6p, , NULL)) { goto resetandabort; Index: src/sys/netinet/tcp_subr.c diff -u src/sys/netinet/tcp_subr.c:1.264 src/sys/netinet/tcp_subr.c:1.265 --- src/sys/netinet/tcp_subr.c:1.264 Mon Sep 7 01:56:50 2015 +++ src/sys/netinet/tcp_subr.c Mon Feb 15 14:59:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_subr.c,v 1.264 2015/09/07 01:56:50 ozaki-r Exp $ */ +/* $NetBSD: tcp_subr.c,v 1.265 2016/02/15 14:59:03 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.264 2015/09/07 01:56:50 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.265 2016/02/15 14:59:03 rtr Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1603,11 +1603,8 @@ tcp_ctlinput(int cmd, const struct socka */ th = (struct tcphdr *)((char *)ip + (ip->ip_hl << 2)); #ifdef INET6 - memset(, 0, sizeof(src6)); - memset(, 0, sizeof(dst6)); - src6.s6_addr16[5] = dst6.s6_addr16[5] = 0x; - memcpy(_addr32[3], >ip_src, sizeof(struct in_addr)); - memcpy(_addr32[3], >ip_dst, sizeof(struct in_addr)); + in6_in_2_v4mapin6(>ip_src, ); + in6_in_2_v4mapin6(>ip_dst, ); #endif if ((inp =
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Mon Feb 15 14:59:03 UTC 2016 Modified Files: src/sys/netinet: in_pcb.c tcp_input.c tcp_subr.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: in6.c in6.h Log Message: Reduce code duplication. Split creation of IPv4-Mapped IPv6 addresses into its own function and use it. No functional change intended. As posted to tech-net@ To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.344 -r1.345 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.264 -r1.265 src/sys/netinet/tcp_subr.c cvs rdiff -u -r1.210 -r1.211 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.223 -r1.224 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.194 -r1.195 src/sys/netinet6/in6.c cvs rdiff -u -r1.86 -r1.87 src/sys/netinet6/in6.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sun Feb 14 23:47:57 UTC 2016 Modified Files: src/sys/netinet: tcp_usrreq.c Log Message: remove duplicated #include of To generate a diff of this commit: cvs rdiff -u -r1.209 -r1.210 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.209 src/sys/netinet/tcp_usrreq.c:1.210 --- src/sys/netinet/tcp_usrreq.c:1.209 Mon Aug 24 22:21:26 2015 +++ src/sys/netinet/tcp_usrreq.c Sun Feb 14 23:47:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.209 2015/08/24 22:21:26 pooka Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.210 2016/02/14 23:47:57 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -99,7 +99,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.209 2015/08/24 22:21:26 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.210 2016/02/14 23:47:57 rtr Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -136,9 +136,6 @@ __KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c #include #ifdef INET6 -#ifndef INET -#include -#endif #include #include #include
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sun Feb 14 23:47:57 UTC 2016 Modified Files: src/sys/netinet: tcp_usrreq.c Log Message: remove duplicated #include of To generate a diff of this commit: cvs rdiff -u -r1.209 -r1.210 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.
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: rtr Date: Sun May 24 17:07:27 UTC 2015 Modified Files: src/sys/compat/linux/common: linux_socket.c Log Message: convert remaining linux_get_sa() users to use linux_get_sa_sb() and pass the pointer to the sockaddr in msghdr.msg_name, while removing the MSG_NAMEMBUF flag. now that the original linux_get_sa() is unused remove it and to make function names consistent again rename linux_get_sa_sb() to linux_get_sa(). To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/common/linux_socket.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: rtr Date: Sun May 24 17:07:27 UTC 2015 Modified Files: src/sys/compat/linux/common: linux_socket.c Log Message: convert remaining linux_get_sa() users to use linux_get_sa_sb() and pass the pointer to the sockaddr in msghdr.msg_name, while removing the MSG_NAMEMBUF flag. now that the original linux_get_sa() is unused remove it and to make function names consistent again rename linux_get_sa_sb() to linux_get_sa(). To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.125 src/sys/compat/linux/common/linux_socket.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/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.124 src/sys/compat/linux/common/linux_socket.c:1.125 --- src/sys/compat/linux/common/linux_socket.c:1.124 Sat May 2 17:18:03 2015 +++ src/sys/compat/linux/common/linux_socket.c Sun May 24 17:07:26 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.124 2015/05/02 17:18:03 rtr Exp $ */ +/* $NetBSD: linux_socket.c,v 1.125 2015/05/24 17:07:26 rtr Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: linux_socket.c,v 1.124 2015/05/02 17:18:03 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: linux_socket.c,v 1.125 2015/05/24 17:07:26 rtr Exp $); #if defined(_KERNEL_OPT) #include opt_inet.h @@ -119,9 +119,7 @@ int linux_to_bsd_udp_sockopt(int); int linux_getifname(struct lwp *, register_t *, void *); int linux_getifconf(struct lwp *, register_t *, void *); int linux_getifhwaddr(struct lwp *, register_t *, u_int, void *); -static int linux_get_sa(struct lwp *, int, struct mbuf **, - const struct osockaddr *, unsigned int); -static int linux_get_sa_sb(struct lwp *, int, struct sockaddr_big *, +static int linux_get_sa(struct lwp *, int, struct sockaddr_big *, const struct osockaddr *, socklen_t); static int linux_sa_put(struct osockaddr *osa); static int linux_to_bsd_msg_flags(int); @@ -401,7 +399,7 @@ linux_sys_sendto(struct lwp *l, const st } */ struct msghdr msg; struct iovecaiov; - struct mbuf *nam; + struct sockaddr_big nam; int bflags; int error; @@ -421,8 +419,7 @@ linux_sys_sendto(struct lwp *l, const st SCARG(uap, tolen)); if (error) return (error); - msg.msg_flags |= MSG_NAMEMBUF; - msg.msg_name = nam; + msg.msg_name = nam; msg.msg_namelen = SCARG(uap, tolen); } @@ -470,7 +467,7 @@ linux_sys_sendmsg(struct lwp *l, const s struct linux_msghdr lmsg; int error; int bflags; - struct mbuf *nam; + struct sockaddr_big nam; u_int8_t *control; struct mbuf *ctl_mbuf = NULL; @@ -495,8 +492,7 @@ linux_sys_sendmsg(struct lwp *l, const s msg.msg_namelen); if (error) return (error); - msg.msg_flags |= MSG_NAMEMBUF; - msg.msg_name = nam; + msg.msg_name = nam; } /* @@ -1404,7 +1400,7 @@ linux_sys_connect(struct lwp *l, const s int error; struct sockaddr_big sb; - error = linux_get_sa_sb(l, SCARG(uap, s), sb, SCARG(uap, name), + error = linux_get_sa(l, SCARG(uap, s), sb, SCARG(uap, name), SCARG(uap, namelen)); if (error) return (error); @@ -1449,7 +1445,7 @@ linux_sys_bind(struct lwp *l, const stru int error; struct sockaddr_big sb; - error = linux_get_sa_sb(l, SCARG(uap, s), sb, SCARG(uap, name), + error = linux_get_sa(l, SCARG(uap, s), sb, SCARG(uap, name), SCARG(uap, namelen)); if (error) return (error); @@ -1495,8 +1491,12 @@ linux_sys_getpeername(struct lwp *l, con return (0); } +/* + * Copy the osockaddr structure pointed to by name to sb, adjust + * family and convert to sockaddr. + */ static int -linux_get_sa_sb(struct lwp *l, int s, struct sockaddr_big *sb, +linux_get_sa(struct lwp *l, int s, struct sockaddr_big *sb, const struct osockaddr *name, socklen_t namelen) { int error, bdom; @@ -1566,122 +1566,6 @@ linux_get_sa_sb(struct lwp *l, int s, st return 0; } -/* - * Copy the osockaddr structure pointed to by osa to mbuf, adjust - * family and convert to sockaddr. - */ -static int -linux_get_sa(struct lwp *l, int s, struct mbuf **mp, -const struct osockaddr *osa, unsigned int salen) -{ - int error, bdom; - struct sockaddr *sa; - struct osockaddr *kosa; - struct mbuf *m; - - if (salen == 1 || salen UCHAR_MAX) { - DPRINTF((bad osa=%p salen=%d\n, osa, salen)); - return EINVAL; - } - - /* We'll need the address in an mbuf later, so copy into one here */ - m = m_get(M_WAIT, MT_SONAME); - if (salen MLEN) - MEXTMALLOC(m, salen, M_WAITOK); - - m-m_len = salen; - - if (salen == 0) { - *mp = m; - return 0; - } - - kosa = mtod(m, void *); - if ((error = copyin(osa, kosa, salen))) { - DPRINTF((error %d copying osa %p len %d\n, -error, osa, salen)); - goto bad; - } - - ktrkuser(linux/sockaddr, kosa, salen); - - bdom = linux_to_bsd_domain(kosa-sa_family); - if (bdom
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sun May 24 15:43:45 UTC 2015 Modified Files: src/sys/netinet: in_pcb.c in_pcb.h tcp_input.c src/sys/netinet6: in6_pcb.c in6_pcb.h Log Message: remove transitional functions in{,6}_pcbconnect_m() that were used in converting protocol user requests to accept sockaddr instead of mbufs. remove tcp_input copy in to mbuf from sockaddr and just copy to sockaddr to make it possible for the transitional functions to go away. no version bump since these functions only existed for a short time and were commented as adapters (they appeared in 7.99.15). To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.58 -r1.59 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.340 -r1.341 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.141 -r1.142 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.45 -r1.46 src/sys/netinet6/in6_pcb.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/in_pcb.c diff -u src/sys/netinet/in_pcb.c:1.160 src/sys/netinet/in_pcb.c:1.161 --- src/sys/netinet/in_pcb.c:1.160 Sat May 2 17:18:03 2015 +++ src/sys/netinet/in_pcb.c Sun May 24 15:43:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: in_pcb.c,v 1.160 2015/05/02 17:18:03 rtr Exp $ */ +/* $NetBSD: in_pcb.c,v 1.161 2015/05/24 15:43:45 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -93,7 +93,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in_pcb.c,v 1.160 2015/05/02 17:18:03 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: in_pcb.c,v 1.161 2015/05/24 15:43:45 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -443,21 +443,6 @@ in_pcbbind(void *v, struct sockaddr_in * } /* - * adapter function that accepts nam as mbuf for in_pcbconnect() - */ -int -in_pcbconnect_m(void *v, struct mbuf *nam, struct lwp *l) -{ - struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *); - - if (sizeof (*sin) != nam-m_len) { - return EINVAL; - } - - return in_pcbconnect(v, sin, l); -} - -/* * Connect from a socket to a specified address. * Both address and port must be specified in argument sin. * If don't have a local address for this socket yet, Index: src/sys/netinet/in_pcb.h diff -u src/sys/netinet/in_pcb.h:1.58 src/sys/netinet/in_pcb.h:1.59 --- src/sys/netinet/in_pcb.h:1.58 Sat May 2 17:18:03 2015 +++ src/sys/netinet/in_pcb.h Sun May 24 15:43:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: in_pcb.h,v 1.58 2015/05/02 17:18:03 rtr Exp $ */ +/* $NetBSD: in_pcb.h,v 1.59 2015/05/24 15:43:45 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -133,7 +133,6 @@ void in_losing(struct inpcb *); int in_pcballoc(struct socket *, void *); int in_pcbbind(void *, struct sockaddr_in *, struct lwp *); int in_pcbconnect(void *, struct sockaddr_in *, struct lwp *); -int in_pcbconnect_m(void *, struct mbuf *, struct lwp *); void in_pcbdetach(void *); void in_pcbdisconnect(void *); void in_pcbinit(struct inpcbtable *, int, int); Index: src/sys/netinet/tcp_input.c diff -u src/sys/netinet/tcp_input.c:1.340 src/sys/netinet/tcp_input.c:1.341 --- src/sys/netinet/tcp_input.c:1.340 Fri May 15 18:03:45 2015 +++ src/sys/netinet/tcp_input.c Sun May 24 15:43:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.340 2015/05/15 18:03:45 kefren Exp $ */ +/* $NetBSD: tcp_input.c,v 1.341 2015/05/24 15:43:45 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -148,7 +148,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.340 2015/05/15 18:03:45 kefren Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.341 2015/05/24 15:43:45 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -3918,7 +3918,6 @@ syn_cache_get(struct sockaddr *src, stru struct in6pcb *in6p = NULL; #endif struct tcpcb *tp = 0; - struct mbuf *am; int s; struct socket *oso; @@ -4069,45 +4068,36 @@ syn_cache_get(struct sockaddr *src, stru } #endif - am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */ - if (am == NULL) - goto resetandabort; - MCLAIM(am, tcp_mowner); - am-m_len = src-sa_len; - bcopy(src, mtod(am, void *), src-sa_len); if (inp) { - if (in_pcbconnect_m(inp, am, lwp0)) { - (void) m_free(am); + struct sockaddr_in sin; + memcpy(sin, src, src-sa_len); + if (in_pcbconnect(inp, sin, lwp0)) { goto resetandabort; } } #ifdef INET6 else if (in6p) { + struct sockaddr_in6 sin6; + memcpy(sin6, src, src-sa_len); if (src-sa_family == AF_INET) { /* IPv4 packet to AF_INET6 socket */ - struct sockaddr_in6 *sin6; - sin6 = mtod(am, struct sockaddr_in6 *); - am-m_len = sizeof(*sin6); - memset(sin6, 0, sizeof(*sin6)); - sin6-sin6_family = AF_INET6; - sin6-sin6_len = sizeof(*sin6); - sin6-sin6_port = ((struct sockaddr_in *)src)-sin_port; - sin6-sin6_addr.s6_addr16[5] = htons(0x); + memset(sin6, 0, sizeof(sin6)); + sin6.sin6_family = AF_INET6; +
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sun May 24 15:43:45 UTC 2015 Modified Files: src/sys/netinet: in_pcb.c in_pcb.h tcp_input.c src/sys/netinet6: in6_pcb.c in6_pcb.h Log Message: remove transitional functions in{,6}_pcbconnect_m() that were used in converting protocol user requests to accept sockaddr instead of mbufs. remove tcp_input copy in to mbuf from sockaddr and just copy to sockaddr to make it possible for the transitional functions to go away. no version bump since these functions only existed for a short time and were commented as adapters (they appeared in 7.99.15). To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.58 -r1.59 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.340 -r1.341 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.141 -r1.142 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.45 -r1.46 src/sys/netinet6/in6_pcb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/svr4
Module Name:src Committed By: rtr Date: Sat May 23 15:27:55 UTC 2015 Modified Files: src/sys/compat/svr4: svr4_stream.c Log Message: get rid of unnecessary use of mbuf to hold sockaddr, which was leaked... while here change use to typed pointer sockaddr * instead of void * which also lets us get rid of sasize variable used to track length (since we can now use sa_len easily) To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/compat/svr4/svr4_stream.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/svr4
Module Name:src Committed By: rtr Date: Sat May 23 15:27:55 UTC 2015 Modified Files: src/sys/compat/svr4: svr4_stream.c Log Message: get rid of unnecessary use of mbuf to hold sockaddr, which was leaked... while here change use to typed pointer sockaddr * instead of void * which also lets us get rid of sasize variable used to track length (since we can now use sa_len easily) To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/compat/svr4/svr4_stream.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/compat/svr4/svr4_stream.c diff -u src/sys/compat/svr4/svr4_stream.c:1.85 src/sys/compat/svr4/svr4_stream.c:1.86 --- src/sys/compat/svr4/svr4_stream.c:1.85 Sat May 2 17:18:03 2015 +++ src/sys/compat/svr4/svr4_stream.c Sat May 23 15:27:55 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stream.c,v 1.85 2015/05/02 17:18:03 rtr Exp $ */ +/* $NetBSD: svr4_stream.c,v 1.86 2015/05/23 15:27:55 rtr Exp $ */ /*- * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: svr4_stream.c,v 1.85 2015/05/02 17:18:03 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: svr4_stream.c,v 1.86 2015/05/23 15:27:55 rtr Exp $); #include sys/param.h #include sys/kernel.h @@ -1366,16 +1366,14 @@ int svr4_sys_putmsg(struct lwp *l, const struct svr4_sys_putmsg_args *uap, register_t *retval) { struct proc *p = l-l_proc; + struct sockaddr *skp; file_t *fp; struct svr4_strbuf dat, ctl; struct svr4_strmcmd sc; struct sockaddr_in sain; struct sockaddr_un saun; - void *skp; - int sasize; struct svr4_strm *st; int error; - struct mbuf *nam; struct msghdr msg; struct iovec aiov; @@ -1454,8 +1452,7 @@ svr4_sys_putmsg(struct lwp *l, const str goto out; } netaddr_to_sockaddr_in(sain, sc); - skp = sain; - sasize = sizeof(sain); + skp = (struct sockaddr *)sain; error = sain.sin_family != st-s_family; break; @@ -1471,13 +1468,14 @@ svr4_sys_putmsg(struct lwp *l, const str /* Maybe we've been given a device/inode pair */ dev_t *dev = SVR4_ADDROF(sc); svr4_ino_t *ino = (svr4_ino_t *) dev[1]; - skp = svr4_find_socket(p, fp, *dev, *ino); + skp = (struct sockaddr *)svr4_find_socket( + p, fp, *dev, *ino); if (skp == NULL) { -skp = saun; +skp = (struct sockaddr *)saun; /* I guess we have it by name */ -netaddr_to_sockaddr_un(skp, sc); +netaddr_to_sockaddr_un( +(struct sockaddr_un *)skp, sc); } - sasize = sizeof(saun); } break; @@ -1488,24 +1486,19 @@ svr4_sys_putmsg(struct lwp *l, const str goto out; } - nam = m_get(M_WAIT, MT_SONAME); - nam-m_len = sasize; - memcpy(mtod(nam, void *), skp, sasize); - switch (st-s_cmd = sc.cmd) { case SVR4_TI_CONNECT_REQUEST: /* connect */ KERNEL_UNLOCK_ONE(NULL); - return do_sys_connect(l, SCARG(uap, fd), - mtod(nam, struct sockaddr *)); + return do_sys_connect(l, SCARG(uap, fd), skp); case SVR4_TI_SENDTO_REQUEST: /* sendto */ KERNEL_UNLOCK_ONE(NULL); - msg.msg_name = nam; - msg.msg_namelen = sasize; + msg.msg_name = skp; + msg.msg_namelen = skp-sa_len; msg.msg_iov = aiov; msg.msg_iovlen = 1; msg.msg_control = NULL; - msg.msg_flags = MSG_NAMEMBUF; + msg.msg_flags = 0; aiov.iov_base = NETBSD32PTR(dat.buf); aiov.iov_len = dat.len; error = do_sys_sendmsg(l, SCARG(uap, fd), msg, @@ -1513,9 +1506,7 @@ svr4_sys_putmsg(struct lwp *l, const str *retval = 0; return error; - default: - m_free(nam); DPRINTF((putmsg: Unimplemented command %lx\n, sc.cmd)); error = ENOSYS; goto out;
CVS commit: src/sys/netsmb
Module Name:src Committed By: rtr Date: Fri May 22 22:05:32 UTC 2015 Modified Files: src/sys/netsmb: smb_trantcp.c Log Message: pass connect address directly to soconnect() instead of allocating an mbuf, copying the address into it and then mtod()'ing it back to a sockaddr * for soconnect. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/netsmb/smb_trantcp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netsmb
Module Name:src Committed By: rtr Date: Fri May 22 22:05:32 UTC 2015 Modified Files: src/sys/netsmb: smb_trantcp.c Log Message: pass connect address directly to soconnect() instead of allocating an mbuf, copying the address into it and then mtod()'ing it back to a sockaddr * for soconnect. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/netsmb/smb_trantcp.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/netsmb/smb_trantcp.c diff -u src/sys/netsmb/smb_trantcp.c:1.48 src/sys/netsmb/smb_trantcp.c:1.49 --- src/sys/netsmb/smb_trantcp.c:1.48 Sat May 2 17:18:04 2015 +++ src/sys/netsmb/smb_trantcp.c Fri May 22 22:05:32 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: smb_trantcp.c,v 1.48 2015/05/02 17:18:04 rtr Exp $ */ +/* $NetBSD: smb_trantcp.c,v 1.49 2015/05/22 22:05:32 rtr Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: smb_trantcp.c,v 1.48 2015/05/02 17:18:04 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: smb_trantcp.c,v 1.49 2015/05/22 22:05:32 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -161,7 +161,6 @@ nb_connect_in(struct nbpcb *nbp, struct { struct socket *so; int error; - struct mbuf *m; error = socreate(AF_INET, so, SOCK_STREAM, IPPROTO_TCP, l, NULL); if (error) @@ -181,12 +180,8 @@ nb_connect_in(struct nbpcb *nbp, struct goto bad; nb_setsockopt_int(so, SOL_SOCKET, SO_KEEPALIVE, 1); nb_setsockopt_int(so, IPPROTO_TCP, TCP_NODELAY, 1); - m = m_get(M_WAIT, MT_SONAME); - *mtod(m, struct sockaddr *) = *(struct sockaddr *)to; - m-m_len = sizeof(struct sockaddr); solock(so); - error = soconnect(so, mtod(m, struct sockaddr*), l); - m_free(m); + error = soconnect(so, (struct sockaddr *)to, l); if (error) { sounlock(so); goto bad;
CVS commit: src/sys/sys
Module Name:src Committed By: rtr Date: Thu May 21 22:24:24 UTC 2015 Modified Files: src/sys/sys: param.h Log Message: bump to 7.99.18 for change to nfs_boot_sendrecv To generate a diff of this commit: cvs rdiff -u -r1.479 -r1.480 src/sys/sys/param.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/sys/param.h diff -u src/sys/sys/param.h:1.479 src/sys/sys/param.h:1.480 --- src/sys/sys/param.h:1.479 Mon May 18 06:42:34 2015 +++ src/sys/sys/param.h Thu May 21 22:24:24 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.479 2015/05/18 06:42:34 martin Exp $ */ +/* $NetBSD: param.h,v 1.480 2015/05/21 22:24:24 rtr Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -63,7 +63,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 799001700 /* NetBSD 7.99.17 */ +#define __NetBSD_Version__ 799001800 /* NetBSD 7.99.18 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) = __NetBSD_Version__)
CVS commit: src/sys/sys
Module Name:src Committed By: rtr Date: Thu May 21 22:24:24 UTC 2015 Modified Files: src/sys/sys: param.h Log Message: bump to 7.99.18 for change to nfs_boot_sendrecv To generate a diff of this commit: cvs rdiff -u -r1.479 -r1.480 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: rtr Date: Thu May 21 00:45:27 UTC 2015 Modified Files: src/sys/dev/pci/ixgbe: ixv.c Log Message: remove duplicated assignment of mh-m_len To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixv.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/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.8 src/sys/dev/pci/ixgbe/ixv.c:1.9 --- src/sys/dev/pci/ixgbe/ixv.c:1.8 Fri Apr 24 07:00:51 2015 +++ src/sys/dev/pci/ixgbe/ixv.c Thu May 21 00:45:27 2015 @@ -31,7 +31,7 @@ **/ /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 247822 2013-03-04 23:07:40Z jfv $*/ -/*$NetBSD: ixv.c,v 1.8 2015/04/24 07:00:51 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.9 2015/05/21 00:45:27 rtr Exp $*/ #include opt_inet.h #include opt_inet6.h @@ -2829,7 +2829,6 @@ ixv_refresh_mbufs(struct rx_ring *rxr, i if (mh == NULL) goto update; mh-m_pkthdr.len = mh-m_len = MHLEN; - mh-m_len = MHLEN; mh-m_flags |= M_PKTHDR; m_adj(mh, ETHER_ALIGN); /* Get the memory mapping */
CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: rtr Date: Thu May 21 00:45:27 UTC 2015 Modified Files: src/sys/dev/pci/ixgbe: ixv.c Log Message: remove duplicated assignment of mh-m_len To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Thu May 21 02:04:22 UTC 2015 Modified Files: src/sys/kern: subr_tftproot.c src/sys/nfs: krpc_subr.c nfs_boot.c nfs_bootdhcp.c nfsdiskless.h Log Message: change nfs_boot_sendrecv to take sockaddr_in * instead of mbuf * fixes m_serv (single mbuf leak) leak in kern/subr_tftproot.c To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/kern/subr_tftproot.c cvs rdiff -u -r1.40 -r1.41 src/sys/nfs/krpc_subr.c cvs rdiff -u -r1.84 -r1.85 src/sys/nfs/nfs_boot.c cvs rdiff -u -r1.54 -r1.55 src/sys/nfs/nfs_bootdhcp.c cvs rdiff -u -r1.31 -r1.32 src/sys/nfs/nfsdiskless.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/kern/subr_tftproot.c diff -u src/sys/kern/subr_tftproot.c:1.15 src/sys/kern/subr_tftproot.c:1.16 --- src/sys/kern/subr_tftproot.c:1.15 Sun May 10 18:55:22 2015 +++ src/sys/kern/subr_tftproot.c Thu May 21 02:04:22 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_tftproot.c,v 1.15 2015/05/10 18:55:22 rtr Exp $ */ +/* $NetBSD: subr_tftproot.c,v 1.16 2015/05/21 02:04:22 rtr Exp $ */ /*- * Copyright (c) 2007 Emmanuel Dreyfus, all rights reserved. @@ -39,7 +39,7 @@ #include opt_md.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_tftproot.c,v 1.15 2015/05/10 18:55:22 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_tftproot.c,v 1.16 2015/05/21 02:04:22 rtr Exp $); #include sys/param.h #include sys/types.h @@ -207,7 +207,7 @@ tftproot_getfile(struct tftproot_handle struct socket *so = NULL; struct mbuf *m_serv = NULL; struct mbuf *m_outbuf = NULL; - struct sockaddr_in *sin; + struct sockaddr_in sin; struct tftphdr *tftp; size_t packetlen, namelen; int error = -1; @@ -233,11 +233,8 @@ tftproot_getfile(struct tftproot_handle /* * Set server address and port */ - m_serv = m_get(M_WAIT, MT_SONAME); - m_serv-m_len = sizeof(*sin); - sin = mtod(m_serv, struct sockaddr_in *); - memcpy(sin, trh-trh_nd-nd_root.ndm_saddr, sizeof(*sin)); - sin-sin_port = htons(IPPORT_TFTP); + memcpy(sin, trh-trh_nd-nd_root.ndm_saddr, sizeof(sin)); + sin.sin_port = htons(IPPORT_TFTP); /* * Set send buffer, prepare the TFTP packet @@ -268,9 +265,8 @@ tftproot_getfile(struct tftproot_handle /* * Perform the file transfer */ - sin = (struct sockaddr_in *)trh-trh_nd-nd_root.ndm_saddr; printf(tftproot: download %s:%s , - inet_ntoa(sin-sin_addr), trh-trh_nd-nd_bootfile); + inet_ntoa(sin.sin_addr), trh-trh_nd-nd_bootfile); do { /* @@ -287,7 +283,7 @@ tftproot_getfile(struct tftproot_handle * We get the sender address here, which should be * the same server with a different port */ - if ((error = nfs_boot_sendrecv(so, m_serv, NULL, m_outbuf, + if ((error = nfs_boot_sendrecv(so, sin, NULL, m_outbuf, tftproot_recv, NULL, m_serv, trh, l)) != 0) { DPRINTF((%s():%d sendrecv failed %d\n, __func__, __LINE__, error)); Index: src/sys/nfs/krpc_subr.c diff -u src/sys/nfs/krpc_subr.c:1.40 src/sys/nfs/krpc_subr.c:1.41 --- src/sys/nfs/krpc_subr.c:1.40 Sat May 9 18:12:19 2015 +++ src/sys/nfs/krpc_subr.c Thu May 21 02:04:22 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: krpc_subr.c,v 1.40 2015/05/09 18:12:19 rtr Exp $ */ +/* $NetBSD: krpc_subr.c,v 1.41 2015/05/21 02:04:22 rtr Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -43,7 +43,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: krpc_subr.c,v 1.40 2015/05/09 18:12:19 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: krpc_subr.c,v 1.41 2015/05/21 02:04:22 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -219,8 +219,8 @@ krpc_call(struct sockaddr_in *sa, u_int /* from_p: output */ { struct socket *so; - struct sockaddr_in *sin; - struct mbuf *m, *nam, *mhead, *from; + struct sockaddr_in sin; + struct mbuf *m, *mhead, *from; struct rpc_call *call; struct rpc_reply *reply; int error, len; @@ -235,7 +235,7 @@ krpc_call(struct sockaddr_in *sa, u_int return (EAFNOSUPPORT); /* Free at end if not null. */ - nam = mhead = NULL; + mhead = NULL; from = NULL; /* @@ -274,10 +274,7 @@ krpc_call(struct sockaddr_in *sa, u_int /* * Setup socket address for the server. */ - nam = m_get(M_WAIT, MT_SONAME); - sin = mtod(nam, struct sockaddr_in *); - memcpy((void *)sin, (void *)sa, - (nam-m_len = sa-sin_len)); + sin = *sa; /* * Prepend RPC message header. @@ -314,7 +311,7 @@ krpc_call(struct sockaddr_in *sa, u_int mhead-m_pkthdr.len = len; mhead-m_pkthdr.rcvif = NULL; - error = nfs_boot_sendrecv(so, nam, NULL, mhead, krpccheck, m, from, + error = nfs_boot_sendrecv(so, sin, NULL, mhead, krpccheck, m, from, xid, l); if (error) goto out; @@ -383,7 +380,6 @@ krpc_call(struct sockaddr_in *sa, u_int } out: - if (nam) m_freem(nam); if (mhead) m_freem(mhead); if (from) m_freem(from); soclose(so); Index: src/sys/nfs/nfs_boot.c diff -u src/sys/nfs/nfs_boot.c:1.84
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Thu May 21 02:04:22 UTC 2015 Modified Files: src/sys/kern: subr_tftproot.c src/sys/nfs: krpc_subr.c nfs_boot.c nfs_bootdhcp.c nfsdiskless.h Log Message: change nfs_boot_sendrecv to take sockaddr_in * instead of mbuf * fixes m_serv (single mbuf leak) leak in kern/subr_tftproot.c To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/kern/subr_tftproot.c cvs rdiff -u -r1.40 -r1.41 src/sys/nfs/krpc_subr.c cvs rdiff -u -r1.84 -r1.85 src/sys/nfs/nfs_boot.c cvs rdiff -u -r1.54 -r1.55 src/sys/nfs/nfs_bootdhcp.c cvs rdiff -u -r1.31 -r1.32 src/sys/nfs/nfsdiskless.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sun May 10 18:55:22 UTC 2015 Modified Files: src/sys/kern: subr_tftproot.c Log Message: mtod mbuf to sockaddr * for so_send(). To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/kern/subr_tftproot.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/kern/subr_tftproot.c diff -u src/sys/kern/subr_tftproot.c:1.14 src/sys/kern/subr_tftproot.c:1.15 --- src/sys/kern/subr_tftproot.c:1.14 Fri Mar 27 07:18:11 2015 +++ src/sys/kern/subr_tftproot.c Sun May 10 18:55:22 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_tftproot.c,v 1.14 2015/03/27 07:18:11 hikaru Exp $ */ +/* $NetBSD: subr_tftproot.c,v 1.15 2015/05/10 18:55:22 rtr Exp $ */ /*- * Copyright (c) 2007 Emmanuel Dreyfus, all rights reserved. @@ -39,7 +39,7 @@ #include opt_md.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_tftproot.c,v 1.14 2015/03/27 07:18:11 hikaru Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_tftproot.c,v 1.15 2015/05/10 18:55:22 rtr Exp $); #include sys/param.h #include sys/types.h @@ -320,7 +320,7 @@ tftproot_getfile(struct tftproot_handle * we do not want to free it ourselves. * Ignore errors, as we already have the whole file. */ - if ((error = (*so-so_send)(so, m_serv, NULL, + if ((error = (*so-so_send)(so, mtod(m_serv, struct sockaddr *), NULL, m_outbuf, NULL, 0, l)) != 0) DPRINTF((%s():%d tftproot: sosend returned %d\n, __func__, __LINE__, error));
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sat May 9 15:22:47 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c uipc_syscalls.c src/sys/nfs: nfs_boot.c nfs_socket.c src/sys/sys: param.h socketvar.h Log Message: change sosend() to accept sockaddr * instead of mbuf * for nam. bump to 7.99.16 To generate a diff of this commit: cvs rdiff -u -r1.244 -r1.245 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.177 -r1.178 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.83 -r1.84 src/sys/nfs/nfs_boot.c cvs rdiff -u -r1.195 -r1.196 src/sys/nfs/nfs_socket.c cvs rdiff -u -r1.477 -r1.478 src/sys/sys/param.h cvs rdiff -u -r1.138 -r1.139 src/sys/sys/socketvar.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.244 src/sys/kern/uipc_socket.c:1.245 --- src/sys/kern/uipc_socket.c:1.244 Sun May 3 04:18:45 2015 +++ src/sys/kern/uipc_socket.c Sat May 9 15:22:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.244 2015/05/03 04:18:45 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.245 2015/05/09 15:22:47 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.244 2015/05/03 04:18:45 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.245 2015/05/09 15:22:47 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -883,8 +883,8 @@ sodisconnect(struct socket *so) * Data and control buffers are freed on return. */ int -sosend(struct socket *so, struct mbuf *addr, struct uio *uio, struct mbuf *top, - struct mbuf *control, int flags, struct lwp *l) +sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, + struct mbuf *top, struct mbuf *control, int flags, struct lwp *l) { struct mbuf **mp, *m; long space, len, resid, clen, mlen; @@ -1059,12 +1059,8 @@ sosend(struct socket *so, struct mbuf *a error = (*so-so_proto-pr_usrreqs-pr_sendoob)(so, top, control); } else { -struct sockaddr *sin = NULL; -if (addr) { - sin = mtod(addr, struct sockaddr *); -} error = (*so-so_proto-pr_usrreqs-pr_send)(so, -top, sin, control, l); +top, addr, control, l); } if (dontroute) so-so_options = ~SO_DONTROUTE; Index: src/sys/kern/uipc_syscalls.c diff -u src/sys/kern/uipc_syscalls.c:1.177 src/sys/kern/uipc_syscalls.c:1.178 --- src/sys/kern/uipc_syscalls.c:1.177 Sat May 2 17:18:03 2015 +++ src/sys/kern/uipc_syscalls.c Sat May 9 15:22:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_syscalls.c,v 1.177 2015/05/02 17:18:03 rtr Exp $ */ +/* $NetBSD: uipc_syscalls.c,v 1.178 2015/05/09 15:22:47 rtr Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.177 2015/05/02 17:18:03 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.178 2015/05/09 15:22:47 rtr Exp $); #include opt_pipe.h @@ -532,6 +532,7 @@ do_sys_sendmsg_so(struct lwp *l, int s, { struct iovec aiov[UIO_SMALLIOV], *iov = aiov, *tiov, *ktriov = NULL; + struct sockaddr *sa = NULL; struct mbuf *to, *control; struct uio auio; size_t len, iovsz; @@ -611,8 +612,12 @@ do_sys_sendmsg_so(struct lwp *l, int s, if (mp-msg_control) MCLAIM(control, so-so_mowner); + if (to) { + sa = mtod(to, struct sockaddr *); + } + len = auio.uio_resid; - error = (*so-so_send)(so, to, auio, NULL, control, flags, l); + error = (*so-so_send)(so, sa, auio, NULL, control, flags, l); /* Protocol is responsible for freeing 'control' */ control = NULL; Index: src/sys/nfs/nfs_boot.c diff -u src/sys/nfs/nfs_boot.c:1.83 src/sys/nfs/nfs_boot.c:1.84 --- src/sys/nfs/nfs_boot.c:1.83 Fri Apr 3 20:01:07 2015 +++ src/sys/nfs/nfs_boot.c Sat May 9 15:22:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_boot.c,v 1.83 2015/04/03 20:01:07 rtr Exp $ */ +/* $NetBSD: nfs_boot.c,v 1.84 2015/05/09 15:22:47 rtr Exp $ */ /*- * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: nfs_boot.c,v 1.83 2015/04/03 20:01:07 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: nfs_boot.c,v 1.84 2015/05/09 15:22:47 rtr Exp $); #ifdef _KERNEL_OPT #include opt_nfs.h @@ -468,7 +468,8 @@ send_again: error = ENOBUFS; goto out; } - error = (*so-so_send)(so, nam, NULL, m, NULL, 0, lwp); + error = (*so-so_send)(so, mtod(nam, struct sockaddr *), NULL, + m, NULL, 0, lwp); if (error) { printf(nfs_boot: sosend: %d\n, error); goto out; Index: src/sys/nfs/nfs_socket.c diff -u src/sys/nfs/nfs_socket.c:1.195 src/sys/nfs/nfs_socket.c:1.196 --- src/sys/nfs/nfs_socket.c:1.195 Sat May 2 17:18:04 2015 +++ src/sys/nfs/nfs_socket.c Sat May 9 15:22:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_socket.c,v 1.195 2015/05/02 17:18:04 rtr Exp $
CVS commit: src/sys/nfs
Module Name:src Committed By: rtr Date: Sat May 9 18:12:19 UTC 2015 Modified Files: src/sys/nfs: krpc_subr.c nfs_bootdhcp.c Log Message: when calling nfs_boot_sendrecv pass NULL for pointers instead of 0 To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/nfs/krpc_subr.c cvs rdiff -u -r1.53 -r1.54 src/sys/nfs/nfs_bootdhcp.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/nfs/krpc_subr.c diff -u src/sys/nfs/krpc_subr.c:1.39 src/sys/nfs/krpc_subr.c:1.40 --- src/sys/nfs/krpc_subr.c:1.39 Fri Mar 27 07:18:11 2015 +++ src/sys/nfs/krpc_subr.c Sat May 9 18:12:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: krpc_subr.c,v 1.39 2015/03/27 07:18:11 hikaru Exp $ */ +/* $NetBSD: krpc_subr.c,v 1.40 2015/05/09 18:12:19 rtr Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -43,7 +43,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: krpc_subr.c,v 1.39 2015/03/27 07:18:11 hikaru Exp $); +__KERNEL_RCSID(0, $NetBSD: krpc_subr.c,v 1.40 2015/05/09 18:12:19 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -314,7 +314,7 @@ krpc_call(struct sockaddr_in *sa, u_int mhead-m_pkthdr.len = len; mhead-m_pkthdr.rcvif = NULL; - error = nfs_boot_sendrecv(so, nam, 0, mhead, krpccheck, m, from, + error = nfs_boot_sendrecv(so, nam, NULL, mhead, krpccheck, m, from, xid, l); if (error) goto out; Index: src/sys/nfs/nfs_bootdhcp.c diff -u src/sys/nfs/nfs_bootdhcp.c:1.53 src/sys/nfs/nfs_bootdhcp.c:1.54 --- src/sys/nfs/nfs_bootdhcp.c:1.53 Fri Mar 27 07:18:11 2015 +++ src/sys/nfs/nfs_bootdhcp.c Sat May 9 18:12:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_bootdhcp.c,v 1.53 2015/03/27 07:18:11 hikaru Exp $ */ +/* $NetBSD: nfs_bootdhcp.c,v 1.54 2015/05/09 18:12:19 rtr Exp $ */ /*- * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: nfs_bootdhcp.c,v 1.53 2015/03/27 07:18:11 hikaru Exp $); +__KERNEL_RCSID(0, $NetBSD: nfs_bootdhcp.c,v 1.54 2015/05/09 18:12:19 rtr Exp $); #ifdef _KERNEL_OPT #include opt_nfs_boot.h @@ -636,7 +636,7 @@ bootpc_call(struct nfs_diskless *nd, str #endif error = nfs_boot_sendrecv(so, nam, bootpset, m, - bootpcheck, 0, 0, bpc, lwp); + bootpcheck, NULL, NULL, bpc, lwp); if (error) goto out; @@ -663,7 +663,7 @@ bootpc_call(struct nfs_diskless *nd, str bpc.expected_dhcpmsgtype = DHCPACK; error = nfs_boot_sendrecv(so, nam, bootpset, m, - bootpcheck, 0, 0, bpc, lwp); + bootpcheck, NULL, NULL, bpc, lwp); if (error) goto out; }
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sat May 2 17:18:04 UTC 2015 Modified Files: src/sys/compat/linux/common: linux_socket.c src/sys/compat/svr4: svr4_stream.c src/sys/kern: uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c raw_cb.h raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: dccp_usrreq.c dccp_var.h in_pcb.c in_pcb.h raw_ip.c tcp_input.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: dccp6_usrreq.c dccp6_var.h in6_pcb.c in6_pcb.h raw_ip6.c udp6_output.c udp6_usrreq.c udp6_var.h src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/netsmb: smb_trantcp.c src/sys/nfs: nfs_socket.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: param.h protosw.h socketvar.h un.h Log Message: make connect syscall use sockaddr_big and modify pr_{send,connect} nam parameter type from buf * to sockaddr *. final commit for parameter type changes to protocol user requests * bump kernel version to 7.99.15 for parameter type changes to pr_{send,connect} To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/sys/compat/linux/common/linux_socket.c cvs rdiff -u -r1.84 -r1.85 src/sys/compat/svr4/svr4_stream.c cvs rdiff -u -r1.239 -r1.240 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.176 -r1.177 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.178 -r1.179 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.164 -r1.165 src/sys/net/if_gre.c cvs rdiff -u -r1.27 -r1.28 src/sys/net/link_proto.c cvs rdiff -u -r1.24 -r1.25 src/sys/net/raw_cb.h cvs rdiff -u -r1.53 -r1.54 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.170 -r1.171 src/sys/net/rtsock.c cvs rdiff -u -r1.67 -r1.68 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.43 -r1.44 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.34 -r1.35 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.36 -r1.37 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.5 -r1.6 src/sys/netinet/dccp_usrreq.c cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/dccp_var.h cvs rdiff -u -r1.159 -r1.160 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.57 -r1.58 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.151 -r1.152 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.338 -r1.339 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.207 -r1.208 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.220 -r1.221 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.5 -r1.6 src/sys/netinet6/dccp6_usrreq.c cvs rdiff -u -r1.3 -r1.4 src/sys/netinet6/dccp6_var.h cvs rdiff -u -r1.139 -r1.140 src/sys/netinet6/in6_pcb.c \ src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.44 -r1.45 src/sys/netinet6/in6_pcb.h cvs rdiff -u -r1.48 -r1.49 src/sys/netinet6/udp6_output.c cvs rdiff -u -r1.119 -r1.120 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.27 -r1.28 src/sys/netinet6/udp6_var.h cvs rdiff -u -r1.47 -r1.48 src/sys/netipsec/keysock.c cvs rdiff -u -r1.27 -r1.28 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.48 -r1.49 src/sys/netnatm/natm.c cvs rdiff -u -r1.47 -r1.48 src/sys/netsmb/smb_trantcp.c cvs rdiff -u -r1.194 -r1.195 src/sys/nfs/nfs_socket.c cvs rdiff -u -r1.61 -r1.62 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.476 -r1.477 src/sys/sys/param.h cvs rdiff -u -r1.63 -r1.64 src/sys/sys/protosw.h cvs rdiff -u -r1.137 -r1.138 src/sys/sys/socketvar.h cvs rdiff -u -r1.55 -r1.56 src/sys/sys/un.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/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.123 src/sys/compat/linux/common/linux_socket.c:1.124 --- src/sys/compat/linux/common/linux_socket.c:1.123 Fri Apr 3 20:01:07 2015 +++ src/sys/compat/linux/common/linux_socket.c Sat May 2 17:18:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.123 2015/04/03 20:01:07 rtr Exp $ */ +/* $NetBSD: linux_socket.c,v 1.124 2015/05/02 17:18:03 rtr Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: linux_socket.c,v 1.123 2015/04/03 20:01:07 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: linux_socket.c,v 1.124 2015/05/02 17:18:03 rtr Exp $); #if defined(_KERNEL_OPT) #include opt_inet.h @@ -1402,14 +1402,14 @@ linux_sys_connect(struct lwp *l, const s syscallarg(int) namelen; } */ int error; - struct mbuf *nam; + struct sockaddr_big sb; - error = linux_get_sa(l, SCARG(uap, s), nam, SCARG(uap, name), + error = linux_get_sa_sb(l, SCARG(uap, s), sb, SCARG(uap, name), SCARG(uap, namelen)); if (error) return (error); - error = do_sys_connect(l, SCARG(uap, s), nam); + error = do_sys_connect(l, SCARG(uap, s), (struct sockaddr *)sb); if (error == EISCONN) { struct socket *so; Index:
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sat May 2 21:15:33 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: remove unnecessary check that nam != NULL before deref in soconnect() (added in previous commit). sockargs copyin() makes sure we don't get NULL here To generate a diff of this commit: cvs rdiff -u -r1.241 -r1.242 src/sys/kern/uipc_socket.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.241 src/sys/kern/uipc_socket.c:1.242 --- src/sys/kern/uipc_socket.c:1.241 Sat May 2 20:10:26 2015 +++ src/sys/kern/uipc_socket.c Sat May 2 21:15:33 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.241 2015/05/02 20:10:26 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.242 2015/05/02 21:15:33 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.241 2015/05/02 20:10:26 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.242 2015/05/02 21:15:33 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -830,8 +830,7 @@ soconnect(struct socket *so, struct sock (error = sodisconnect(so { error = EISCONN; } else { - if (NULL != nam - nam-sa_family != so-so_proto-pr_domain-dom_family) { + if (nam-sa_family != so-so_proto-pr_domain-dom_family) { return EAFNOSUPPORT; } error = (*so-so_proto-pr_usrreqs-pr_connect)(so, nam, l);
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sat May 2 20:10:26 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: make soconnect() fail with EAFNOSUPPORT if the domain of the socket does not match family received in the sockaddr. * connect() now fails as documented in connect(2). * atf test t_connect:connect_foreign_family now passes. To generate a diff of this commit: cvs rdiff -u -r1.240 -r1.241 src/sys/kern/uipc_socket.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.240 src/sys/kern/uipc_socket.c:1.241 --- src/sys/kern/uipc_socket.c:1.240 Sat May 2 17:18:03 2015 +++ src/sys/kern/uipc_socket.c Sat May 2 20:10:26 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.240 2015/05/02 17:18:03 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.241 2015/05/02 20:10:26 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.240 2015/05/02 17:18:03 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.241 2015/05/02 20:10:26 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -827,10 +827,15 @@ soconnect(struct socket *so, struct sock */ if (so-so_state (SS_ISCONNECTED|SS_ISCONNECTING) ((so-so_proto-pr_flags PR_CONNREQUIRED) || - (error = sodisconnect(so + (error = sodisconnect(so { error = EISCONN; - else + } else { + if (NULL != nam + nam-sa_family != so-so_proto-pr_domain-dom_family) { + return EAFNOSUPPORT; + } error = (*so-so_proto-pr_usrreqs-pr_connect)(so, nam, l); + } return error; }
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sat May 2 23:46:04 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: compare mbuf * pointer to NULL instead of 0 To generate a diff of this commit: cvs rdiff -u -r1.242 -r1.243 src/sys/kern/uipc_socket.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.242 src/sys/kern/uipc_socket.c:1.243 --- src/sys/kern/uipc_socket.c:1.242 Sat May 2 21:15:33 2015 +++ src/sys/kern/uipc_socket.c Sat May 2 23:46:04 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.242 2015/05/02 21:15:33 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.243 2015/05/02 23:46:04 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.242 2015/05/02 21:15:33 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.243 2015/05/02 23:46:04 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -941,7 +941,7 @@ sosend(struct socket *so, struct mbuf *a error = ENOTCONN; goto release; } - } else if (addr == 0) { + } else if (NULL == addr) { error = EDESTADDRREQ; goto release; }
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sun May 3 04:18:45 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: flip (NULL == addr) to (addr == NULL) use in conditional from previous commit. To generate a diff of this commit: cvs rdiff -u -r1.243 -r1.244 src/sys/kern/uipc_socket.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.243 src/sys/kern/uipc_socket.c:1.244 --- src/sys/kern/uipc_socket.c:1.243 Sat May 2 23:46:04 2015 +++ src/sys/kern/uipc_socket.c Sun May 3 04:18:45 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.243 2015/05/02 23:46:04 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.244 2015/05/03 04:18:45 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.243 2015/05/02 23:46:04 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.244 2015/05/03 04:18:45 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -941,7 +941,7 @@ sosend(struct socket *so, struct mbuf *a error = ENOTCONN; goto release; } - } else if (NULL == addr) { + } else if (addr == NULL) { error = EDESTADDRREQ; goto release; }
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sun Apr 26 16:45:51 UTC 2015 Modified Files: src/sys/netinet: in_pcb.c src/sys/netinet6: in6_pcb.c Log Message: return EINVAL if sin{,6}_len != sizeof(sockaddr_in{,6}) respectively in in{,6}_pcbconnect(). checking just m-m_len isn't enough because there are various places that assume sa_len has been properly populated. To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.136 -r1.137 src/sys/netinet6/in6_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.157 src/sys/netinet/in_pcb.c:1.158 --- src/sys/netinet/in_pcb.c:1.157 Fri Apr 24 22:32:37 2015 +++ src/sys/netinet/in_pcb.c Sun Apr 26 16:45:51 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: in_pcb.c,v 1.157 2015/04/24 22:32:37 rtr Exp $ */ +/* $NetBSD: in_pcb.c,v 1.158 2015/04/26 16:45:51 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -93,7 +93,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in_pcb.c,v 1.157 2015/04/24 22:32:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: in_pcb.c,v 1.158 2015/04/26 16:45:51 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -461,6 +461,8 @@ in_pcbconnect(void *v, struct mbuf *nam, if (nam-m_len != sizeof (*sin)) return (EINVAL); + if (sin-sin_len != sizeof (*sin)) + return (EINVAL); if (sin-sin_family != AF_INET) return (EAFNOSUPPORT); if (sin-sin_port == 0) Index: src/sys/netinet6/in6_pcb.c diff -u src/sys/netinet6/in6_pcb.c:1.136 src/sys/netinet6/in6_pcb.c:1.137 --- src/sys/netinet6/in6_pcb.c:1.136 Fri Apr 24 22:32:37 2015 +++ src/sys/netinet6/in6_pcb.c Sun Apr 26 16:45:50 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_pcb.c,v 1.136 2015/04/24 22:32:37 rtr Exp $ */ +/* $NetBSD: in6_pcb.c,v 1.137 2015/04/26 16:45:50 rtr Exp $ */ /* $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $ */ /* @@ -62,7 +62,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: in6_pcb.c,v 1.136 2015/04/24 22:32:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: in6_pcb.c,v 1.137 2015/04/26 16:45:50 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -446,6 +446,8 @@ in6_pcbconnect(void *v, struct mbuf *nam if (nam-m_len != sizeof(*sin6)) return (EINVAL); + if (sin6-sin6_len != sizeof(*sin6)) + return (EINVAL); if (sin6-sin6_family != AF_INET6) return (EAFNOSUPPORT); if (sin6-sin6_port == 0)
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sun Apr 26 21:40:49 UTC 2015 Modified Files: src/sys/kern: uipc_usrreq.c src/sys/net: link_proto.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: dccp_usrreq.c raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: dccp6_usrreq.c raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: param.h protosw.h Log Message: remove pr_generic from struct pr_usrreqs and all implementations of pr_generic in protocols. bump to 7.99.13 approved by rmind@ To generate a diff of this commit: cvs rdiff -u -r1.177 -r1.178 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.26 -r1.27 src/sys/net/link_proto.c cvs rdiff -u -r1.169 -r1.170 src/sys/net/rtsock.c cvs rdiff -u -r1.66 -r1.67 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.42 -r1.43 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.33 -r1.34 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.35 -r1.36 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/dccp_usrreq.c cvs rdiff -u -r1.149 -r1.150 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.206 -r1.207 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.219 -r1.220 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.4 -r1.5 src/sys/netinet6/dccp6_usrreq.c cvs rdiff -u -r1.138 -r1.139 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.118 -r1.119 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.46 -r1.47 src/sys/netipsec/keysock.c cvs rdiff -u -r1.26 -r1.27 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.47 -r1.48 src/sys/netnatm/natm.c cvs rdiff -u -r1.60 -r1.61 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.474 -r1.475 src/sys/sys/param.h cvs rdiff -u -r1.62 -r1.63 src/sys/sys/protosw.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/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.177 src/sys/kern/uipc_usrreq.c:1.178 --- src/sys/kern/uipc_usrreq.c:1.177 Fri Apr 24 22:32:37 2015 +++ src/sys/kern/uipc_usrreq.c Sun Apr 26 21:40:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.177 2015/04/24 22:32:37 rtr Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.178 2015/04/26 21:40:48 rtr Exp $ */ /*- * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.177 2015/04/24 22:32:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.178 2015/04/26 21:40:48 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -547,41 +547,6 @@ unp_sendoob(struct socket *so, struct mb return EOPNOTSUPP; } -static int -unp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, -struct mbuf *control, struct lwp *l) -{ - - KASSERT(req != PRU_ATTACH); - KASSERT(req != PRU_DETACH); - KASSERT(req != PRU_ACCEPT); - KASSERT(req != PRU_BIND); - KASSERT(req != PRU_LISTEN); - KASSERT(req != PRU_CONNECT); - KASSERT(req != PRU_CONNECT2); - KASSERT(req != PRU_DISCONNECT); - KASSERT(req != PRU_SHUTDOWN); - KASSERT(req != PRU_ABORT); - KASSERT(req != PRU_CONTROL); - KASSERT(req != PRU_SENSE); - KASSERT(req != PRU_PEERADDR); - KASSERT(req != PRU_SOCKADDR); - KASSERT(req != PRU_RCVD); - KASSERT(req != PRU_RCVOOB); - KASSERT(req != PRU_SEND); - KASSERT(req != PRU_SENDOOB); - KASSERT(req != PRU_PURGEIF); - - KASSERT(solocked(so)); - - if (sotounpcb(so) == NULL) - return EINVAL; - - panic(piusrreq); - - return 0; -} - /* * Unix domain socket option processing. */ @@ -1997,5 +1962,4 @@ const struct pr_usrreqs unp_usrreqs = { .pr_recvoob = unp_recvoob, .pr_send = unp_send, .pr_sendoob = unp_sendoob, - .pr_generic = unp_usrreq, }; Index: src/sys/net/link_proto.c diff -u src/sys/net/link_proto.c:1.26 src/sys/net/link_proto.c:1.27 --- src/sys/net/link_proto.c:1.26 Fri Apr 24 22:32:37 2015 +++ src/sys/net/link_proto.c Sun Apr 26 21:40:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: link_proto.c,v 1.26 2015/04/24 22:32:37 rtr Exp $ */ +/* $NetBSD: link_proto.c,v 1.27 2015/04/26 21:40:48 rtr Exp $ */ /*- * Copyright (c) 1982, 1986, 1993 @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: link_proto.c,v 1.26 2015/04/24 22:32:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: link_proto.c,v 1.27 2015/04/26 21:40:48 rtr Exp $); #include sys/param.h #include sys/socket.h @@ -68,8 +68,6 @@ static int link_send(struct socket *, st struct mbuf *, struct lwp *); static int link_sendoob(struct socket *, struct mbuf *, struct mbuf *); static int link_purgeif(struct socket *, struct ifnet *); -static int link_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, -struct mbuf *, struct lwp *); static void link_init(void); /* @@ -98,7 +96,6 @@ static
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sun Apr 26 21:40:49 UTC 2015 Modified Files: src/sys/kern: uipc_usrreq.c src/sys/net: link_proto.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: dccp_usrreq.c raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: dccp6_usrreq.c raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: param.h protosw.h Log Message: remove pr_generic from struct pr_usrreqs and all implementations of pr_generic in protocols. bump to 7.99.13 approved by rmind@ To generate a diff of this commit: cvs rdiff -u -r1.177 -r1.178 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.26 -r1.27 src/sys/net/link_proto.c cvs rdiff -u -r1.169 -r1.170 src/sys/net/rtsock.c cvs rdiff -u -r1.66 -r1.67 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.42 -r1.43 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.33 -r1.34 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.35 -r1.36 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/dccp_usrreq.c cvs rdiff -u -r1.149 -r1.150 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.206 -r1.207 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.219 -r1.220 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.4 -r1.5 src/sys/netinet6/dccp6_usrreq.c cvs rdiff -u -r1.138 -r1.139 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.118 -r1.119 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.46 -r1.47 src/sys/netipsec/keysock.c cvs rdiff -u -r1.26 -r1.27 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.47 -r1.48 src/sys/netnatm/natm.c cvs rdiff -u -r1.60 -r1.61 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.474 -r1.475 src/sys/sys/param.h cvs rdiff -u -r1.62 -r1.63 src/sys/sys/protosw.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet6
Module Name:src Committed By: rtr Date: Sat Apr 25 14:56:05 UTC 2015 Modified Files: src/sys/netinet6: dccp6_usrreq.c dccp6_var.h Log Message: fix missed parameter type change in dccp6_accept() to sockaddr * from mbuf * To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/netinet6/dccp6_usrreq.c cvs rdiff -u -r1.2 -r1.3 src/sys/netinet6/dccp6_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/netinet6/dccp6_usrreq.c diff -u src/sys/netinet6/dccp6_usrreq.c:1.3 src/sys/netinet6/dccp6_usrreq.c:1.4 --- src/sys/netinet6/dccp6_usrreq.c:1.3 Fri Apr 24 22:32:37 2015 +++ src/sys/netinet6/dccp6_usrreq.c Sat Apr 25 14:56:05 2015 @@ -1,5 +1,5 @@ /* $KAME: dccp6_usrreq.c,v 1.13 2005/07/27 08:42:56 nishida Exp $ */ -/* $NetBSD: dccp6_usrreq.c,v 1.3 2015/04/24 22:32:37 rtr Exp $ */ +/* $NetBSD: dccp6_usrreq.c,v 1.4 2015/04/25 14:56:05 rtr Exp $ */ /* * Copyright (C) 2003 WIDE Project. @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: dccp6_usrreq.c,v 1.3 2015/04/24 22:32:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: dccp6_usrreq.c,v 1.4 2015/04/25 14:56:05 rtr Exp $); #include opt_inet.h #include opt_dccp.h @@ -268,7 +268,7 @@ dccp6_accept(struct socket *so, struct s int error = 0; DCCP_DEBUG((LOG_INFO, Entering dccp6_accept!\n)); - if (m == NULL) { + if (nam == NULL) { return EINVAL; } if (so-so_state SS_ISDISCONNECTED) { Index: src/sys/netinet6/dccp6_var.h diff -u src/sys/netinet6/dccp6_var.h:1.2 src/sys/netinet6/dccp6_var.h:1.3 --- src/sys/netinet6/dccp6_var.h:1.2 Sat Apr 4 04:33:39 2015 +++ src/sys/netinet6/dccp6_var.h Sat Apr 25 14:56:05 2015 @@ -1,5 +1,5 @@ /* $KAME: dccp6_var.h,v 1.3 2003/11/18 04:55:43 ono Exp $ */ -/* $NetBSD: dccp6_var.h,v 1.2 2015/04/04 04:33:39 rtr Exp $ */ +/* $NetBSD: dccp6_var.h,v 1.3 2015/04/25 14:56:05 rtr Exp $ */ /* * Copyright (c) 2003 Joacim Häggmark @@ -46,7 +46,7 @@ int dccp6_usrreq(struct socket *, int, s int dccp6_bind(struct socket *, struct sockaddr *, struct lwp *); int dccp6_listen(struct socket *, struct lwp *); int dccp6_connect(struct socket *, struct mbuf *, struct lwp *); -int dccp6_accept(struct socket *, struct mbuf *); +int dccp6_accept(struct socket *, struct sockaddr *); #endif #endif
CVS commit: src/sys/netinet6
Module Name:src Committed By: rtr Date: Sat Apr 25 14:56:05 UTC 2015 Modified Files: src/sys/netinet6: dccp6_usrreq.c dccp6_var.h Log Message: fix missed parameter type change in dccp6_accept() to sockaddr * from mbuf * To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/netinet6/dccp6_usrreq.c cvs rdiff -u -r1.2 -r1.3 src/sys/netinet6/dccp6_var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sat Apr 25 15:19:54 UTC 2015 Modified Files: src/sys/netinet: raw_ip.c Log Message: make rip_connect_pcb take sockaddr_in * instead of mbuf * make rip_connect_pcb static since it appears to be used only in raw_ip.c moves m_len check to callers which is a small duplication of code that will go away when the callers are converted to receive sockaddr *. To generate a diff of this commit: cvs rdiff -u -r1.148 -r1.149 src/sys/netinet/raw_ip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sat Apr 25 15:19:54 UTC 2015 Modified Files: src/sys/netinet: raw_ip.c Log Message: make rip_connect_pcb take sockaddr_in * instead of mbuf * make rip_connect_pcb static since it appears to be used only in raw_ip.c moves m_len check to callers which is a small duplication of code that will go away when the callers are converted to receive sockaddr *. To generate a diff of this commit: cvs rdiff -u -r1.148 -r1.149 src/sys/netinet/raw_ip.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/raw_ip.c diff -u src/sys/netinet/raw_ip.c:1.148 src/sys/netinet/raw_ip.c:1.149 --- src/sys/netinet/raw_ip.c:1.148 Fri Apr 24 22:32:37 2015 +++ src/sys/netinet/raw_ip.c Sat Apr 25 15:19:54 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.148 2015/04/24 22:32:37 rtr Exp $ */ +/* $NetBSD: raw_ip.c,v 1.149 2015/04/25 15:19:54 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.148 2015/04/24 22:32:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.149 2015/04/25 15:19:54 rtr Exp $); #include opt_inet.h #include opt_compat_netbsd.h @@ -111,7 +111,7 @@ struct inpcbtable rawcbtable; int rip_pcbnotify(struct inpcbtable *, struct in_addr, struct in_addr, int, int, void (*)(struct inpcb *, int)); -int rip_connect_pcb(struct inpcb *, struct mbuf *); +static int rip_connect_pcb(struct inpcb *, struct sockaddr_in *); static void rip_disconnect1(struct inpcb *); static void sysctl_net_inet_raw_setup(struct sysctllog **); @@ -480,12 +480,9 @@ rip_ctloutput(int op, struct socket *so, } int -rip_connect_pcb(struct inpcb *inp, struct mbuf *nam) +rip_connect_pcb(struct inpcb *inp, struct sockaddr_in *addr) { - struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); - if (nam-m_len != sizeof(*addr)) - return (EINVAL); if (IFNET_EMPTY()) return (EADDRNOTAVAIL); if (addr-sin_family != AF_INET) @@ -612,7 +609,9 @@ rip_connect(struct socket *so, struct mb KASSERT(nam != NULL); s = splsoftnet(); - error = rip_connect_pcb(inp, nam); + if (nam-m_len != sizeof(struct sockaddr_in)) + return EINVAL; + error = rip_connect_pcb(inp, mtod(nam, struct sockaddr_in *)); if (! error) soisconnected(so); splx(s); @@ -763,7 +762,9 @@ rip_send(struct socket *so, struct mbuf error = EISCONN; goto die; } - error = rip_connect_pcb(inp, nam); + if (nam-m_len != sizeof(struct sockaddr_in)) + return EINVAL; + error = rip_connect_pcb(inp, mtod(nam, struct sockaddr_in *)); if (error) { die: m_freem(m);
CVS commit: src/sys/netatalk
Module Name:src Committed By: rtr Date: Fri Apr 24 23:36:49 UTC 2015 Modified Files: src/sys/netatalk: ddp_usrreq.c Log Message: make at_pcbconnect() take sockaddr_at * instead of mbuf *. move m_len check into callers which results in small duplication of code that will go away when the callers are converted to receive sockaddr * instead of mbuf *. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/netatalk/ddp_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/netatalk/ddp_usrreq.c diff -u src/sys/netatalk/ddp_usrreq.c:1.65 src/sys/netatalk/ddp_usrreq.c:1.66 --- src/sys/netatalk/ddp_usrreq.c:1.65 Fri Apr 24 22:32:37 2015 +++ src/sys/netatalk/ddp_usrreq.c Fri Apr 24 23:36:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ddp_usrreq.c,v 1.65 2015/04/24 22:32:37 rtr Exp $ */ +/* $NetBSD: ddp_usrreq.c,v 1.66 2015/04/24 23:36:48 rtr Exp $ */ /* * Copyright (c) 1990,1991 Regents of The University of Michigan. @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ddp_usrreq.c,v 1.65 2015/04/24 22:32:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: ddp_usrreq.c,v 1.66 2015/04/24 23:36:48 rtr Exp $); #include opt_mbuftrace.h @@ -59,7 +59,7 @@ __KERNEL_RCSID(0, $NetBSD: ddp_usrreq.c static void at_pcbdisconnect(struct ddpcb *); static void at_sockaddr(struct ddpcb *, struct sockaddr_at *); static int at_pcbsetaddr(struct ddpcb *, struct sockaddr_at *); -static int at_pcbconnect(struct ddpcb *, struct mbuf *); +static int at_pcbconnect(struct ddpcb *, struct sockaddr_at *); static void ddp_detach(struct socket *); struct ifqueue atintrq1, atintrq2; @@ -231,18 +231,15 @@ at_pcbsetaddr(struct ddpcb *ddp, struct } static int -at_pcbconnect(struct ddpcb *ddp, struct mbuf *addr) +at_pcbconnect(struct ddpcb *ddp, struct sockaddr_at *sat) { struct rtentry *rt; const struct sockaddr_at *cdst; - struct sockaddr_at *sat = mtod(addr, struct sockaddr_at *); struct route *ro; struct at_ifaddr *aa; struct ifnet *ifp; u_short hintnet = 0, net; - if (addr-m_len != sizeof(*sat)) - return EINVAL; if (sat-sat_family != AF_APPLETALK) { return EAFNOSUPPORT; } @@ -435,7 +432,9 @@ ddp_connect(struct socket *so, struct mb if (ddp-ddp_fsat.sat_port != ATADDR_ANYPORT) return EISCONN; - error = at_pcbconnect(ddp, nam); + if (nam-m_len != sizeof(struct sockaddr_at)) + return EINVAL; + error = at_pcbconnect(ddp, mtod(nam, struct sockaddr_at *)); if (error == 0) soisconnected(so); @@ -550,7 +549,9 @@ ddp_send(struct socket *so, struct mbuf if (ddp-ddp_fsat.sat_port != ATADDR_ANYPORT) return EISCONN; s = splnet(); - error = at_pcbconnect(ddp, nam); + if (nam-m_len != sizeof(struct sockaddr_at)) + return EINVAL; + error = at_pcbconnect(ddp, mtod(nam, struct sockaddr_at *)); if (error) { splx(s); return error;
CVS commit: src/sys/netatalk
Module Name:src Committed By: rtr Date: Fri Apr 24 23:36:49 UTC 2015 Modified Files: src/sys/netatalk: ddp_usrreq.c Log Message: make at_pcbconnect() take sockaddr_at * instead of mbuf *. move m_len check into callers which results in small duplication of code that will go away when the callers are converted to receive sockaddr * instead of mbuf *. To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/netatalk/ddp_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Fri Apr 24 22:32:38 UTC 2015 Modified Files: src/sys/compat/svr4: svr4_stream.c src/sys/kern: uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c raw_cb.h raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: dccp_usrreq.c in_pcb.c in_pcb.h raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: dccp6_usrreq.c in6_pcb.c in6_pcb.h raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: param.h protosw.h socketvar.h Log Message: make accept, getsockname and getpeername syscalls use sockaddr_big and modify pr_{accept,sockname,peername} nam parameter type from mbuf * to sockaddr *. * retained use of mbuftypes[MT_SONAME] for now. * bump to netbsd version 7.99.12 for parameter type change. patch posted to tech-net@ 2015/04/19 To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/compat/svr4/svr4_stream.c cvs rdiff -u -r1.238 -r1.239 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.175 -r1.176 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.176 -r1.177 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.163 -r1.164 src/sys/net/if_gre.c cvs rdiff -u -r1.25 -r1.26 src/sys/net/link_proto.c cvs rdiff -u -r1.23 -r1.24 src/sys/net/raw_cb.h cvs rdiff -u -r1.52 -r1.53 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.168 -r1.169 src/sys/net/rtsock.c cvs rdiff -u -r1.64 -r1.65 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.41 -r1.42 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.32 -r1.33 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.34 -r1.35 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/dccp_usrreq.c cvs rdiff -u -r1.156 -r1.157 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.56 -r1.57 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.147 -r1.148 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.205 -r1.206 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.218 -r1.219 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.2 -r1.3 src/sys/netinet6/dccp6_usrreq.c cvs rdiff -u -r1.135 -r1.136 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.42 -r1.43 src/sys/netinet6/in6_pcb.h cvs rdiff -u -r1.137 -r1.138 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.117 -r1.118 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.45 -r1.46 src/sys/netipsec/keysock.c cvs rdiff -u -r1.25 -r1.26 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.46 -r1.47 src/sys/netnatm/natm.c cvs rdiff -u -r1.59 -r1.60 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.473 -r1.474 src/sys/sys/param.h cvs rdiff -u -r1.61 -r1.62 src/sys/sys/protosw.h cvs rdiff -u -r1.136 -r1.137 src/sys/sys/socketvar.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/compat/svr4/svr4_stream.c diff -u src/sys/compat/svr4/svr4_stream.c:1.83 src/sys/compat/svr4/svr4_stream.c:1.84 --- src/sys/compat/svr4/svr4_stream.c:1.83 Sun Apr 19 19:17:37 2015 +++ src/sys/compat/svr4/svr4_stream.c Fri Apr 24 22:32:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stream.c,v 1.83 2015/04/19 19:17:37 rtr Exp $ */ +/* $NetBSD: svr4_stream.c,v 1.84 2015/04/24 22:32:37 rtr Exp $ */ /*- * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: svr4_stream.c,v 1.83 2015/04/19 19:17:37 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: svr4_stream.c,v 1.84 2015/04/24 22:32:37 rtr Exp $); #include sys/param.h #include sys/kernel.h @@ -872,11 +872,12 @@ svr4_stream_ti_ioctl(file_t *fp, struct struct svr4_strm *st = svr4_stream_get(fp); int error; struct svr4_strmcmd sc; - struct mbuf *name; + struct sockaddr_big sbig; if (st == NULL) return EINVAL; + sbig.sb_len = UCHAR_MAX; sc.offs = 0x10; if ((error = copyin(sub, skb, sizeof(skb))) != 0) { @@ -887,14 +888,14 @@ svr4_stream_ti_ioctl(file_t *fp, struct switch (cmd) { case SVR4_TI_GETMYNAME: DPRINTF((TI_GETMYNAME\n)); - error = do_sys_getsockname(fd, name); + error = do_sys_getsockname(fd, (struct sockaddr *)sbig); if (error != 0) return error; break; case SVR4_TI_GETPEERNAME: DPRINTF((TI_GETPEERNAME\n)); - error = do_sys_getpeername(fd, name); + error = do_sys_getpeername(fd, (struct sockaddr *)sbig); if (error != 0) return error; break; @@ -913,12 +914,12 @@ svr4_stream_ti_ioctl(file_t *fp, struct switch (st-s_family) { case AF_INET: - sockaddr_to_netaddr_in(sc, mtod(name, void *)); + sockaddr_to_netaddr_in(sc, (struct sockaddr_in *)sbig); skb.len = sizeof (struct sockaddr_in); break; case AF_LOCAL: - sockaddr_to_netaddr_un(sc, mtod(name, void *)); + sockaddr_to_netaddr_un(sc, (struct sockaddr_un *)sbig); /* XXX: the
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Fri Apr 24 22:32:38 UTC 2015 Modified Files: src/sys/compat/svr4: svr4_stream.c src/sys/kern: uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c raw_cb.h raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: dccp_usrreq.c in_pcb.c in_pcb.h raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: dccp6_usrreq.c in6_pcb.c in6_pcb.h raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: param.h protosw.h socketvar.h Log Message: make accept, getsockname and getpeername syscalls use sockaddr_big and modify pr_{accept,sockname,peername} nam parameter type from mbuf * to sockaddr *. * retained use of mbuftypes[MT_SONAME] for now. * bump to netbsd version 7.99.12 for parameter type change. patch posted to tech-net@ 2015/04/19 To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/compat/svr4/svr4_stream.c cvs rdiff -u -r1.238 -r1.239 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.175 -r1.176 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.176 -r1.177 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.163 -r1.164 src/sys/net/if_gre.c cvs rdiff -u -r1.25 -r1.26 src/sys/net/link_proto.c cvs rdiff -u -r1.23 -r1.24 src/sys/net/raw_cb.h cvs rdiff -u -r1.52 -r1.53 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.168 -r1.169 src/sys/net/rtsock.c cvs rdiff -u -r1.64 -r1.65 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.41 -r1.42 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.32 -r1.33 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.34 -r1.35 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/dccp_usrreq.c cvs rdiff -u -r1.156 -r1.157 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.56 -r1.57 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.147 -r1.148 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.205 -r1.206 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.218 -r1.219 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.2 -r1.3 src/sys/netinet6/dccp6_usrreq.c cvs rdiff -u -r1.135 -r1.136 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.42 -r1.43 src/sys/netinet6/in6_pcb.h cvs rdiff -u -r1.137 -r1.138 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.117 -r1.118 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.45 -r1.46 src/sys/netipsec/keysock.c cvs rdiff -u -r1.25 -r1.26 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.46 -r1.47 src/sys/netnatm/natm.c cvs rdiff -u -r1.59 -r1.60 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.473 -r1.474 src/sys/sys/param.h cvs rdiff -u -r1.61 -r1.62 src/sys/sys/protosw.h cvs rdiff -u -r1.136 -r1.137 src/sys/sys/socketvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/svr4
Module Name:src Committed By: rtr Date: Sun Apr 19 19:17:37 UTC 2015 Modified Files: src/sys/compat/svr4: svr4_stream.c Log Message: clean up the way ti_bind() was converted to use sockaddr_big. instead of using the original sockaddr_{in,un} structures for storage use the single sockaddr_big structure instead. while here ditch superfluous assignment of sockaddr sb_len since the assignment is already performed in netaddr_to_sockaddr_{in,un} To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/compat/svr4/svr4_stream.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/compat/svr4/svr4_stream.c diff -u src/sys/compat/svr4/svr4_stream.c:1.82 src/sys/compat/svr4/svr4_stream.c:1.83 --- src/sys/compat/svr4/svr4_stream.c:1.82 Fri Apr 3 20:01:07 2015 +++ src/sys/compat/svr4/svr4_stream.c Sun Apr 19 19:17:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_stream.c,v 1.82 2015/04/03 20:01:07 rtr Exp $ */ +/* $NetBSD: svr4_stream.c,v 1.83 2015/04/19 19:17:37 rtr Exp $ */ /*- * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: svr4_stream.c,v 1.82 2015/04/03 20:01:07 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: svr4_stream.c,v 1.83 2015/04/19 19:17:37 rtr Exp $); #include sys/param.h #include sys/kernel.h @@ -750,9 +750,9 @@ ti_bind(file_t *fp, int fd, struct svr4_ { int error; struct svr4_strm *st = svr4_stream_get(fp); - struct sockaddr_in sain; - struct sockaddr_un saun; - struct sockaddr_big *sbig; + struct sockaddr_in *sain; + struct sockaddr_un *saun; + struct sockaddr_big sbig; void *sup = NULL; int sasize; struct svr4_strmcmd bnd; @@ -775,34 +775,34 @@ ti_bind(file_t *fp, int fd, struct svr4_ switch (st-s_family) { case AF_INET: - sbig = (struct sockaddr_big *)sain; - sbig-sb_len = sasize = sizeof(sain); + sain = (struct sockaddr_in *)sbig; + sasize = sizeof(*sain); if (bnd.offs == 0) goto reply; - netaddr_to_sockaddr_in(sain, bnd); + netaddr_to_sockaddr_in(sain, bnd); DPRINTF((TI_BIND: fam %d, port %d, addr %x\n, - sain.sin_family, sain.sin_port, - sain.sin_addr.s_addr)); + sain-sin_family, sain-sin_port, + sain-sin_addr.s_addr)); break; case AF_LOCAL: - sbig = (struct sockaddr_big *)saun; - sbig-sb_len = sasize = sizeof(saun); + saun = (struct sockaddr_un *)sbig; + sasize = sizeof(*saun); if (bnd.offs == 0) goto reply; - netaddr_to_sockaddr_un(saun, bnd); + netaddr_to_sockaddr_un(saun, bnd); - if (saun.sun_path[0] == '\0') + if (saun-sun_path[0] == '\0') goto reply; DPRINTF((TI_BIND: fam %d, path %s\n, - saun.sun_family, saun.sun_path)); + saun-sun_family, saun-sun_path)); - if ((error = clean_pipe(l, saun.sun_path)) != 0) + if ((error = clean_pipe(l, saun-sun_path)) != 0) return error; bnd.pad[28] = 0x1000; /* magic again */ @@ -816,7 +816,7 @@ ti_bind(file_t *fp, int fd, struct svr4_ DPRINTF((TI_BIND: fileno %d\n, fd)); - error = do_sys_bind(l, fd, (struct sockaddr *)sbig); + error = do_sys_bind(l, fd, (struct sockaddr *)sbig); if (error != 0) { DPRINTF((TI_BIND: bind failed %d\n, error)); return error;
CVS commit: src/sys/compat/svr4
Module Name:src Committed By: rtr Date: Sun Apr 19 19:17:37 UTC 2015 Modified Files: src/sys/compat/svr4: svr4_stream.c Log Message: clean up the way ti_bind() was converted to use sockaddr_big. instead of using the original sockaddr_{in,un} structures for storage use the single sockaddr_big structure instead. while here ditch superfluous assignment of sockaddr sb_len since the assignment is already performed in netaddr_to_sockaddr_{in,un} To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/compat/svr4/svr4_stream.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 23:28:10 UTC 2015 Modified Files: src/tests/lib/libc/sys: t_bind.c Log Message: fix typo bindinging - binding To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_bind.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 23:28:10 UTC 2015 Modified Files: src/tests/lib/libc/sys: t_bind.c Log Message: fix typo bindinging - binding To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_bind.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/sys/t_bind.c diff -u src/tests/lib/libc/sys/t_bind.c:1.2 src/tests/lib/libc/sys/t_bind.c:1.3 --- src/tests/lib/libc/sys/t_bind.c:1.2 Sun Apr 5 23:15:54 2015 +++ src/tests/lib/libc/sys/t_bind.c Sun Apr 5 23:28:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bind.c,v 1.2 2015/04/05 23:15:54 rtr Exp $ */ +/* $NetBSD: t_bind.c,v 1.3 2015/04/05 23:28:10 rtr Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. * All rights reserved. @@ -42,7 +42,7 @@ ATF_TC(bind_foreign_family); ATF_TC_HEAD(bind_foreign_family, tc) { - atf_tc_set_md_var(tc, descr, Checks that bindinging a socket + atf_tc_set_md_var(tc, descr, Checks that binding a socket with a different address family fails); }
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 23:17:41 UTC 2015 Modified Files: src/tests/lib/libc/sys: t_connect.c Log Message: add another test program for connect(2) that checks that connect fails with EAFNOSUPPORT (similar to the bind test) if the domain of the socket does not match the address family of the supplied address. test currently fails as it should To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_connect.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/sys/t_connect.c diff -u src/tests/lib/libc/sys/t_connect.c:1.1 src/tests/lib/libc/sys/t_connect.c:1.2 --- src/tests/lib/libc/sys/t_connect.c:1.1 Sat Nov 5 18:19:02 2011 +++ src/tests/lib/libc/sys/t_connect.c Sun Apr 5 23:17:41 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_connect.c,v 1.1 2011/11/05 18:19:02 jruoho Exp $ */ +/* $NetBSD: t_connect.c,v 1.2 2015/04/05 23:17:41 rtr Exp $ */ /* * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. * All rights reserved. @@ -90,10 +90,39 @@ ATF_TC_BODY(connect_low_port, tc) close(sd); } +ATF_TC(connect_foreign_family); +ATF_TC_HEAD(connect_foreign_family, tc) +{ + atf_tc_set_md_var(tc, descr, Checks that connecting a socket + with a different address family fails); +} +ATF_TC_BODY(connect_foreign_family, tc) +{ + struct sockaddr_in addr; + + /* addr.sin_family = AF_UNSPEC = 0 */ + memset(addr, 0, sizeof(addr)); + + /* + * it is not necessary to initialize sin_{addr,port} since + * those structure members shall not be accessed if connect + * fails correctly. + */ + + int sock = socket(AF_LOCAL, SOCK_STREAM, 0); + ATF_REQUIRE(sock != -1); + + ATF_REQUIRE(-1 == connect(sock, (struct sockaddr *)addr, sizeof(addr))); + ATF_REQUIRE(EAFNOSUPPORT == errno); + + close(sock); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, connect_low_port); + ATF_TP_ADD_TC(tp, connect_foreign_family); return atf_no_error(); }
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 23:17:41 UTC 2015 Modified Files: src/tests/lib/libc/sys: t_connect.c Log Message: add another test program for connect(2) that checks that connect fails with EAFNOSUPPORT (similar to the bind test) if the domain of the socket does not match the address family of the supplied address. test currently fails as it should To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_connect.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sun Apr 5 23:19:56 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: change return from EINVAL to EAFNOSUPPORT when the domain of the socket does not match the family of the address to be bound. fixes atf test lib/libc/sys/t_bind bind_foreign_family To generate a diff of this commit: cvs rdiff -u -r1.237 -r1.238 src/sys/kern/uipc_socket.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.237 src/sys/kern/uipc_socket.c:1.238 --- src/sys/kern/uipc_socket.c:1.237 Sun Apr 5 02:26:39 2015 +++ src/sys/kern/uipc_socket.c Sun Apr 5 23:19:56 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.237 2015/04/05 02:26:39 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.238 2015/04/05 23:19:56 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.237 2015/04/05 02:26:39 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.238 2015/04/05 23:19:56 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -631,7 +631,7 @@ sobind(struct socket *so, struct sockadd solock(so); if (nam-sa_family != so-so_proto-pr_domain-dom_family) { sounlock(so); - return EINVAL; + return EAFNOSUPPORT; } error = (*so-so_proto-pr_usrreqs-pr_bind)(so, nam, l); sounlock(so);
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sun Apr 5 23:19:56 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: change return from EINVAL to EAFNOSUPPORT when the domain of the socket does not match the family of the address to be bound. fixes atf test lib/libc/sys/t_bind bind_foreign_family To generate a diff of this commit: cvs rdiff -u -r1.237 -r1.238 src/sys/kern/uipc_socket.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 23:15:54 UTC 2015 Modified Files: src/tests/lib/libc/sys: t_bind.c Log Message: - ATF_REQUIRE(EINVAL == errno); + ATF_REQUIRE(EAFNOSUPPORT == errno); as per http://pubs.opengroup.org/onlinepubs/009695399/functions/bind.html while here remove some unnecessary initialization of port and addr members and replace with a comment explaining why. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_bind.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 23:15:54 UTC 2015 Modified Files: src/tests/lib/libc/sys: t_bind.c Log Message: - ATF_REQUIRE(EINVAL == errno); + ATF_REQUIRE(EAFNOSUPPORT == errno); as per http://pubs.opengroup.org/onlinepubs/009695399/functions/bind.html while here remove some unnecessary initialization of port and addr members and replace with a comment explaining why. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_bind.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/sys/t_bind.c diff -u src/tests/lib/libc/sys/t_bind.c:1.1 src/tests/lib/libc/sys/t_bind.c:1.2 --- src/tests/lib/libc/sys/t_bind.c:1.1 Sun Apr 5 06:36:52 2015 +++ src/tests/lib/libc/sys/t_bind.c Sun Apr 5 23:15:54 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: t_bind.c,v 1.1 2015/04/05 06:36:52 martin Exp $ */ +/* $NetBSD: t_bind.c,v 1.2 2015/04/05 23:15:54 rtr Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. * All rights reserved. @@ -50,17 +50,21 @@ ATF_TC_BODY(bind_foreign_family, tc) { struct sockaddr_in addr; + /* addr.sin_family = AF_UNSPEC = 0 */ memset(addr, 0, sizeof(addr)); - /* use a sin_family != the socket type */ - addr.sin_port = htons(8000); - addr.sin_addr.s_addr = INADDR_ANY; + + /* + * it is not necessary to initialize sin_{addr,port} since + * those structure members shall not be accessed if bind + * fails correctly. + */ int sock = socket(AF_LOCAL, SOCK_STREAM, 0); ATF_REQUIRE(sock != -1); /* should fail but currently doesn't */ ATF_REQUIRE(-1 == bind(sock, (struct sockaddr *)addr, sizeof(addr))); - ATF_REQUIRE(EINVAL == errno); + ATF_REQUIRE(EAFNOSUPPORT == errno); close(sock); }
CVS commit: src/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 20:33:45 UTC 2015 Modified Files: src/lib/libc/sys: bind.2 Log Message: Note that bind(2) can fail with EAFNOSUPPORT. The description of why is taken from the connect(2) manpage. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/lib/libc/sys/bind.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/bind.2 diff -u src/lib/libc/sys/bind.2:1.27 src/lib/libc/sys/bind.2:1.28 --- src/lib/libc/sys/bind.2:1.27 Mon May 31 12:16:20 2010 +++ src/lib/libc/sys/bind.2 Sun Apr 5 20:33:45 2015 @@ -1,4 +1,4 @@ -.\ $NetBSD: bind.2,v 1.27 2010/05/31 12:16:20 njoly Exp $ +.\ $NetBSD: bind.2,v 1.28 2015/04/05 20:33:45 rtr Exp $ .\ .\ Copyright (c) 1983, 1993 .\ The Regents of the University of California. All rights reserved. @@ -85,6 +85,8 @@ is not a valid descriptor. is not a socket. .It Bq Er EADDRNOTAVAIL The specified address is not available from the local machine. +.It Bq Er EAFNOSUPPORT +Addresses in the specified address family cannot be used with this socket. .It Bq Er EADDRINUSE The specified address is already in use. .It Bq Er EINVAL
CVS commit: src/lib/libc/sys
Module Name:src Committed By: rtr Date: Sun Apr 5 20:33:45 UTC 2015 Modified Files: src/lib/libc/sys: bind.2 Log Message: Note that bind(2) can fail with EAFNOSUPPORT. The description of why is taken from the connect(2) manpage. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/lib/libc/sys/bind.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sun Apr 5 02:26:39 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: make bind() fail with EINVAL if the address family of the provided socket does not match the address family of the sockaddr received. To generate a diff of this commit: cvs rdiff -u -r1.236 -r1.237 src/sys/kern/uipc_socket.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.236 src/sys/kern/uipc_socket.c:1.237 --- src/sys/kern/uipc_socket.c:1.236 Fri Apr 3 20:01:07 2015 +++ src/sys/kern/uipc_socket.c Sun Apr 5 02:26:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.236 2015/04/03 20:01:07 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.237 2015/04/05 02:26:39 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.236 2015/04/03 20:01:07 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.237 2015/04/05 02:26:39 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -629,6 +629,10 @@ sobind(struct socket *so, struct sockadd int error; solock(so); + if (nam-sa_family != so-so_proto-pr_domain-dom_family) { + sounlock(so); + return EINVAL; + } error = (*so-so_proto-pr_usrreqs-pr_bind)(so, nam, l); sounlock(so); return error;
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sun Apr 5 02:26:39 UTC 2015 Modified Files: src/sys/kern: uipc_socket.c Log Message: make bind() fail with EINVAL if the address family of the provided socket does not match the address family of the sockaddr received. To generate a diff of this commit: cvs rdiff -u -r1.236 -r1.237 src/sys/kern/uipc_socket.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Fri Apr 3 20:01:08 UTC 2015 Modified Files: src/sys/compat/linux/common: linux_socket.c src/sys/compat/svr4: svr4_stream.c src/sys/kern: uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: in_pcb.c in_pcb.h raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: in6_pcb.c in6_pcb.h raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/nfs: nfs_boot.c nfs_socket.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: param.h protosw.h socket.h socketvar.h Log Message: * change pr_bind to accept struct sockaddr * instead of struct mbuf * * update protocol bind implementations to use/expect sockaddr * instead of mbuf * * introduce sockaddr_big struct for storage of addr data passed via sys_bind; sockaddr_big is of sufficient size and alignment to accommodate all addr data sizes received. * modify sys_bind to allocate sockaddr_big instead of using an mbuf. * bump kernel version to 7.99.9 for change to pr_bind() parameter type. Patch posted to tech-net@ http://mail-index.netbsd.org/tech-net/2015/03/15/msg005004.html The choice to use a new structure sockaddr_big has been retained since changing sockaddr_storage size would lead to unnecessary ABI change. The use of the new structure does not preclude future work that increases the size of sockaddr_storage and at that time sockaddr_big may be trivially replaced. Tested by mrg@ and myself, discussed with rmind@, posted to tech-net@ To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/sys/compat/linux/common/linux_socket.c cvs rdiff -u -r1.81 -r1.82 src/sys/compat/svr4/svr4_stream.c cvs rdiff -u -r1.235 -r1.236 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.174 -r1.175 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.175 -r1.176 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.161 -r1.162 src/sys/net/if_gre.c cvs rdiff -u -r1.24 -r1.25 src/sys/net/link_proto.c cvs rdiff -u -r1.166 -r1.167 src/sys/net/rtsock.c cvs rdiff -u -r1.63 -r1.64 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.40 -r1.41 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.31 -r1.32 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.33 -r1.34 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.155 -r1.156 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.55 -r1.56 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.146 -r1.147 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.204 -r1.205 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.217 -r1.218 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.134 -r1.135 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.41 -r1.42 src/sys/netinet6/in6_pcb.h cvs rdiff -u -r1.136 -r1.137 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.116 -r1.117 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.44 -r1.45 src/sys/netipsec/keysock.c cvs rdiff -u -r1.24 -r1.25 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.45 -r1.46 src/sys/netnatm/natm.c cvs rdiff -u -r1.82 -r1.83 src/sys/nfs/nfs_boot.c cvs rdiff -u -r1.193 -r1.194 src/sys/nfs/nfs_socket.c cvs rdiff -u -r1.58 -r1.59 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.468 -r1.469 src/sys/sys/param.h cvs rdiff -u -r1.60 -r1.61 src/sys/sys/protosw.h cvs rdiff -u -r1.116 -r1.117 src/sys/sys/socket.h cvs rdiff -u -r1.135 -r1.136 src/sys/sys/socketvar.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/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.122 src/sys/compat/linux/common/linux_socket.c:1.123 --- src/sys/compat/linux/common/linux_socket.c:1.122 Wed Nov 26 09:53:53 2014 +++ src/sys/compat/linux/common/linux_socket.c Fri Apr 3 20:01:07 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.122 2014/11/26 09:53:53 ozaki-r Exp $ */ +/* $NetBSD: linux_socket.c,v 1.123 2015/04/03 20:01:07 rtr Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: linux_socket.c,v 1.122 2014/11/26 09:53:53 ozaki-r Exp $); +__KERNEL_RCSID(0, $NetBSD: linux_socket.c,v 1.123 2015/04/03 20:01:07 rtr Exp $); #if defined(_KERNEL_OPT) #include opt_inet.h @@ -121,6 +121,8 @@ int linux_getifconf(struct lwp *, regist int linux_getifhwaddr(struct lwp *, register_t *, u_int, void *); static int linux_get_sa(struct lwp *, int, struct mbuf **, const struct osockaddr *, unsigned int); +static int linux_get_sa_sb(struct lwp *, int, struct sockaddr_big *, + const struct osockaddr *, socklen_t); static int linux_sa_put(struct osockaddr *osa); static int linux_to_bsd_msg_flags(int); static int bsd_to_linux_msg_flags(int); @@ -1445,14
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Fri Apr 3 20:01:08 UTC 2015 Modified Files: src/sys/compat/linux/common: linux_socket.c src/sys/compat/svr4: svr4_stream.c src/sys/kern: uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: in_pcb.c in_pcb.h raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: in6_pcb.c in6_pcb.h raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/nfs: nfs_boot.c nfs_socket.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: param.h protosw.h socket.h socketvar.h Log Message: * change pr_bind to accept struct sockaddr * instead of struct mbuf * * update protocol bind implementations to use/expect sockaddr * instead of mbuf * * introduce sockaddr_big struct for storage of addr data passed via sys_bind; sockaddr_big is of sufficient size and alignment to accommodate all addr data sizes received. * modify sys_bind to allocate sockaddr_big instead of using an mbuf. * bump kernel version to 7.99.9 for change to pr_bind() parameter type. Patch posted to tech-net@ http://mail-index.netbsd.org/tech-net/2015/03/15/msg005004.html The choice to use a new structure sockaddr_big has been retained since changing sockaddr_storage size would lead to unnecessary ABI change. The use of the new structure does not preclude future work that increases the size of sockaddr_storage and at that time sockaddr_big may be trivially replaced. Tested by mrg@ and myself, discussed with rmind@, posted to tech-net@ To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/sys/compat/linux/common/linux_socket.c cvs rdiff -u -r1.81 -r1.82 src/sys/compat/svr4/svr4_stream.c cvs rdiff -u -r1.235 -r1.236 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.174 -r1.175 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.175 -r1.176 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.161 -r1.162 src/sys/net/if_gre.c cvs rdiff -u -r1.24 -r1.25 src/sys/net/link_proto.c cvs rdiff -u -r1.166 -r1.167 src/sys/net/rtsock.c cvs rdiff -u -r1.63 -r1.64 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.40 -r1.41 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.31 -r1.32 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.33 -r1.34 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.155 -r1.156 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.55 -r1.56 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.146 -r1.147 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.204 -r1.205 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.217 -r1.218 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.134 -r1.135 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.41 -r1.42 src/sys/netinet6/in6_pcb.h cvs rdiff -u -r1.136 -r1.137 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.116 -r1.117 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.44 -r1.45 src/sys/netipsec/keysock.c cvs rdiff -u -r1.24 -r1.25 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.45 -r1.46 src/sys/netnatm/natm.c cvs rdiff -u -r1.82 -r1.83 src/sys/nfs/nfs_boot.c cvs rdiff -u -r1.193 -r1.194 src/sys/nfs/nfs_socket.c cvs rdiff -u -r1.58 -r1.59 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.468 -r1.469 src/sys/sys/param.h cvs rdiff -u -r1.60 -r1.61 src/sys/sys/protosw.h cvs rdiff -u -r1.116 -r1.117 src/sys/sys/socket.h cvs rdiff -u -r1.135 -r1.136 src/sys/sys/socketvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sat Apr 4 04:33:39 UTC 2015 Modified Files: src/sys/netinet: dccp_usrreq.c src/sys/netinet6: dccp6_usrreq.c dccp6_var.h Log Message: * update dccp_bind for struct mbuf * to struct sockaddr * parameter change * pass NULL instead of casting 0 to a pointer when calling in_pcbbind() To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/dccp_usrreq.c cvs rdiff -u -r1.1 -r1.2 src/sys/netinet6/dccp6_usrreq.c \ src/sys/netinet6/dccp6_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/dccp_usrreq.c diff -u src/sys/netinet/dccp_usrreq.c:1.1 src/sys/netinet/dccp_usrreq.c:1.2 --- src/sys/netinet/dccp_usrreq.c:1.1 Tue Feb 10 19:11:52 2015 +++ src/sys/netinet/dccp_usrreq.c Sat Apr 4 04:33:38 2015 @@ -1,5 +1,5 @@ /* $KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $ */ -/* $NetBSD: dccp_usrreq.c,v 1.1 2015/02/10 19:11:52 rjs Exp $ */ +/* $NetBSD: dccp_usrreq.c,v 1.2 2015/04/04 04:33:38 rtr Exp $ */ /* * Copyright (c) 2003 Joacim Häggmark, Magnus Erixzon, Nils-Erik Mattsson @@ -67,7 +67,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: dccp_usrreq.c,v 1.1 2015/02/10 19:11:52 rjs Exp $); +__KERNEL_RCSID(0, $NetBSD: dccp_usrreq.c,v 1.2 2015/04/04 04:33:38 rtr Exp $); #include opt_inet.h #include opt_dccp.h @@ -1820,12 +1820,11 @@ out: } static int -dccp_bind(struct socket *so, struct mbuf *m, struct lwp *l) +dccp_bind(struct socket *so, struct sockaddr *nam, struct lwp *l) { struct inpcb *inp; int error; - struct sockaddr_in *sinp; - struct sockaddr *nam; + struct sockaddr_in *sin = (struct sockaddr_in *)nam; DCCP_DEBUG((LOG_INFO, Entering dccp_bind!\n)); INP_INFO_WLOCK(dccpbinfo); @@ -1836,15 +1835,13 @@ dccp_bind(struct socket *so, struct mbuf } /* Do not bind to multicast addresses! */ - nam = mtod(m, struct sockaddr *); - sinp = (struct sockaddr_in *)nam; - if (sinp-sin_family == AF_INET - IN_MULTICAST(ntohl(sinp-sin_addr.s_addr))) { + if (sin-sin_family == AF_INET + IN_MULTICAST(ntohl(sin-sin_addr.s_addr))) { INP_INFO_WUNLOCK(dccpbinfo); return EAFNOSUPPORT; } INP_LOCK(inp); - error = in_pcbbind(inp, m, l); + error = in_pcbbind(inp, sin, l); INP_UNLOCK(inp); INP_INFO_WUNLOCK(dccpbinfo); return error; @@ -1964,11 +1961,11 @@ dccp_doconnect(struct socket *so, struct #ifdef INET6 if (isipv6) { DCCP_DEBUG((LOG_INFO, Running in6_pcbbind!\n)); - error = in6_pcbbind(in6p, (struct mbuf *)0, l); + error = in6_pcbbind(in6p, NULL, l); } else #endif /* INET6 */ { - error = in_pcbbind(inp, (struct mbuf *)0, l); + error = in_pcbbind(inp, NULL, l); } if (error) { DCCP_DEBUG((LOG_INFO, in_pcbbind=%d\n,error)); @@ -2260,7 +2257,7 @@ dccp_listen(struct socket *so, struct lw INP_INFO_RUNLOCK(dccpbinfo); dp = (struct dccpcb *)inp-inp_ppcb; if (inp-inp_lport == 0) - error = in_pcbbind(inp, (struct mbuf *)0, td); + error = in_pcbbind(inp, NULL, td); if (error == 0) { dp-state = DCCPS_LISTEN; dp-who = DCCP_LISTENER; Index: src/sys/netinet6/dccp6_usrreq.c diff -u src/sys/netinet6/dccp6_usrreq.c:1.1 src/sys/netinet6/dccp6_usrreq.c:1.2 --- src/sys/netinet6/dccp6_usrreq.c:1.1 Tue Feb 10 19:11:52 2015 +++ src/sys/netinet6/dccp6_usrreq.c Sat Apr 4 04:33:39 2015 @@ -1,5 +1,5 @@ /* $KAME: dccp6_usrreq.c,v 1.13 2005/07/27 08:42:56 nishida Exp $ */ -/* $NetBSD: dccp6_usrreq.c,v 1.1 2015/02/10 19:11:52 rjs Exp $ */ +/* $NetBSD: dccp6_usrreq.c,v 1.2 2015/04/04 04:33:39 rtr Exp $ */ /* * Copyright (C) 2003 WIDE Project. @@ -31,7 +31,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: dccp6_usrreq.c,v 1.1 2015/02/10 19:11:52 rjs Exp $); +__KERNEL_RCSID(0, $NetBSD: dccp6_usrreq.c,v 1.2 2015/04/04 04:33:39 rtr Exp $); #include opt_inet.h #include opt_dccp.h @@ -111,12 +111,11 @@ dccp6_ctlinput(int cmd, const struct soc } int -dccp6_bind(struct socket *so, struct mbuf *m, struct lwp *td) +dccp6_bind(struct socket *so, struct sockaddr *nam, struct lwp *td) { struct in6pcb *in6p; - struct sockaddr *nam; int error; - struct sockaddr_in6 *sin6p; + struct sockaddr_in6 *sin6p = (struct sockaddr_in6 *)nam; DCCP_DEBUG((LOG_INFO, Entering dccp6_bind!\n)); INP_INFO_WLOCK(dccpbinfo); @@ -127,8 +126,6 @@ dccp6_bind(struct socket *so, struct mbu return EINVAL; } /* Do not bind to multicast addresses! */ - nam = mtod(m, struct sockaddr *); - sin6p = (struct sockaddr_in6 *)nam; if (sin6p-sin6_family == AF_INET6 IN6_IS_ADDR_MULTICAST(sin6p-sin6_addr)) { INP_INFO_WUNLOCK(dccpbinfo); @@ -139,7 +136,7 @@ dccp6_bind(struct socket *so, struct mbu in6todccpcb(in6p)-inp_vflag = ~INP_IPV4; in6todccpcb(in6p)-inp_vflag |= INP_IPV6; - error = in6_pcbbind(in6p, m, td); + error = in6_pcbbind(in6p, sin6p, td); INP_UNLOCK(inp); INP_INFO_WUNLOCK(dccpbinfo); return error; @@ -253,7
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sat Apr 4 04:33:39 UTC 2015 Modified Files: src/sys/netinet: dccp_usrreq.c src/sys/netinet6: dccp6_usrreq.c dccp6_var.h Log Message: * update dccp_bind for struct mbuf * to struct sockaddr * parameter change * pass NULL instead of casting 0 to a pointer when calling in_pcbbind() To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/dccp_usrreq.c cvs rdiff -u -r1.1 -r1.2 src/sys/netinet6/dccp6_usrreq.c \ src/sys/netinet6/dccp6_var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sat Mar 14 02:08:16 UTC 2015 Modified Files: src/sys/netinet: tcp_input.c Log Message: Move code that is conditional on options INET6 into #ifdef INET6. * Re-organize some variable declarations to limit #ifdef's. * Move INET and INET6 code into respective switch cases to simplify #ifdef INET6. No intended functional change. To generate a diff of this commit: cvs rdiff -u -r1.336 -r1.337 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.336 src/sys/netinet/tcp_input.c:1.337 --- src/sys/netinet/tcp_input.c:1.336 Sat Feb 14 12:57:53 2015 +++ src/sys/netinet/tcp_input.c Sat Mar 14 02:08:16 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.336 2015/02/14 12:57:53 he Exp $ */ +/* $NetBSD: tcp_input.c,v 1.337 2015/03/14 02:08:16 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -148,7 +148,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.336 2015/02/14 12:57:53 he Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.337 2015/03/14 02:08:16 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -3191,9 +3191,11 @@ tcp_signature(struct mbuf *m, struct tcp MD5_CTX ctx; struct ip *ip; struct ipovly *ipovly; +#ifdef INET6 struct ip6_hdr *ip6; - struct ippseudo ippseudo; struct ip6_hdr_pseudo ip6pseudo; +#endif /* INET6 */ + struct ippseudo ippseudo; struct tcphdr th0; int l, tcphdrlen; @@ -3204,20 +3206,8 @@ tcp_signature(struct mbuf *m, struct tcp switch (mtod(m, struct ip *)-ip_v) { case 4: + MD5Init(ctx); ip = mtod(m, struct ip *); - ip6 = NULL; - break; - case 6: - ip = NULL; - ip6 = mtod(m, struct ip6_hdr *); - break; - default: - return (-1); - } - - MD5Init(ctx); - - if (ip) { memset(ippseudo, 0, sizeof(ippseudo)); ipovly = (struct ipovly *)ip; ippseudo.ippseudo_src = ipovly-ih_src; @@ -3226,7 +3216,11 @@ tcp_signature(struct mbuf *m, struct tcp ippseudo.ippseudo_p = IPPROTO_TCP; ippseudo.ippseudo_len = htons(m-m_pkthdr.len - thoff); MD5Update(ctx, (char *)ippseudo, sizeof(ippseudo)); - } else { + break; +#if INET6 + case 6: + MD5Init(ctx); + ip6 = mtod(m, struct ip6_hdr *); memset(ip6pseudo, 0, sizeof(ip6pseudo)); ip6pseudo.ip6ph_src = ip6-ip6_src; in6_clearscope(ip6pseudo.ip6ph_src); @@ -3235,6 +3229,10 @@ tcp_signature(struct mbuf *m, struct tcp ip6pseudo.ip6ph_len = htons(m-m_pkthdr.len - thoff); ip6pseudo.ip6ph_nxt = IPPROTO_TCP; MD5Update(ctx, (char *)ip6pseudo, sizeof(ip6pseudo)); + break; +#endif /* INET6 */ + default: + return (-1); } th0 = *th;
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sat Mar 14 02:08:16 UTC 2015 Modified Files: src/sys/netinet: tcp_input.c Log Message: Move code that is conditional on options INET6 into #ifdef INET6. * Re-organize some variable declarations to limit #ifdef's. * Move INET and INET6 code into respective switch cases to simplify #ifdef INET6. No intended functional change. To generate a diff of this commit: cvs rdiff -u -r1.336 -r1.337 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.
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Fri Mar 6 03:35:00 UTC 2015 Modified Files: src/sys/kern: uipc_syscalls.c Log Message: Return EINVAL if namelen isn't large enough to encompass the expected members of sockaddr structures. i.e. sa_len and sa_family. Discussed with and patch by christos@ To generate a diff of this commit: cvs rdiff -u -r1.173 -r1.174 src/sys/kern/uipc_syscalls.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/kern/uipc_syscalls.c diff -u src/sys/kern/uipc_syscalls.c:1.173 src/sys/kern/uipc_syscalls.c:1.174 --- src/sys/kern/uipc_syscalls.c:1.173 Fri Sep 5 09:20:59 2014 +++ src/sys/kern/uipc_syscalls.c Fri Mar 6 03:35:00 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_syscalls.c,v 1.173 2014/09/05 09:20:59 matt Exp $ */ +/* $NetBSD: uipc_syscalls.c,v 1.174 2015/03/06 03:35:00 rtr Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.173 2014/09/05 09:20:59 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.174 2015/03/06 03:35:00 rtr Exp $); #include opt_pipe.h @@ -1463,6 +1463,12 @@ sockargs(struct mbuf **mp, const void *b if (buflen (type == MT_SONAME ? UCHAR_MAX : PAGE_SIZE)) return EINVAL; + /* + * length must greater than sizeof(sa_family) + sizeof(sa_len) + */ + if (type == MT_SONAME buflen = 2) + return EINVAL; + /* Allocate an mbuf to hold the arguments. */ m = m_get(M_WAIT, type); /* can't claim. don't who to assign it to. */
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Fri Mar 6 03:35:00 UTC 2015 Modified Files: src/sys/kern: uipc_syscalls.c Log Message: Return EINVAL if namelen isn't large enough to encompass the expected members of sockaddr structures. i.e. sa_len and sa_family. Discussed with and patch by christos@ To generate a diff of this commit: cvs rdiff -u -r1.173 -r1.174 src/sys/kern/uipc_syscalls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sat Feb 28 21:42:01 UTC 2015 Modified Files: src/sys/kern: uipc_usrreq.c Log Message: Place opening brace to function at column 0, like in the rest of the file. To generate a diff of this commit: cvs rdiff -u -r1.173 -r1.174 src/sys/kern/uipc_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/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.173 src/sys/kern/uipc_usrreq.c:1.174 --- src/sys/kern/uipc_usrreq.c:1.173 Mon Feb 2 02:28:26 2015 +++ src/sys/kern/uipc_usrreq.c Sat Feb 28 21:42:01 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.173 2015/02/02 02:28:26 christos Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.174 2015/02/28 21:42:01 rtr Exp $ */ /*- * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.173 2015/02/02 02:28:26 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.174 2015/02/28 21:42:01 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -920,7 +920,8 @@ unp_sockaddr(struct socket *so, struct m * what it calls abstract unix sockets. */ static struct sockaddr_un * -makeun(struct mbuf *nam, size_t *addrlen) { +makeun(struct mbuf *nam, size_t *addrlen) +{ struct sockaddr_un *sun; *addrlen = nam-m_len + 1;
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Sat Feb 28 21:42:01 UTC 2015 Modified Files: src/sys/kern: uipc_usrreq.c Log Message: Place opening brace to function at column 0, like in the rest of the file. To generate a diff of this commit: cvs rdiff -u -r1.173 -r1.174 src/sys/kern/uipc_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sat Aug 9 05:33:01 UTC 2014 Modified Files: src/sys/kern: uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/miscfs/fifofs: fifo_vnops.c src/sys/net: if.c link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h un.h Log Message: split PRU_CONNECT2 PRU_PURGEIF function out of pr_generic() usrreq switches and put into separate functions - always KASSERT(solocked(so)) even if not implemented (for PRU_CONNECT2 only) - replace calls to pr_generic() with req = PRU_CONNECT2 with calls to pr_connect2() - replace calls to pr_generic() with req = PRU_PURGEIF with calls to pr_purgeif() put common code from unp_connect2() (used by unp_connect() into unp_connect1() and call out to it when needed patch only briefly reviewed by rmind@ To generate a diff of this commit: cvs rdiff -u -r1.233 -r1.234 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.171 -r1.172 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.168 -r1.169 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.76 -r1.77 src/sys/miscfs/fifofs/fifo_vnops.c cvs rdiff -u -r1.289 -r1.290 src/sys/net/if.c cvs rdiff -u -r1.23 -r1.24 src/sys/net/link_proto.c cvs rdiff -u -r1.51 -r1.52 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.162 -r1.163 src/sys/net/rtsock.c cvs rdiff -u -r1.62 -r1.63 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.39 -r1.40 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.30 -r1.31 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.32 -r1.33 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.144 -r1.145 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.199 -r1.200 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.216 -r1.217 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.135 -r1.136 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.114 -r1.115 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.42 -r1.43 src/sys/netipsec/keysock.c cvs rdiff -u -r1.23 -r1.24 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.44 -r1.45 src/sys/netnatm/natm.c cvs rdiff -u -r1.57 -r1.58 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.59 -r1.60 src/sys/sys/protosw.h cvs rdiff -u -r1.54 -r1.55 src/sys/sys/un.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.233 src/sys/kern/uipc_socket.c:1.234 --- src/sys/kern/uipc_socket.c:1.233 Fri Aug 8 03:05:45 2014 +++ src/sys/kern/uipc_socket.c Sat Aug 9 05:33:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.233 2014/08/08 03:05:45 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.234 2014/08/09 05:33:00 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.233 2014/08/08 03:05:45 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.234 2014/08/09 05:33:00 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -836,8 +836,7 @@ soconnect2(struct socket *so1, struct so { KASSERT(solocked2(so1, so2)); - return (*so1-so_proto-pr_usrreqs-pr_generic)(so1, - PRU_CONNECT2, NULL, (struct mbuf *)so2, NULL, NULL); + return (*so1-so_proto-pr_usrreqs-pr_connect2)(so1, so2); } int Index: src/sys/kern/uipc_syscalls.c diff -u src/sys/kern/uipc_syscalls.c:1.171 src/sys/kern/uipc_syscalls.c:1.172 --- src/sys/kern/uipc_syscalls.c:1.171 Wed Jul 9 04:54:03 2014 +++ src/sys/kern/uipc_syscalls.c Sat Aug 9 05:33:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_syscalls.c,v 1.171 2014/07/09 04:54:03 rtr Exp $ */ +/* $NetBSD: uipc_syscalls.c,v 1.172 2014/08/09 05:33:00 rtr Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.171 2014/07/09 04:54:03 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_syscalls.c,v 1.172 2014/08/09 05:33:00 rtr Exp $); #include opt_pipe.h @@ -1276,7 +1276,7 @@ pipe1(struct lwp *l, register_t *retval, wf-f_data = wso; retval[1] = fd; solock(wso); - error = unp_connect2(wso, rso, PRU_CONNECT2); + error = unp_connect2(wso, rso); sounlock(wso); if (error != 0) goto free4; Index: src/sys/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.168 src/sys/kern/uipc_usrreq.c:1.169 --- src/sys/kern/uipc_usrreq.c:1.168 Fri Aug 8 03:05:45 2014 +++ src/sys/kern/uipc_usrreq.c Sat Aug 9 05:33:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.168 2014/08/08 03:05:45 rtr Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.169
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sat Aug 9 05:33:01 UTC 2014 Modified Files: src/sys/kern: uipc_socket.c uipc_syscalls.c uipc_usrreq.c src/sys/miscfs/fifofs: fifo_vnops.c src/sys/net: if.c link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h un.h Log Message: split PRU_CONNECT2 PRU_PURGEIF function out of pr_generic() usrreq switches and put into separate functions - always KASSERT(solocked(so)) even if not implemented (for PRU_CONNECT2 only) - replace calls to pr_generic() with req = PRU_CONNECT2 with calls to pr_connect2() - replace calls to pr_generic() with req = PRU_PURGEIF with calls to pr_purgeif() put common code from unp_connect2() (used by unp_connect() into unp_connect1() and call out to it when needed patch only briefly reviewed by rmind@ To generate a diff of this commit: cvs rdiff -u -r1.233 -r1.234 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.171 -r1.172 src/sys/kern/uipc_syscalls.c cvs rdiff -u -r1.168 -r1.169 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.76 -r1.77 src/sys/miscfs/fifofs/fifo_vnops.c cvs rdiff -u -r1.289 -r1.290 src/sys/net/if.c cvs rdiff -u -r1.23 -r1.24 src/sys/net/link_proto.c cvs rdiff -u -r1.51 -r1.52 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.162 -r1.163 src/sys/net/rtsock.c cvs rdiff -u -r1.62 -r1.63 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.39 -r1.40 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.30 -r1.31 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.32 -r1.33 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.144 -r1.145 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.199 -r1.200 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.216 -r1.217 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.135 -r1.136 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.114 -r1.115 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.42 -r1.43 src/sys/netipsec/keysock.c cvs rdiff -u -r1.23 -r1.24 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.44 -r1.45 src/sys/netnatm/natm.c cvs rdiff -u -r1.57 -r1.58 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.59 -r1.60 src/sys/sys/protosw.h cvs rdiff -u -r1.54 -r1.55 src/sys/sys/un.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netatalk
Module Name:src Committed By: rtr Date: Thu Aug 7 07:51:28 UTC 2014 Modified Files: src/sys/netatalk: ddp_usrreq.c Log Message: suppress possibly used uninitialized warning on sgimips from martin@ To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/netatalk/ddp_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/netatalk/ddp_usrreq.c diff -u src/sys/netatalk/ddp_usrreq.c:1.60 src/sys/netatalk/ddp_usrreq.c:1.61 --- src/sys/netatalk/ddp_usrreq.c:1.60 Thu Aug 7 01:02:30 2014 +++ src/sys/netatalk/ddp_usrreq.c Thu Aug 7 07:51:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ddp_usrreq.c,v 1.60 2014/08/07 01:02:30 rtr Exp $ */ +/* $NetBSD: ddp_usrreq.c,v 1.61 2014/08/07 07:51:28 rtr Exp $ */ /* * Copyright (c) 1990,1991 Regents of The University of Michigan. @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ddp_usrreq.c,v 1.60 2014/08/07 01:02:30 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: ddp_usrreq.c,v 1.61 2014/08/07 07:51:28 rtr Exp $); #include opt_mbuftrace.h @@ -541,7 +541,7 @@ ddp_send(struct socket *so, struct mbuf { struct ddpcb *ddp = sotoddpcb(so); int error = 0; - int s; + int s = 0; /* XXX gcc 4.8 warns on sgimips */ KASSERT(solocked(so)); KASSERT(ddp != NULL);
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Fri Aug 8 03:05:45 UTC 2014 Modified Files: src/sys/dev: kttcp.c src/sys/kern: uipc_socket.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm.h rfcomm_socket.c rfcomm_upper.c sco_socket.c src/sys/netinet: raw_ip.c tcp_input.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h Log Message: split PRU_RCVD function out of pr_generic() usrreq switches and put into separate functions - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_RCVD with calls to pr_rcvd() To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/kttcp.c cvs rdiff -u -r1.232 -r1.233 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.167 -r1.168 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.158 -r1.159 src/sys/net/if_gre.c cvs rdiff -u -r1.22 -r1.23 src/sys/net/link_proto.c cvs rdiff -u -r1.50 -r1.51 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.161 -r1.162 src/sys/net/rtsock.c cvs rdiff -u -r1.61 -r1.62 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.38 -r1.39 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.29 -r1.30 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/rfcomm.h cvs rdiff -u -r1.31 -r1.32 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.20 -r1.21 src/sys/netbt/rfcomm_upper.c cvs rdiff -u -r1.143 -r1.144 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.333 -r1.334 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.198 -r1.199 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.215 -r1.216 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.134 -r1.135 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.113 -r1.114 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.41 -r1.42 src/sys/netipsec/keysock.c cvs rdiff -u -r1.22 -r1.23 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.43 -r1.44 src/sys/netnatm/natm.c cvs rdiff -u -r1.56 -r1.57 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.58 -r1.59 src/sys/sys/protosw.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/dev/kttcp.c diff -u src/sys/dev/kttcp.c:1.36 src/sys/dev/kttcp.c:1.37 --- src/sys/dev/kttcp.c:1.36 Tue Aug 5 07:55:31 2014 +++ src/sys/dev/kttcp.c Fri Aug 8 03:05:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: kttcp.c,v 1.36 2014/08/05 07:55:31 rtr Exp $ */ +/* $NetBSD: kttcp.c,v 1.37 2014/08/08 03:05:44 rtr Exp $ */ /* * Copyright (c) 2002 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kttcp.c,v 1.36 2014/08/05 07:55:31 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: kttcp.c,v 1.37 2014/08/08 03:05:44 rtr Exp $); #include sys/param.h #include sys/types.h @@ -635,8 +635,7 @@ kttcp_soreceive(struct socket *so, unsig * get it filled again. */ if ((pr-pr_flags PR_WANTRCVD) so-so_pcb) { -(*pr-pr_usrreqs-pr_generic)(so, PRU_RCVD, NULL, -(struct mbuf *)(long)flags, NULL, NULL); +(*pr-pr_usrreqs-pr_rcvd)(so, flags, l); } SBLASTRECORDCHK(so-so_rcv, kttcp_soreceive sbwait 2); @@ -675,8 +674,7 @@ kttcp_soreceive(struct socket *so, unsig SBLASTRECORDCHK(so-so_rcv, kttcp_soreceive 4); SBLASTMBUFCHK(so-so_rcv, kttcp_soreceive 4); if (pr-pr_flags PR_WANTRCVD so-so_pcb) { - (*pr-pr_usrreqs-pr_generic)(so, PRU_RCVD, NULL, - (struct mbuf *)(long)flags, NULL, NULL); + (*pr-pr_usrreqs-pr_rcvd)(so, flags, l); } } if (orig_resid == resid orig_resid Index: src/sys/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.232 src/sys/kern/uipc_socket.c:1.233 --- src/sys/kern/uipc_socket.c:1.232 Tue Aug 5 07:55:31 2014 +++ src/sys/kern/uipc_socket.c Fri Aug 8 03:05:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.232 2014/08/05 07:55:31 rtr Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.233 2014/08/08 03:05:45 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.232 2014/08/05 07:55:31 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.233 2014/08/08 03:05:45 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -1532,8 +1532,7 @@ soreceive(struct socket *so, struct mbuf * get it filled again. */ if ((pr-pr_flags PR_WANTRCVD) so-so_pcb) -(*pr-pr_usrreqs-pr_generic)(so, PRU_RCVD, -NULL, (struct mbuf *)(long)flags, NULL, l); +(*pr-pr_usrreqs-pr_rcvd)(so, flags, l); SBLASTRECORDCHK(so-so_rcv, soreceive sbwait 2); SBLASTMBUFCHK(so-so_rcv, soreceive sbwait 2); if (wakeup_state
CVS commit: src/sys/netatalk
Module Name:src Committed By: rtr Date: Thu Aug 7 07:51:28 UTC 2014 Modified Files: src/sys/netatalk: ddp_usrreq.c Log Message: suppress possibly used uninitialized warning on sgimips from martin@ To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/netatalk/ddp_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Fri Aug 8 03:05:45 UTC 2014 Modified Files: src/sys/dev: kttcp.c src/sys/kern: uipc_socket.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm.h rfcomm_socket.c rfcomm_upper.c sco_socket.c src/sys/netinet: raw_ip.c tcp_input.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h Log Message: split PRU_RCVD function out of pr_generic() usrreq switches and put into separate functions - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_RCVD with calls to pr_rcvd() To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/kttcp.c cvs rdiff -u -r1.232 -r1.233 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.167 -r1.168 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.158 -r1.159 src/sys/net/if_gre.c cvs rdiff -u -r1.22 -r1.23 src/sys/net/link_proto.c cvs rdiff -u -r1.50 -r1.51 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.161 -r1.162 src/sys/net/rtsock.c cvs rdiff -u -r1.61 -r1.62 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.38 -r1.39 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.29 -r1.30 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/rfcomm.h cvs rdiff -u -r1.31 -r1.32 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.20 -r1.21 src/sys/netbt/rfcomm_upper.c cvs rdiff -u -r1.143 -r1.144 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.333 -r1.334 src/sys/netinet/tcp_input.c cvs rdiff -u -r1.198 -r1.199 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.215 -r1.216 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.134 -r1.135 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.113 -r1.114 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.41 -r1.42 src/sys/netipsec/keysock.c cvs rdiff -u -r1.22 -r1.23 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.43 -r1.44 src/sys/netnatm/natm.c cvs rdiff -u -r1.56 -r1.57 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.58 -r1.59 src/sys/sys/protosw.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netatalk
Module Name:src Committed By: rtr Date: Thu Aug 7 01:02:30 UTC 2014 Modified Files: src/sys/netatalk: ddp_usrreq.c Log Message: remove KASSERT(nam != NULL) from ddp_send() the following code makes the validity of it questionable. we'll investigate later whether it can be put back and the code simplified. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/netatalk/ddp_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/netatalk/ddp_usrreq.c diff -u src/sys/netatalk/ddp_usrreq.c:1.59 src/sys/netatalk/ddp_usrreq.c:1.60 --- src/sys/netatalk/ddp_usrreq.c:1.59 Tue Aug 5 07:55:31 2014 +++ src/sys/netatalk/ddp_usrreq.c Thu Aug 7 01:02:30 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ddp_usrreq.c,v 1.59 2014/08/05 07:55:31 rtr Exp $ */ +/* $NetBSD: ddp_usrreq.c,v 1.60 2014/08/07 01:02:30 rtr Exp $ */ /* * Copyright (c) 1990,1991 Regents of The University of Michigan. @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ddp_usrreq.c,v 1.59 2014/08/05 07:55:31 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: ddp_usrreq.c,v 1.60 2014/08/07 01:02:30 rtr Exp $); #include opt_mbuftrace.h @@ -545,7 +545,6 @@ ddp_send(struct socket *so, struct mbuf KASSERT(solocked(so)); KASSERT(ddp != NULL); - KASSERT(nam != NULL); if (nam) { if (ddp-ddp_fsat.sat_port != ATADDR_ANYPORT)
CVS commit: src/sys/netatalk
Module Name:src Committed By: rtr Date: Thu Aug 7 01:02:30 UTC 2014 Modified Files: src/sys/netatalk: ddp_usrreq.c Log Message: remove KASSERT(nam != NULL) from ddp_send() the following code makes the validity of it questionable. we'll investigate later whether it can be put back and the code simplified. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/netatalk/ddp_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Tue Aug 5 07:10:41 UTC 2014 Modified Files: src/sys/netinet: tcp_usrreq.c Log Message: get_tcppcb() is nearly always called upon entry to usrreqs so KASSERT(solocked(so)) inside it and remove the redundant KASSERT everywhere we are using tcp_getpcb() To generate a diff of this commit: cvs rdiff -u -r1.196 -r1.197 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.196 src/sys/netinet/tcp_usrreq.c:1.197 --- src/sys/netinet/tcp_usrreq.c:1.196 Tue Aug 5 05:24:26 2014 +++ src/sys/netinet/tcp_usrreq.c Tue Aug 5 07:10:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.196 2014/08/05 05:24:26 rtr Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.197 2014/08/05 07:10:41 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -99,7 +99,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.196 2014/08/05 05:24:26 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.197 2014/08/05 07:10:41 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -181,6 +181,9 @@ static int tcp_getpcb(struct socket *so, struct inpcb **inp, struct in6pcb **in6p, struct tcpcb **tp) { + + KASSERT(solocked(so)); + /* * When a TCP is attached to a socket, then there will be * a (struct inpcb) pointed at by the socket, and this @@ -273,8 +276,6 @@ tcp_usrreq(struct socket *so, int req, s return (0); } - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) { splx(s); return error; @@ -687,8 +688,6 @@ tcp_detach(struct socket *so) struct tcpcb *tp = NULL; int s; - KASSERT(solocked(so)); - if (tcp_getpcb(so, inp, in6p, tp) != 0) return; @@ -707,8 +706,6 @@ tcp_accept(struct socket *so, struct mbu int error = 0; int s; - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) return error; @@ -746,8 +743,6 @@ tcp_bind(struct socket *so, struct mbuf int error = 0; int ostate = 0; - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) return error; @@ -792,8 +787,6 @@ tcp_listen(struct socket *so, struct lwp int ostate = 0; int s; - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) return error; @@ -836,8 +829,6 @@ tcp_connect(struct socket *so, struct mb int error = 0; int ostate = 0; - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) return error; @@ -925,8 +916,6 @@ tcp_disconnect(struct socket *so) int ostate = 0; int s; - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) return error; @@ -961,8 +950,6 @@ tcp_shutdown(struct socket *so) int ostate = 0; int s; - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) return error; @@ -991,8 +978,6 @@ tcp_abort(struct socket *so) int ostate = 0; int s; - KASSERT(solocked(so)); - if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) return error;
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Tue Aug 5 07:55:32 UTC 2014 Modified Files: src/sys/dev: kttcp.c src/sys/dev/bluetooth: bthidev.c btmagic.c btsco.c src/sys/kern: uipc_socket.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c raw_cb.h raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap.h l2cap_lower.c l2cap_socket.c l2cap_upper.c rfcomm.h rfcomm_session.c rfcomm_socket.c rfcomm_upper.c sco.h sco_socket.c sco_upper.c src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/nfs: nfs_socket.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h Log Message: split PRU_SEND function out of pr_generic() usrreq switches and put into separate functions xxx_send(struct socket *, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *) - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_SEND with calls to pr_send() rename existing functions that operate on PCB for consistency (and to free up their names for xxx_send() PRUs - l2cap_send() - l2cap_send_pcb() - sco_send() - sco_send_pcb() - rfcomm_send() - rfcomm_send_pcb() patch reviewed by rmind To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/kttcp.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/bluetooth/bthidev.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/bluetooth/btmagic.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/bluetooth/btsco.c cvs rdiff -u -r1.231 -r1.232 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.165 -r1.166 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.157 -r1.158 src/sys/net/if_gre.c cvs rdiff -u -r1.21 -r1.22 src/sys/net/link_proto.c cvs rdiff -u -r1.22 -r1.23 src/sys/net/raw_cb.h cvs rdiff -u -r1.49 -r1.50 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.160 -r1.161 src/sys/net/rtsock.c cvs rdiff -u -r1.58 -r1.59 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.37 -r1.38 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/l2cap.h src/sys/netbt/l2cap_upper.c cvs rdiff -u -r1.9 -r1.10 src/sys/netbt/l2cap_lower.c cvs rdiff -u -r1.28 -r1.29 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.16 -r1.17 src/sys/netbt/rfcomm.h cvs rdiff -u -r1.22 -r1.23 src/sys/netbt/rfcomm_session.c cvs rdiff -u -r1.30 -r1.31 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.19 -r1.20 src/sys/netbt/rfcomm_upper.c cvs rdiff -u -r1.10 -r1.11 src/sys/netbt/sco.h cvs rdiff -u -r1.15 -r1.16 src/sys/netbt/sco_upper.c cvs rdiff -u -r1.142 -r1.143 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.197 -r1.198 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.214 -r1.215 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.133 -r1.134 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.112 -r1.113 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.40 -r1.41 src/sys/netipsec/keysock.c cvs rdiff -u -r1.21 -r1.22 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.42 -r1.43 src/sys/netnatm/natm.c cvs rdiff -u -r1.191 -r1.192 src/sys/nfs/nfs_socket.c cvs rdiff -u -r1.55 -r1.56 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.57 -r1.58 src/sys/sys/protosw.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/dev/kttcp.c diff -u src/sys/dev/kttcp.c:1.35 src/sys/dev/kttcp.c:1.36 --- src/sys/dev/kttcp.c:1.35 Fri Jul 25 08:10:35 2014 +++ src/sys/dev/kttcp.c Tue Aug 5 07:55:31 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: kttcp.c,v 1.35 2014/07/25 08:10:35 dholland Exp $ */ +/* $NetBSD: kttcp.c,v 1.36 2014/08/05 07:55:31 rtr Exp $ */ /* * Copyright (c) 2002 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kttcp.c,v 1.35 2014/07/25 08:10:35 dholland Exp $); +__KERNEL_RCSID(0, $NetBSD: kttcp.c,v 1.36 2014/08/05 07:55:31 rtr Exp $); #include sys/param.h #include sys/types.h @@ -324,8 +324,8 @@ nopages: error = (*so-so_proto-pr_usrreqs-pr_sendoob)(so, top, NULL); else -error = (*so-so_proto-pr_usrreqs-pr_generic)(so, -PRU_SEND, top, NULL, NULL, l); +error = (*so-so_proto-pr_usrreqs-pr_send)(so, +top, NULL, NULL, l); if (dontroute) so-so_options = ~SO_DONTROUTE; if (resid 0) Index: src/sys/dev/bluetooth/bthidev.c diff -u src/sys/dev/bluetooth/bthidev.c:1.28 src/sys/dev/bluetooth/bthidev.c:1.29 --- src/sys/dev/bluetooth/bthidev.c:1.28 Thu Jul 31 03:39:35 2014 +++ src/sys/dev/bluetooth/bthidev.c Tue Aug 5 07:55:31 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bthidev.c,v 1.28 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: bthidev.c,v 1.29 2014/08/05 07:55:31 rtr Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD:
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Tue Aug 5 08:52:10 UTC 2014 Modified Files: src/sys/kern: uipc_usrreq.c Log Message: actually use the passed in struct lwp *l instead of curlwp in unp_connect() To generate a diff of this commit: cvs rdiff -u -r1.166 -r1.167 src/sys/kern/uipc_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/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.166 src/sys/kern/uipc_usrreq.c:1.167 --- src/sys/kern/uipc_usrreq.c:1.166 Tue Aug 5 07:55:31 2014 +++ src/sys/kern/uipc_usrreq.c Tue Aug 5 08:52:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.166 2014/08/05 07:55:31 rtr Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.167 2014/08/05 08:52:10 rtr Exp $ */ /*- * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.166 2014/08/05 07:55:31 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.167 2014/08/05 08:52:10 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -1120,7 +1120,7 @@ unp_connect(struct socket *so, struct mb goto bad; } pathbuf_destroy(pb); - if ((error = VOP_ACCESS(vp, VWRITE, curlwp-l_cred)) != 0) + if ((error = VOP_ACCESS(vp, VWRITE, l-l_cred)) != 0) goto bad; /* Acquire v_interlock to protect against unp_detach(). */ mutex_enter(vp-v_interlock); @@ -1162,9 +1162,9 @@ unp_connect(struct socket *so, struct mb unp3-unp_addrlen = unp2-unp_addrlen; } unp3-unp_flags = unp2-unp_flags; - unp3-unp_connid.unp_pid = curlwp-l_proc-p_pid; - unp3-unp_connid.unp_euid = kauth_cred_geteuid(curlwp-l_cred); - unp3-unp_connid.unp_egid = kauth_cred_getegid(curlwp-l_cred); + unp3-unp_connid.unp_pid = l-l_proc-p_pid; + unp3-unp_connid.unp_euid = kauth_cred_geteuid(l-l_cred); + unp3-unp_connid.unp_egid = kauth_cred_getegid(l-l_cred); unp3-unp_flags |= UNP_EIDSVALID; if (unp2-unp_flags UNP_EIDSBIND) { unp-unp_connid = unp2-unp_connid;
CVS commit: src/sys/sys
Module Name:src Committed By: rtr Date: Tue Aug 5 14:02:42 UTC 2014 Modified Files: src/sys/sys: un.h Log Message: whitespace To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/sys/un.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/sys/un.h diff -u src/sys/sys/un.h:1.53 src/sys/sys/un.h:1.54 --- src/sys/sys/un.h:1.53 Tue Aug 5 05:24:27 2014 +++ src/sys/sys/un.h Tue Aug 5 14:02:42 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: un.h,v 1.53 2014/08/05 05:24:27 rtr Exp $ */ +/* $NetBSD: un.h,v 1.54 2014/08/05 14:02:42 rtr Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -79,15 +79,15 @@ struct sockopt; extern const struct pr_usrreqs unp_usrreqs; int uipc_ctloutput(int, struct socket *, struct sockopt *); -void uipc_init (void); -kmutex_t *uipc_dgramlock (void); -kmutex_t *uipc_streamlock (void); -kmutex_t *uipc_rawlock (void); - -int unp_connect (struct socket *, struct mbuf *, struct lwp *); -int unp_connect2 (struct socket *, struct socket *, int); -void unp_dispose (struct mbuf *); -int unp_externalize (struct mbuf *, struct lwp *, int); +void uipc_init(void); +kmutex_t *uipc_dgramlock(void); +kmutex_t *uipc_streamlock(void); +kmutex_t *uipc_rawlock(void); + +int unp_connect(struct socket *, struct mbuf *, struct lwp *); +int unp_connect2(struct socket *, struct socket *, int); +void unp_dispose(struct mbuf *); +int unp_externalize(struct mbuf *, struct lwp *, int); #else /* !_KERNEL */
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Tue Aug 5 07:10:41 UTC 2014 Modified Files: src/sys/netinet: tcp_usrreq.c Log Message: get_tcppcb() is nearly always called upon entry to usrreqs so KASSERT(solocked(so)) inside it and remove the redundant KASSERT everywhere we are using tcp_getpcb() To generate a diff of this commit: cvs rdiff -u -r1.196 -r1.197 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.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Tue Aug 5 07:55:32 UTC 2014 Modified Files: src/sys/dev: kttcp.c src/sys/dev/bluetooth: bthidev.c btmagic.c btsco.c src/sys/kern: uipc_socket.c uipc_usrreq.c src/sys/net: if_gre.c link_proto.c raw_cb.h raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap.h l2cap_lower.c l2cap_socket.c l2cap_upper.c rfcomm.h rfcomm_session.c rfcomm_socket.c rfcomm_upper.c sco.h sco_socket.c sco_upper.c src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/nfs: nfs_socket.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h Log Message: split PRU_SEND function out of pr_generic() usrreq switches and put into separate functions xxx_send(struct socket *, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *) - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_SEND with calls to pr_send() rename existing functions that operate on PCB for consistency (and to free up their names for xxx_send() PRUs - l2cap_send() - l2cap_send_pcb() - sco_send() - sco_send_pcb() - rfcomm_send() - rfcomm_send_pcb() patch reviewed by rmind To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/kttcp.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/bluetooth/bthidev.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/bluetooth/btmagic.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/bluetooth/btsco.c cvs rdiff -u -r1.231 -r1.232 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.165 -r1.166 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.157 -r1.158 src/sys/net/if_gre.c cvs rdiff -u -r1.21 -r1.22 src/sys/net/link_proto.c cvs rdiff -u -r1.22 -r1.23 src/sys/net/raw_cb.h cvs rdiff -u -r1.49 -r1.50 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.160 -r1.161 src/sys/net/rtsock.c cvs rdiff -u -r1.58 -r1.59 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.37 -r1.38 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/l2cap.h src/sys/netbt/l2cap_upper.c cvs rdiff -u -r1.9 -r1.10 src/sys/netbt/l2cap_lower.c cvs rdiff -u -r1.28 -r1.29 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.16 -r1.17 src/sys/netbt/rfcomm.h cvs rdiff -u -r1.22 -r1.23 src/sys/netbt/rfcomm_session.c cvs rdiff -u -r1.30 -r1.31 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.19 -r1.20 src/sys/netbt/rfcomm_upper.c cvs rdiff -u -r1.10 -r1.11 src/sys/netbt/sco.h cvs rdiff -u -r1.15 -r1.16 src/sys/netbt/sco_upper.c cvs rdiff -u -r1.142 -r1.143 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.197 -r1.198 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.214 -r1.215 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.133 -r1.134 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.112 -r1.113 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.40 -r1.41 src/sys/netipsec/keysock.c cvs rdiff -u -r1.21 -r1.22 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.42 -r1.43 src/sys/netnatm/natm.c cvs rdiff -u -r1.191 -r1.192 src/sys/nfs/nfs_socket.c cvs rdiff -u -r1.55 -r1.56 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.57 -r1.58 src/sys/sys/protosw.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: rtr Date: Tue Aug 5 08:52:10 UTC 2014 Modified Files: src/sys/kern: uipc_usrreq.c Log Message: actually use the passed in struct lwp *l instead of curlwp in unp_connect() To generate a diff of this commit: cvs rdiff -u -r1.166 -r1.167 src/sys/kern/uipc_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/sys
Module Name:src Committed By: rtr Date: Tue Aug 5 14:02:42 UTC 2014 Modified Files: src/sys/sys: un.h Log Message: whitespace To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/sys/un.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Tue Aug 5 05:24:27 UTC 2014 Modified Files: src/sys/kern: uipc_socket.c uipc_usrreq.c src/sys/net: link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: in_pcb.c in_pcb.h raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: in6_pcb.c in6_pcb.h raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h un.h Log Message: revert the removal of struct lwp * parameter from bind, listen and connect user requests. this should resolve the issue relating to nfs client hangs presented recently by wiz on current-users@ To generate a diff of this commit: cvs rdiff -u -r1.230 -r1.231 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.164 -r1.165 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.20 -r1.21 src/sys/net/link_proto.c cvs rdiff -u -r1.48 -r1.49 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.159 -r1.160 src/sys/net/rtsock.c cvs rdiff -u -r1.57 -r1.58 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.36 -r1.37 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.27 -r1.28 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.29 -r1.30 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.150 -r1.151 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.53 -r1.54 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.141 -r1.142 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.195 -r1.196 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.213 -r1.214 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.127 -r1.128 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.38 -r1.39 src/sys/netinet6/in6_pcb.h cvs rdiff -u -r1.132 -r1.133 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.111 -r1.112 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.39 -r1.40 src/sys/netipsec/keysock.c cvs rdiff -u -r1.20 -r1.21 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.41 -r1.42 src/sys/netnatm/natm.c cvs rdiff -u -r1.54 -r1.55 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.56 -r1.57 src/sys/sys/protosw.h cvs rdiff -u -r1.52 -r1.53 src/sys/sys/un.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/kern/uipc_socket.c diff -u src/sys/kern/uipc_socket.c:1.230 src/sys/kern/uipc_socket.c:1.231 --- src/sys/kern/uipc_socket.c:1.230 Thu Jul 31 20:28:59 2014 +++ src/sys/kern/uipc_socket.c Tue Aug 5 05:24:26 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.230 2014/07/31 20:28:59 mrg Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.231 2014/08/05 05:24:26 rtr Exp $ */ /*- * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.230 2014/07/31 20:28:59 mrg Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.231 2014/08/05 05:24:26 rtr Exp $); #include opt_compat_netbsd.h #include opt_sock_counters.h @@ -629,7 +629,7 @@ sobind(struct socket *so, struct mbuf *n int error; solock(so); - error = (*so-so_proto-pr_usrreqs-pr_bind)(so, nam); + error = (*so-so_proto-pr_usrreqs-pr_bind)(so, nam, l); sounlock(so); return error; } @@ -645,7 +645,7 @@ solisten(struct socket *so, int backlog, sounlock(so); return EINVAL; } - error = (*so-so_proto-pr_usrreqs-pr_listen)(so); + error = (*so-so_proto-pr_usrreqs-pr_listen)(so, l); if (error != 0) { sounlock(so); return error; @@ -826,7 +826,7 @@ soconnect(struct socket *so, struct mbuf (error = sodisconnect(so error = EISCONN; else - error = (*so-so_proto-pr_usrreqs-pr_connect)(so, nam); + error = (*so-so_proto-pr_usrreqs-pr_connect)(so, nam, l); return error; } Index: src/sys/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.164 src/sys/kern/uipc_usrreq.c:1.165 --- src/sys/kern/uipc_usrreq.c:1.164 Thu Jul 31 14:12:57 2014 +++ src/sys/kern/uipc_usrreq.c Tue Aug 5 05:24:26 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.164 2014/07/31 14:12:57 rtr Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.165 2014/08/05 05:24:26 rtr Exp $ */ /*- * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.164 2014/07/31 14:12:57 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.165 2014/08/05 05:24:26 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -495,7 +495,7 @@ unp_usrreq(struct socket *so, int req, s * intervening control ops, like * another connection. */ - error = unp_connect(so, nam); + error = unp_connect(so, nam, l); } } else { if ((so-so_state SS_ISCONNECTED) == 0) @@ -920,7 +920,7 @@ makeun(struct mbuf *nam, size_t *addrlen } static int -unp_bind(struct socket *so, struct mbuf *nam)
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Tue Aug 5 05:24:27 UTC 2014 Modified Files: src/sys/kern: uipc_socket.c uipc_usrreq.c src/sys/net: link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: in_pcb.c in_pcb.h raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: in6_pcb.c in6_pcb.h raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h un.h Log Message: revert the removal of struct lwp * parameter from bind, listen and connect user requests. this should resolve the issue relating to nfs client hangs presented recently by wiz on current-users@ To generate a diff of this commit: cvs rdiff -u -r1.230 -r1.231 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.164 -r1.165 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.20 -r1.21 src/sys/net/link_proto.c cvs rdiff -u -r1.48 -r1.49 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.159 -r1.160 src/sys/net/rtsock.c cvs rdiff -u -r1.57 -r1.58 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.36 -r1.37 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.27 -r1.28 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.29 -r1.30 src/sys/netbt/rfcomm_socket.c \ src/sys/netbt/sco_socket.c cvs rdiff -u -r1.150 -r1.151 src/sys/netinet/in_pcb.c cvs rdiff -u -r1.53 -r1.54 src/sys/netinet/in_pcb.h cvs rdiff -u -r1.141 -r1.142 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.195 -r1.196 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.213 -r1.214 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.127 -r1.128 src/sys/netinet6/in6_pcb.c cvs rdiff -u -r1.38 -r1.39 src/sys/netinet6/in6_pcb.h cvs rdiff -u -r1.132 -r1.133 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.111 -r1.112 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.39 -r1.40 src/sys/netipsec/keysock.c cvs rdiff -u -r1.20 -r1.21 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.41 -r1.42 src/sys/netnatm/natm.c cvs rdiff -u -r1.54 -r1.55 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.56 -r1.57 src/sys/sys/protosw.h cvs rdiff -u -r1.52 -r1.53 src/sys/sys/un.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sun Aug 3 11:44:52 UTC 2014 Modified Files: src/sys/netinet: raw_ip.c Log Message: req cannot be PRU_SENDOOB here as per KASSERT() earlier in the rip_usrreq() function. - KASSERT(!control || (req == PRU_SEND || req == PRU_SENDOOB)); + KASSERT(!control || (req == PRU_SEND)); To generate a diff of this commit: cvs rdiff -u -r1.140 -r1.141 src/sys/netinet/raw_ip.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/raw_ip.c diff -u src/sys/netinet/raw_ip.c:1.140 src/sys/netinet/raw_ip.c:1.141 --- src/sys/netinet/raw_ip.c:1.140 Sat Aug 2 03:55:26 2014 +++ src/sys/netinet/raw_ip.c Sun Aug 3 11:44:52 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.140 2014/08/02 03:55:26 rtr Exp $ */ +/* $NetBSD: raw_ip.c,v 1.141 2014/08/03 11:44:52 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.140 2014/08/02 03:55:26 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.141 2014/08/03 11:44:52 rtr Exp $); #include opt_inet.h #include opt_compat_netbsd.h @@ -770,7 +770,7 @@ rip_usrreq(struct socket *so, int req, s KASSERT(solocked(so)); inp = sotoinpcb(so); - KASSERT(!control || (req == PRU_SEND || req == PRU_SENDOOB)); + KASSERT(!control || (req == PRU_SEND)); if (inp == NULL) { splx(s); return EINVAL;
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sun Aug 3 11:44:52 UTC 2014 Modified Files: src/sys/netinet: raw_ip.c Log Message: req cannot be PRU_SENDOOB here as per KASSERT() earlier in the rip_usrreq() function. - KASSERT(!control || (req == PRU_SEND || req == PRU_SENDOOB)); + KASSERT(!control || (req == PRU_SEND)); To generate a diff of this commit: cvs rdiff -u -r1.140 -r1.141 src/sys/netinet/raw_ip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sat Aug 2 03:55:26 UTC 2014 Modified Files: src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c Log Message: restore splsoftnet() in various usrreqs that were removed during the PRU splits. we will properly review removal after the PRU split work is complete. To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.194 -r1.195 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.212 -r1.213 src/sys/netinet/udp_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/raw_ip.c diff -u src/sys/netinet/raw_ip.c:1.139 src/sys/netinet/raw_ip.c:1.140 --- src/sys/netinet/raw_ip.c:1.139 Thu Jul 31 03:39:35 2014 +++ src/sys/netinet/raw_ip.c Sat Aug 2 03:55:26 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.139 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: raw_ip.c,v 1.140 2014/08/02 03:55:26 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -65,7 +65,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.139 2014/07/31 03:39:35 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: raw_ip.c,v 1.140 2014/08/02 03:55:26 rtr Exp $); #include opt_inet.h #include opt_compat_netbsd.h @@ -618,8 +618,8 @@ rip_connect(struct socket *so, struct mb error = rip_connect_pcb(inp, nam); if (! error) soisconnected(so); - splx(s); + return error; } @@ -627,24 +627,33 @@ static int rip_disconnect(struct socket *so) { struct inpcb *inp = sotoinpcb(so); + int s; KASSERT(solocked(so)); KASSERT(inp != NULL); + s = splsoftnet(); soisdisconnected(so); rip_disconnect1(inp); + splx(s); + return 0; } static int rip_shutdown(struct socket *so) { + int s; + KASSERT(solocked(so)); /* * Mark the connection as being incapable of further input. */ + s = splsoftnet(); socantsendmore(so); + splx(s); + return 0; } @@ -676,22 +685,32 @@ rip_stat(struct socket *so, struct stat static int rip_peeraddr(struct socket *so, struct mbuf *nam) { + int s; + KASSERT(solocked(so)); KASSERT(sotoinpcb(so) != NULL); KASSERT(nam != NULL); + s = splsoftnet(); in_setpeeraddr(sotoinpcb(so), nam); + splx(s); + return 0; } static int rip_sockaddr(struct socket *so, struct mbuf *nam) { + int s; + KASSERT(solocked(so)); KASSERT(sotoinpcb(so) != NULL); KASSERT(nam != NULL); + s = splsoftnet(); in_setsockaddr(sotoinpcb(so), nam); + splx(s); + return 0; } Index: src/sys/netinet/tcp_usrreq.c diff -u src/sys/netinet/tcp_usrreq.c:1.194 src/sys/netinet/tcp_usrreq.c:1.195 --- src/sys/netinet/tcp_usrreq.c:1.194 Thu Jul 31 03:39:35 2014 +++ src/sys/netinet/tcp_usrreq.c Sat Aug 2 03:55:26 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.194 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.195 2014/08/02 03:55:26 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -99,7 +99,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.194 2014/07/31 03:39:35 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.195 2014/08/02 03:55:26 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -705,6 +705,7 @@ tcp_accept(struct socket *so, struct mbu struct tcpcb *tp = NULL; int ostate = 0; int error = 0; + int s; KASSERT(solocked(so)); @@ -718,6 +719,7 @@ tcp_accept(struct socket *so, struct mbu * done at higher levels; just return the address * of the peer, storing through addr. */ + s = splsoftnet(); #ifdef INET if (inp) { in_setpeeraddr(inp, nam); @@ -729,6 +731,7 @@ tcp_accept(struct socket *so, struct mbu } #endif tcp_debug_trace(so, tp, ostate, PRU_ACCEPT); + splx(s); return 0; } @@ -773,7 +776,6 @@ tcp_bind(struct socket *so, struct mbuf break; #endif } - tcp_debug_trace(so, tp, ostate, PRU_BIND); splx(s); @@ -786,9 +788,9 @@ tcp_listen(struct socket *so) struct inpcb *inp = NULL; struct in6pcb *in6p = NULL; struct tcpcb *tp = NULL; - int s; int error = 0; int ostate = 0; + int s; KASSERT(solocked(so)); @@ -841,8 +843,6 @@ tcp_connect(struct socket *so, struct mb ostate = tcp_debug_capture(tp, PRU_CONNECT); - s = splsoftnet(); - /* * Initiate connection to peer. * Create a template for use in transmissions on this connection. @@ -850,6 +850,7 @@ tcp_connect(struct socket *so, struct mb * Start keep-alive timer, and seed output sequence space. * Send initial segment on connection. */ + s = splsoftnet(); #ifdef INET if (inp) { if (inp-inp_lport == 0) { @@ -920,9 +921,9 @@ tcp_disconnect(struct socket *so) struct inpcb *inp = NULL; struct in6pcb *in6p = NULL; struct tcpcb *tp = NULL; - int s; int error = 0; int ostate = 0; + int s; KASSERT(solocked(so)); @@ -956,9 +957,9 @@ tcp_shutdown(struct socket *so) struct inpcb *inp = NULL; struct in6pcb *in6p =
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Sat Aug 2 03:55:26 UTC 2014 Modified Files: src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c Log Message: restore splsoftnet() in various usrreqs that were removed during the PRU splits. we will properly review removal after the PRU split work is complete. To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.194 -r1.195 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.212 -r1.213 src/sys/netinet/udp_usrreq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/net
Module Name:src Committed By: rtr Date: Thu Jul 31 13:21:33 UTC 2014 Modified Files: src/sys/net: link_proto.c Log Message: split PRU_CONNECT, PRU_RCVOOB and PRU_SENDOOB into separate functions (all implemented as EOPNOTSUPP). To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/net/link_proto.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/net/link_proto.c diff -u src/sys/net/link_proto.c:1.19 src/sys/net/link_proto.c:1.20 --- src/sys/net/link_proto.c:1.19 Thu Jul 31 03:39:35 2014 +++ src/sys/net/link_proto.c Thu Jul 31 13:21:33 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: link_proto.c,v 1.19 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: link_proto.c,v 1.20 2014/07/31 13:21:33 rtr Exp $ */ /*- * Copyright (c) 1982, 1986, 1993 @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: link_proto.c,v 1.19 2014/07/31 03:39:35 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: link_proto.c,v 1.20 2014/07/31 13:21:33 rtr Exp $); #include sys/param.h #include sys/socket.h @@ -53,6 +53,7 @@ static void link_detach(struct socket *) static int link_accept(struct socket *, struct mbuf *); static int link_bind(struct socket *, struct mbuf *); static int link_listen(struct socket *); +static int link_connect(struct socket *, struct mbuf *); static int link_disconnect(struct socket *); static int link_shutdown(struct socket *); static int link_abort(struct socket *); @@ -60,6 +61,8 @@ static int link_ioctl(struct socket *, u static int link_stat(struct socket *, struct stat *); static int link_peeraddr(struct socket *, struct mbuf *); static int link_sockaddr(struct socket *, struct mbuf *); +static int link_recvoob(struct socket *, struct mbuf *, int); +static int link_sendoob(struct socket *, struct mbuf *, struct mbuf *); static int link_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *); static void link_init(void); @@ -76,6 +79,7 @@ static const struct pr_usrreqs link_usrr .pr_accept = link_accept, .pr_bind = link_bind, .pr_listen = link_listen, + .pr_connect = link_connect, .pr_disconnect = link_disconnect, .pr_shutdown = link_shutdown, .pr_abort = link_abort, @@ -83,6 +87,8 @@ static const struct pr_usrreqs link_usrr .pr_stat = link_stat, .pr_peeraddr = link_peeraddr, .pr_sockaddr = link_sockaddr, + .pr_recvoob = link_recvoob, + .pr_sendoob = link_sendoob, .pr_generic = link_usrreq, }; @@ -275,6 +281,14 @@ link_listen(struct socket *so) } static int +link_connect(struct socket *so, struct mbuf *nam) +{ + KASSERT(solocked(so)); + + return EOPNOTSUPP; +} + +static int link_disconnect(struct socket *so) { KASSERT(solocked(so)); @@ -329,6 +343,22 @@ link_sockaddr(struct socket *so, struct } static int +link_recvoob(struct socket *so, struct mbuf *m, int flags) +{ + KASSERT(solocked(so)); + + return EOPNOTSUPP; +} + +static int +link_sendoob(struct socket *so, struct mbuf *m, struct mbuf *control) +{ + KASSERT(solocked(so)); + + return EOPNOTSUPP; +} + +static int link_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct lwp *l) { @@ -337,6 +367,7 @@ link_usrreq(struct socket *so, int req, KASSERT(req != PRU_ACCEPT); KASSERT(req != PRU_BIND); KASSERT(req != PRU_LISTEN); + KASSERT(req != PRU_CONNECT); KASSERT(req != PRU_DISCONNECT); KASSERT(req != PRU_SHUTDOWN); KASSERT(req != PRU_ABORT); @@ -344,6 +375,8 @@ link_usrreq(struct socket *so, int req, KASSERT(req != PRU_SENSE); KASSERT(req != PRU_PEERADDR); KASSERT(req != PRU_SOCKADDR); + KASSERT(req != PRU_RCVOOB); + KASSERT(req != PRU_SENDOOB); return EOPNOTSUPP; }
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Thu Jul 31 14:12:57 UTC 2014 Modified Files: src/sys/kern: uipc_usrreq.c src/sys/sys: un.h Log Message: * remove declarations of unp_bind, unp_discard, unp_disconnect1, unp_drop, unp_shutdown1, unp_internalize and unp_output functions from sys/un.h and instead declare them as static in uipc_usrreq.c with prototype declarations as necessary. * remove struct lwp * parameter from unp_output() while here and just use curlwp instead. as discussed with rmind To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.51 -r1.52 src/sys/sys/un.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/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.163 src/sys/kern/uipc_usrreq.c:1.164 --- src/sys/kern/uipc_usrreq.c:1.163 Thu Jul 31 03:39:35 2014 +++ src/sys/kern/uipc_usrreq.c Thu Jul 31 14:12:57 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_usrreq.c,v 1.163 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: uipc_usrreq.c,v 1.164 2014/07/31 14:12:57 rtr Exp $ */ /*- * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.163 2014/07/31 03:39:35 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.164 2014/07/31 14:12:57 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -170,14 +170,18 @@ const struct sockaddr_un sun_noname = { }; ino_t unp_ino; /* prototype for fake inode numbers */ -static void unp_detach(struct socket *); -struct mbuf *unp_addsockcred(struct lwp *, struct mbuf *); -static void unp_mark(file_t *); -static void unp_scan(struct mbuf *, void (*)(file_t *), int); -static void unp_discard_now(file_t *); -static void unp_discard_later(file_t *); -static void unp_thread(void *); -static void unp_thread_kick(void); +static struct mbuf * unp_addsockcred(struct lwp *, struct mbuf *); +static void unp_discard_later(file_t *); +static void unp_discard_now(file_t *); +static void unp_disconnect1(struct unpcb *); +static bool unp_drop(struct unpcb *, int); +static intunp_internalize(struct mbuf **); +static void unp_mark(file_t *); +static void unp_scan(struct mbuf *, void (*)(file_t *), int); +static void unp_shutdown1(struct unpcb *); +static void unp_thread(void *); +static void unp_thread_kick(void); + static kmutex_t *uipc_lock; static kcondvar_t unp_thread_cv; @@ -296,9 +300,8 @@ unp_free(struct unpcb *unp) kmem_free(unp, sizeof(*unp)); } -int -unp_output(struct mbuf *m, struct mbuf *control, struct unpcb *unp, - struct lwp *l) +static int +unp_output(struct mbuf *m, struct mbuf *control, struct unpcb *unp) { struct socket *so2; const struct sockaddr_un *sun; @@ -315,7 +318,7 @@ unp_output(struct mbuf *m, struct mbuf * else sun = sun_noname; if (unp-unp_conn-unp_flags UNP_WANTCRED) - control = unp_addsockcred(l, control); + control = unp_addsockcred(curlwp, control); if (sbappendaddr(so2-so_rcv, (const struct sockaddr *)sun, m, control) == 0) { so2-so_rcv.sb_overflowed++; @@ -329,7 +332,7 @@ unp_output(struct mbuf *m, struct mbuf * } } -void +static void unp_setaddr(struct socket *so, struct mbuf *nam, bool peeraddr) { const struct sockaddr_un *sun; @@ -505,7 +508,7 @@ unp_usrreq(struct socket *so, int req, s break; } KASSERT(l != NULL); - error = unp_output(m, control, unp, l); + error = unp_output(m, control, unp); if (nam) unp_disconnect1(unp); break; @@ -916,7 +919,7 @@ makeun(struct mbuf *nam, size_t *addrlen return sun; } -int +static int unp_bind(struct socket *so, struct mbuf *nam) { struct sockaddr_un *sun; @@ -1226,7 +1229,7 @@ unp_connect2(struct socket *so, struct s return (0); } -void +static void unp_disconnect1(struct unpcb *unp) { struct unpcb *unp2 = unp-unp_conn; @@ -1266,7 +1269,7 @@ unp_disconnect1(struct unpcb *unp) } } -void +static void unp_shutdown1(struct unpcb *unp) { struct socket *so; @@ -1282,7 +1285,7 @@ unp_shutdown1(struct unpcb *unp) } } -bool +static bool unp_drop(struct unpcb *unp, int errno) { struct socket *so = unp-unp_socket; @@ -1437,7 +1440,7 @@ unp_externalize(struct mbuf *rights, str return error; } -int +static int unp_internalize(struct mbuf **controlp) { filedesc_t *fdescp = curlwp-l_fd; Index: src/sys/sys/un.h diff -u src/sys/sys/un.h:1.51 src/sys/sys/un.h:1.52 --- src/sys/sys/un.h:1.51 Thu Jul 31 03:39:36 2014 +++ src/sys/sys/un.h Thu Jul 31 14:12:57 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: un.h,v 1.51 2014/07/31 03:39:36 rtr Exp $ */ +/* $NetBSD: un.h,v 1.52 2014/07/31 14:12:57 rtr Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -84,19 +84,10 @@ kmutex_t *uipc_dgramlock (void); kmutex_t *uipc_streamlock (void); kmutex_t *uipc_rawlock (void); -int unp_bind (struct
CVS commit: src/sys/netbt
Module Name:src Committed By: rtr Date: Thu Jul 31 15:16:06 UTC 2014 Modified Files: src/sys/netbt: rfcomm_socket.c Log Message: release mbuf on failure of PRU_SEND To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/netbt/rfcomm_socket.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/netbt/rfcomm_socket.c diff -u src/sys/netbt/rfcomm_socket.c:1.28 src/sys/netbt/rfcomm_socket.c:1.29 --- src/sys/netbt/rfcomm_socket.c:1.28 Thu Jul 31 03:39:35 2014 +++ src/sys/netbt/rfcomm_socket.c Thu Jul 31 15:16:06 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rfcomm_socket.c,v 1.28 2014/07/31 03:39:35 rtr Exp $ */ +/* $NetBSD: rfcomm_socket.c,v 1.29 2014/07/31 15:16:06 rtr Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rfcomm_socket.c,v 1.28 2014/07/31 03:39:35 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: rfcomm_socket.c,v 1.29 2014/07/31 15:16:06 rtr Exp $); /* load symbolic names */ #ifdef BLUETOOTH_DEBUG @@ -360,8 +360,10 @@ rfcomm_usrreq(struct socket *up, int req m_freem(ctl); m0 = m_copypacket(m, M_DONTWAIT); - if (m0 == NULL) - return ENOMEM; + if (m0 == NULL) { + err = ENOMEM; + goto release; + } sbappendstream(up-so_snd, m);
CVS commit: src/sys/net
Module Name:src Committed By: rtr Date: Thu Jul 31 13:21:33 UTC 2014 Modified Files: src/sys/net: link_proto.c Log Message: split PRU_CONNECT, PRU_RCVOOB and PRU_SENDOOB into separate functions (all implemented as EOPNOTSUPP). To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/net/link_proto.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Thu Jul 31 14:12:57 UTC 2014 Modified Files: src/sys/kern: uipc_usrreq.c src/sys/sys: un.h Log Message: * remove declarations of unp_bind, unp_discard, unp_disconnect1, unp_drop, unp_shutdown1, unp_internalize and unp_output functions from sys/un.h and instead declare them as static in uipc_usrreq.c with prototype declarations as necessary. * remove struct lwp * parameter from unp_output() while here and just use curlwp instead. as discussed with rmind To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.51 -r1.52 src/sys/sys/un.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netbt
Module Name:src Committed By: rtr Date: Thu Jul 31 15:16:06 UTC 2014 Modified Files: src/sys/netbt: rfcomm_socket.c Log Message: release mbuf on failure of PRU_SEND To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/netbt/rfcomm_socket.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/netinet
Module Name:src Committed By: rtr Date: Wed Jul 30 06:53:53 UTC 2014 Modified Files: src/sys/netinet: tcp_usrreq.c Log Message: put boilerplate extraction of inpcb or in6pcb and tcpcb performed in tcp usrreqs into a function that can be called instead of cut pasting it to every single usrreq function. tcp_getpcb(struct socket *, struct inpcb **, struct in6pcb **, struct tcpcb **) * examines the family of the provided socket and fills in either inpcb or in6pcb and tcpcb. * if the pcb is not present for the family of the socket EINVAL is returned, if the family is not AF_INET{,6} EAFNOSUPPORT is returned. signature provided by and patch reviewed by rmind To generate a diff of this commit: cvs rdiff -u -r1.191 -r1.192 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.191 src/sys/netinet/tcp_usrreq.c:1.192 --- src/sys/netinet/tcp_usrreq.c:1.191 Thu Jul 24 16:02:19 2014 +++ src/sys/netinet/tcp_usrreq.c Wed Jul 30 06:53:53 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.191 2014/07/24 16:02:19 rtr Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.192 2014/07/30 06:53:53 rtr Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -99,7 +99,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.191 2014/07/24 16:02:19 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: tcp_usrreq.c,v 1.192 2014/07/30 06:53:53 rtr Exp $); #include opt_inet.h #include opt_ipsec.h @@ -177,6 +177,41 @@ tcp_debug_trace(struct socket *so, struc #endif } +static int +tcp_getpcb(struct socket *so, struct inpcb **inp, +struct in6pcb **in6p, struct tcpcb **tp) +{ + /* + * When a TCP is attached to a socket, then there will be + * a (struct inpcb) pointed at by the socket, and this + * structure will point at a subsidary (struct tcpcb). + */ + switch (so-so_proto-pr_domain-dom_family) { +#ifdef INET + case PF_INET: + *inp = sotoinpcb(so); + if (*inp == NULL) + return EINVAL; + *tp = intotcpcb(*inp); + break; +#endif +#ifdef INET6 + case PF_INET6: + *in6p = sotoin6pcb(so); + if (*in6p == NULL) + return EINVAL; + *tp = in6totcpcb(*in6p); + break; +#endif + default: + return EAFNOSUPPORT; + } + + KASSERT(tp != NULL); + + return 0; +} + /* * Process a TCP user request for TCP tb. If this is a send request * then m is the mbuf chain of send data. If this is a timer expiration @@ -186,15 +221,12 @@ static int tcp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct lwp *l) { - struct inpcb *inp; -#ifdef INET6 - struct in6pcb *in6p; -#endif + struct inpcb *inp = NULL; + struct in6pcb *in6p = NULL; struct tcpcb *tp = NULL; int s; int error = 0; int ostate = 0; - int family; /* family of the socket */ KASSERT(req != PRU_ATTACH); KASSERT(req != PRU_DETACH); @@ -208,13 +240,11 @@ tcp_usrreq(struct socket *so, int req, s KASSERT(req != PRU_RCVOOB); KASSERT(req != PRU_SENDOOB); - family = so-so_proto-pr_domain-dom_family; - s = splsoftnet(); if (req == PRU_PURGEIF) { mutex_enter(softnet_lock); - switch (family) { + switch (so-so_proto-pr_domain-dom_family) { #ifdef INET case PF_INET: in_pcbpurgeif0(tcbtable, (struct ifnet *)control); @@ -241,57 +271,17 @@ tcp_usrreq(struct socket *so, int req, s KASSERT(solocked(so)); - switch (family) { -#ifdef INET - case PF_INET: - inp = sotoinpcb(so); -#ifdef INET6 - in6p = NULL; -#endif - break; -#endif -#ifdef INET6 - case PF_INET6: - inp = NULL; - in6p = sotoin6pcb(so); - break; -#endif - default: + if ((error = tcp_getpcb(so, inp, in6p, tp)) != 0) { splx(s); - return EAFNOSUPPORT; + return error; } + + ostate = tcp_debug_capture(tp, req); + KASSERT(!control || req == PRU_SEND); #ifdef INET6 /* XXX: KASSERT((inp != NULL) ^ (in6p != NULL)); */ #endif - /* - * When a TCP is attached to a socket, then there will be - * a (struct inpcb) pointed at by the socket, and this - * structure will point at a subsidary (struct tcpcb). - */ - if (inp == NULL -#ifdef INET6 - in6p == NULL -#endif - ) - { - error = EINVAL; - goto release; - } -#ifdef INET - if (inp) { - tp = intotcpcb(inp); - /* WHAT IF TP IS 0? */ - ostate = tcp_debug_capture(tp, req); - } -#endif -#ifdef INET6 - if (in6p) { - tp = in6totcpcb(in6p); - /* WHAT IF TP IS 0? */ - ostate = tcp_debug_capture(tp, req); - } -#endif switch (req) { @@ -435,10 +425,9 @@ tcp_usrreq(struct socket *so, int req, s } tcp_debug_trace(so, tp, ostate, req); - -release: splx(s); - return (error); + + return error; } static void @@ -462,7 +451,6 @@ change_keepalive(struct socket *so, stru TCP_TIMER_ARM(tp, TCPT_2MSL, tp-t_maxidle); } - int tcp_ctloutput(int op, struct socket *so, struct sockopt *sopt) { @@ -788,35 +776,17 @@ out: static
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Wed Jul 30 10:04:26 UTC 2014 Modified Files: src/sys/dev/bluetooth: bthidev.c btmagic.c btsco.c src/sys/kern: uipc_socket.c uipc_usrreq.c src/sys/net: raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap.h l2cap_socket.c l2cap_upper.c rfcomm.h rfcomm_socket.c rfcomm_upper.c sco.h sco_socket.c sco_upper.c src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h un.h Log Message: split PRU_CONNECT function out of pr_generic() usrreq switches and put into seaparate functions xxx_listen(struct socket *, struct mbuf *) - always KASSERT(solocked(so)) and KASSERT(nam != NULL) - replace calls to pr_generic() with req = PRU_CONNECT with pr_connect() - rename existin {l2cap,sco,rfcomm}_connect() to {l2cap,sco,rfcomm}_connect_pcb() respectively to permit naming consistency with other protocols functions. - drop struct lwp * parameter from unp_connect() and at_pcbconnect() and use curlwp instead where appropriate. patch reviewed by rmind To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/bluetooth/bthidev.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/bluetooth/btmagic.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/bluetooth/btsco.c cvs rdiff -u -r1.227 -r1.228 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.161 -r1.162 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.45 -r1.46 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.157 -r1.158 src/sys/net/rtsock.c cvs rdiff -u -r1.55 -r1.56 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.34 -r1.35 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.15 -r1.16 src/sys/netbt/l2cap.h src/sys/netbt/l2cap_upper.c cvs rdiff -u -r1.25 -r1.26 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.14 -r1.15 src/sys/netbt/rfcomm.h cvs rdiff -u -r1.26 -r1.27 src/sys/netbt/rfcomm_socket.c cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/rfcomm_upper.c cvs rdiff -u -r1.8 -r1.9 src/sys/netbt/sco.h cvs rdiff -u -r1.27 -r1.28 src/sys/netbt/sco_socket.c cvs rdiff -u -r1.13 -r1.14 src/sys/netbt/sco_upper.c cvs rdiff -u -r1.136 -r1.137 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.192 -r1.193 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.210 -r1.211 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.129 -r1.130 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.109 -r1.110 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.37 -r1.38 src/sys/netipsec/keysock.c cvs rdiff -u -r1.17 -r1.18 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.39 -r1.40 src/sys/netnatm/natm.c cvs rdiff -u -r1.52 -r1.53 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.54 -r1.55 src/sys/sys/protosw.h cvs rdiff -u -r1.49 -r1.50 src/sys/sys/un.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/dev/bluetooth/bthidev.c diff -u src/sys/dev/bluetooth/bthidev.c:1.26 src/sys/dev/bluetooth/bthidev.c:1.27 --- src/sys/dev/bluetooth/bthidev.c:1.26 Thu Jul 24 15:12:03 2014 +++ src/sys/dev/bluetooth/bthidev.c Wed Jul 30 10:04:25 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bthidev.c,v 1.26 2014/07/24 15:12:03 rtr Exp $ */ +/* $NetBSD: bthidev.c,v 1.27 2014/07/30 10:04:25 rtr Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bthidev.c,v 1.26 2014/07/24 15:12:03 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: bthidev.c,v 1.27 2014/07/30 10:04:25 rtr Exp $); #include sys/param.h #include sys/condvar.h @@ -577,9 +577,9 @@ bthidev_connect(struct bthidev_softc *sc sa.bt_psm = sc-sc_ctlpsm; bdaddr_copy(sa.bt_bdaddr, sc-sc_raddr); - err = l2cap_connect(sc-sc_ctl, sa); + err = l2cap_connect_pcb(sc-sc_ctl, sa); if (err) { - aprint_error_dev(sc-sc_dev, l2cap_connect failed (%d)\n, err); + aprint_error_dev(sc-sc_dev, l2cap_connect_pcb failed (%d)\n, err); return err; } @@ -753,7 +753,7 @@ bthidev_ctl_connected(void *arg) sa.bt_psm = sc-sc_intpsm; bdaddr_copy(sa.bt_bdaddr, sc-sc_raddr); - err = l2cap_connect(sc-sc_int, sa); + err = l2cap_connect_pcb(sc-sc_int, sa); if (err) goto fail; } Index: src/sys/dev/bluetooth/btmagic.c diff -u src/sys/dev/bluetooth/btmagic.c:1.8 src/sys/dev/bluetooth/btmagic.c:1.9 --- src/sys/dev/bluetooth/btmagic.c:1.8 Thu Jul 24 15:12:03 2014 +++ src/sys/dev/bluetooth/btmagic.c Wed Jul 30 10:04:25 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: btmagic.c,v 1.8 2014/07/24 15:12:03 rtr Exp $ */ +/* $NetBSD: btmagic.c,v 1.9 2014/07/30 10:04:25 rtr Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -85,7 +85,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: btmagic.c,v 1.8
CVS commit: src/sys
Module Name:src Committed By: rtr Date: Thu Jul 31 03:39:36 UTC 2014 Modified Files: src/sys/dev/bluetooth: bthidev.c btmagic.c btsco.c src/sys/kern: uipc_socket.c uipc_socket2.c uipc_usrreq.c src/sys/net: link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci_socket.c l2cap.h l2cap_socket.c l2cap_upper.c rfcomm.h rfcomm_session.c rfcomm_socket.c rfcomm_upper.c sco.h sco_socket.c sco_upper.c src/sys/netinet: raw_ip.c tcp_usrreq.c tcp_var.h udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h un.h Log Message: split PRU_DISCONNECT, PRU_SHUTDOWN and PRU_ABORT function out of pr_generic() usrreq switches and put into separate functions xxx_disconnect(struct socket *) xxx_shutdown(struct socket *) xxx_abort(struct socket *) - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_{DISCONNECT,SHUTDOWN,ABORT} with calls to pr_{disconnect,shutdown,abort}() respectively rename existing internal functions used to implement above functionality to permit use of the names for xxx_{disconnect,shutdown,abort}(). - {l2cap,sco,rfcomm}_disconnect() - {l2cap,sco,rfcomm}_disconnect_pcb() - {unp,rip,tcp}_disconnect() - {unp,rip,tcp}_disconnect1() - unp_shutdown() - unp_shutdown1() patch reviewed by rmind To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/bluetooth/bthidev.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/bluetooth/btmagic.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/bluetooth/btsco.c cvs rdiff -u -r1.228 -r1.229 src/sys/kern/uipc_socket.c cvs rdiff -u -r1.119 -r1.120 src/sys/kern/uipc_socket2.c cvs rdiff -u -r1.162 -r1.163 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.18 -r1.19 src/sys/net/link_proto.c cvs rdiff -u -r1.46 -r1.47 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.158 -r1.159 src/sys/net/rtsock.c cvs rdiff -u -r1.56 -r1.57 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.35 -r1.36 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.16 -r1.17 src/sys/netbt/l2cap.h src/sys/netbt/l2cap_upper.c cvs rdiff -u -r1.26 -r1.27 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.15 -r1.16 src/sys/netbt/rfcomm.h cvs rdiff -u -r1.21 -r1.22 src/sys/netbt/rfcomm_session.c cvs rdiff -u -r1.27 -r1.28 src/sys/netbt/rfcomm_socket.c cvs rdiff -u -r1.18 -r1.19 src/sys/netbt/rfcomm_upper.c cvs rdiff -u -r1.9 -r1.10 src/sys/netbt/sco.h cvs rdiff -u -r1.28 -r1.29 src/sys/netbt/sco_socket.c cvs rdiff -u -r1.14 -r1.15 src/sys/netbt/sco_upper.c cvs rdiff -u -r1.138 -r1.139 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.193 -r1.194 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.174 -r1.175 src/sys/netinet/tcp_var.h cvs rdiff -u -r1.211 -r1.212 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.131 -r1.132 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.110 -r1.111 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.38 -r1.39 src/sys/netipsec/keysock.c cvs rdiff -u -r1.18 -r1.19 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.40 -r1.41 src/sys/netnatm/natm.c cvs rdiff -u -r1.53 -r1.54 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.55 -r1.56 src/sys/sys/protosw.h cvs rdiff -u -r1.50 -r1.51 src/sys/sys/un.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/dev/bluetooth/bthidev.c diff -u src/sys/dev/bluetooth/bthidev.c:1.27 src/sys/dev/bluetooth/bthidev.c:1.28 --- src/sys/dev/bluetooth/bthidev.c:1.27 Wed Jul 30 10:04:25 2014 +++ src/sys/dev/bluetooth/bthidev.c Thu Jul 31 03:39:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bthidev.c,v 1.27 2014/07/30 10:04:25 rtr Exp $ */ +/* $NetBSD: bthidev.c,v 1.28 2014/07/31 03:39:35 rtr Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bthidev.c,v 1.27 2014/07/30 10:04:25 rtr Exp $); +__KERNEL_RCSID(0, $NetBSD: bthidev.c,v 1.28 2014/07/31 03:39:35 rtr Exp $); #include sys/param.h #include sys/condvar.h @@ -370,14 +370,14 @@ bthidev_detach(device_t self, int flags) /* close interrupt channel */ if (sc-sc_int != NULL) { - l2cap_disconnect(sc-sc_int, 0); + l2cap_disconnect_pcb(sc-sc_int, 0); l2cap_detach_pcb(sc-sc_int); sc-sc_int = NULL; } /* close control channel */ if (sc-sc_ctl != NULL) { - l2cap_disconnect(sc-sc_ctl, 0); + l2cap_disconnect_pcb(sc-sc_ctl, 0); l2cap_detach_pcb(sc-sc_ctl); sc-sc_ctl = NULL; } @@ -450,12 +450,12 @@ bthidev_timeout(void *arg) switch (sc-sc_state) { case BTHID_CLOSED: if (sc-sc_int != NULL) { - l2cap_disconnect(sc-sc_int, 0); + l2cap_disconnect_pcb(sc-sc_int, 0); break; } if (sc-sc_ctl != NULL) { - l2cap_disconnect(sc-sc_ctl, 0); + l2cap_disconnect_pcb(sc-sc_ctl, 0);