1/*- 2 * Copyright (c) 1982, 1986, 1989, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * sendfile(2) and related extensions: 6 * Copyright (c) 1998, David Greenman. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)uipc_syscalls.c 8.4 (Berkeley) 2/21/94 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/kern/uipc_syscalls.c 177599 2008-03-25 09:39:02Z ru $"); |
37 38#include "opt_sctp.h" 39#include "opt_compat.h" 40#include "opt_ktrace.h" 41#include "opt_mac.h" 42 43#include <sys/param.h> 44#include <sys/systm.h> --- 655 unchanged lines hidden (view full) --- 700 error = sockargs(&control, mp->msg_control, 701 mp->msg_controllen, MT_CONTROL); 702 if (error) 703 goto bad; 704#ifdef COMPAT_OLDSOCK 705 if (mp->msg_flags == MSG_COMPAT) { 706 struct cmsghdr *cm; 707 |
708 M_PREPEND(control, sizeof(*cm), M_WAIT); 709 cm = mtod(control, struct cmsghdr *); 710 cm->cmsg_len = control->m_len; 711 cm->cmsg_level = SOL_SOCKET; 712 cm->cmsg_type = SCM_RIGHTS; |
713 } 714#endif 715 } else { 716 control = NULL; 717 } 718 719 error = kern_sendit(td, s, mp, flags, control, UIO_USERSPACE); 720 --- 896 unchanged lines hidden (view full) --- 1617#ifdef COMPAT_OLDSOCK 1618 if (type == MT_SONAME && (u_int)buflen <= 112) 1619 buflen = MLEN; /* unix domain compat. hack */ 1620 else 1621#endif 1622 if ((u_int)buflen > MCLBYTES) 1623 return (EINVAL); 1624 } |
1625 m = m_get(M_WAIT, type); 1626 if ((u_int)buflen > MLEN) 1627 MCLGET(m, M_WAIT); |
1628 m->m_len = buflen; 1629 error = copyin(buf, mtod(m, caddr_t), (u_int)buflen); 1630 if (error) 1631 (void) m_free(m); 1632 else { 1633 *mp = m; 1634 if (type == MT_SONAME) { 1635 sa = mtod(m, struct sockaddr *); --- 1069 unchanged lines hidden --- |