tcp_usrreq.c (7684) | tcp_usrreq.c (8876) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94 |
34 * $Id: tcp_usrreq.c,v 1.12 1995/03/16 18:15:06 bde Exp $ | 34 * $Id: tcp_usrreq.c,v 1.13 1995/04/09 01:29:28 davidg Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> 40#include <sys/malloc.h> 41#include <sys/mbuf.h> 42#include <sys/socket.h> --- 158 unchanged lines hidden (view full) --- 201 * Must disallow TCP ``connections'' to multicast addresses. 202 */ 203 sinp = mtod(nam, struct sockaddr_in *); 204 if (sinp->sin_family == AF_INET 205 && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) { 206 error = EAFNOSUPPORT; 207 break; 208 } | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> 40#include <sys/malloc.h> 41#include <sys/mbuf.h> 42#include <sys/socket.h> --- 158 unchanged lines hidden (view full) --- 201 * Must disallow TCP ``connections'' to multicast addresses. 202 */ 203 sinp = mtod(nam, struct sockaddr_in *); 204 if (sinp->sin_family == AF_INET 205 && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) { 206 error = EAFNOSUPPORT; 207 break; 208 } |
209 | 209 |
210 if ((error = tcp_connect(tp, nam)) != 0) 211 break; 212 error = tcp_output(tp); 213 break; 214 215 /* 216 * Create a TCP connection between two sockets. 217 */ --- 179 unchanged lines hidden (view full) --- 397 int error; 398 399 if (inp->inp_lport == 0) { 400 error = in_pcbbind(inp, NULL); 401 if (error) 402 return error; 403 } 404 | 210 if ((error = tcp_connect(tp, nam)) != 0) 211 break; 212 error = tcp_output(tp); 213 break; 214 215 /* 216 * Create a TCP connection between two sockets. 217 */ --- 179 unchanged lines hidden (view full) --- 397 int error; 398 399 if (inp->inp_lport == 0) { 400 error = in_pcbbind(inp, NULL); 401 if (error) 402 return error; 403 } 404 |
405 /* | 405 /* |
406 * Cannot simply call in_pcbconnect, because there might be an 407 * earlier incarnation of this same connection still in 408 * TIME_WAIT state, creating an ADDRINUSE error. 409 */ 410 error = in_pcbladdr(inp, nam, &ifaddr); 411 oinp = in_pcblookup(inp->inp_pcbinfo->listhead, 412 sin->sin_addr, sin->sin_port, 413 inp->inp_laddr.s_addr != INADDR_ANY ? inp->inp_laddr --- 278 unchanged lines hidden (view full) --- 692 return (sysctl_int(oldp, oldlenp, newp, newlen, 693 &tcp_mssdflt)); 694 case TCPCTL_STATS: 695 return (sysctl_rdstruct(oldp, oldlenp, newp, &tcpstat, 696 sizeof tcpstat)); 697 case TCPCTL_RTTDFLT: 698 return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_rttdflt)); 699 case TCPCTL_KEEPIDLE: | 406 * Cannot simply call in_pcbconnect, because there might be an 407 * earlier incarnation of this same connection still in 408 * TIME_WAIT state, creating an ADDRINUSE error. 409 */ 410 error = in_pcbladdr(inp, nam, &ifaddr); 411 oinp = in_pcblookup(inp->inp_pcbinfo->listhead, 412 sin->sin_addr, sin->sin_port, 413 inp->inp_laddr.s_addr != INADDR_ANY ? inp->inp_laddr --- 278 unchanged lines hidden (view full) --- 692 return (sysctl_int(oldp, oldlenp, newp, newlen, 693 &tcp_mssdflt)); 694 case TCPCTL_STATS: 695 return (sysctl_rdstruct(oldp, oldlenp, newp, &tcpstat, 696 sizeof tcpstat)); 697 case TCPCTL_RTTDFLT: 698 return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_rttdflt)); 699 case TCPCTL_KEEPIDLE: |
700 return (sysctl_int(oldp, oldlenp, newp, newlen, | 700 return (sysctl_int(oldp, oldlenp, newp, newlen, |
701 &tcp_keepidle)); 702 case TCPCTL_KEEPINTVL: 703 return (sysctl_int(oldp, oldlenp, newp, newlen, 704 &tcp_keepintvl)); 705 case TCPCTL_SENDSPACE: 706 return (sysctl_int(oldp, oldlenp, newp, newlen, 707 (int *)&tcp_sendspace)); /* XXX */ 708 case TCPCTL_RECVSPACE: 709 return (sysctl_int(oldp, oldlenp, newp, newlen, 710 (int *)&tcp_recvspace)); /* XXX */ 711 default: 712 return (ENOPROTOOPT); 713 } 714 /* NOTREACHED */ 715} | 701 &tcp_keepidle)); 702 case TCPCTL_KEEPINTVL: 703 return (sysctl_int(oldp, oldlenp, newp, newlen, 704 &tcp_keepintvl)); 705 case TCPCTL_SENDSPACE: 706 return (sysctl_int(oldp, oldlenp, newp, newlen, 707 (int *)&tcp_sendspace)); /* XXX */ 708 case TCPCTL_RECVSPACE: 709 return (sysctl_int(oldp, oldlenp, newp, newlen, 710 (int *)&tcp_recvspace)); /* XXX */ 711 default: 712 return (ENOPROTOOPT); 713 } 714 /* NOTREACHED */ 715} |