uipc_socket.c (43196) | uipc_socket.c (43301) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 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 * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 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 * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94 |
34 * $Id: uipc_socket.c,v 1.51 1999/01/20 17:45:22 fenner Exp $ | 34 * $Id: uipc_socket.c,v 1.52 1999/01/25 16:58:52 fenner Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/proc.h> 40#include <sys/fcntl.h> 41#include <sys/malloc.h> 42#include <sys/mbuf.h> --- 367 unchanged lines hidden (view full) --- 410 * However, space must be signed, as it might be less than 0 411 * if we over-committed, and we must use a signed comparison 412 * of space and resid. On the other hand, a negative resid 413 * causes us to loop sending 0-length segments to the protocol. 414 * 415 * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM 416 * type sockets since that's an error. 417 */ | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/proc.h> 40#include <sys/fcntl.h> 41#include <sys/malloc.h> 42#include <sys/mbuf.h> --- 367 unchanged lines hidden (view full) --- 410 * However, space must be signed, as it might be less than 0 411 * if we over-committed, and we must use a signed comparison 412 * of space and resid. On the other hand, a negative resid 413 * causes us to loop sending 0-length segments to the protocol. 414 * 415 * Also check to make sure that MSG_EOR isn't used on SOCK_STREAM 416 * type sockets since that's an error. 417 */ |
418 if (resid < 0 || so->so_type == SOCK_STREAM && (flags & MSG_EOR)) { | 418 if (resid < 0 || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) { |
419 error = EINVAL; 420 goto out; 421 } 422 423 dontroute = 424 (flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 && 425 (so->so_proto->pr_flags & PR_ATOMIC); 426 if (p) --- 802 unchanged lines hidden --- | 419 error = EINVAL; 420 goto out; 421 } 422 423 dontroute = 424 (flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 && 425 (so->so_proto->pr_flags & PR_ATOMIC); 426 if (p) --- 802 unchanged lines hidden --- |