Deleted Added
full compact
uipc_sockbuf.c (129410) uipc_sockbuf.c (129906)
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

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
30 */
31
32#include <sys/cdefs.h>
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

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/uipc_sockbuf.c 129410 2004-05-19 00:22:10Z ps $");
33__FBSDID("$FreeBSD: head/sys/kern/uipc_sockbuf.c 129906 2004-05-31 21:46:06Z bmilekic $");
34
35#include "opt_mac.h"
36#include "opt_param.h"
37
38#include <sys/param.h>
39#include <sys/aio.h> /* for aio_swake proto */
40#include <sys/domain.h>
41#include <sys/event.h>

--- 912 unchanged lines hidden (view full) ---

954 register int size;
955 int type, level;
956{
957 register struct cmsghdr *cp;
958 struct mbuf *m;
959
960 if (CMSG_SPACE((u_int)size) > MCLBYTES)
961 return ((struct mbuf *) NULL);
34
35#include "opt_mac.h"
36#include "opt_param.h"
37
38#include <sys/param.h>
39#include <sys/aio.h> /* for aio_swake proto */
40#include <sys/domain.h>
41#include <sys/event.h>

--- 912 unchanged lines hidden (view full) ---

954 register int size;
955 int type, level;
956{
957 register struct cmsghdr *cp;
958 struct mbuf *m;
959
960 if (CMSG_SPACE((u_int)size) > MCLBYTES)
961 return ((struct mbuf *) NULL);
962 if ((m = m_get(M_DONTWAIT, MT_CONTROL)) == NULL)
962 if (CMSG_SPACE((u_int)size > MLEN))
963 m = m_getcl(M_DONTWAIT, MT_CONTROL, 0);
964 else
965 m = m_get(M_DONTWAIT, MT_CONTROL);
966 if (m == NULL)
963 return ((struct mbuf *) NULL);
967 return ((struct mbuf *) NULL);
964 if (CMSG_SPACE((u_int)size) > MLEN) {
965 MCLGET(m, M_DONTWAIT);
966 if ((m->m_flags & M_EXT) == 0) {
967 m_free(m);
968 return ((struct mbuf *) NULL);
969 }
970 }
971 cp = mtod(m, struct cmsghdr *);
972 m->m_len = 0;
973 KASSERT(CMSG_SPACE((u_int)size) <= M_TRAILINGSPACE(m),
974 ("sbcreatecontrol: short mbuf"));
975 if (p != NULL)
976 (void)memcpy(CMSG_DATA(cp), p, size);
977 m->m_len = CMSG_SPACE(size);
978 cp->cmsg_len = CMSG_LEN(size);

--- 162 unchanged lines hidden ---
968 cp = mtod(m, struct cmsghdr *);
969 m->m_len = 0;
970 KASSERT(CMSG_SPACE((u_int)size) <= M_TRAILINGSPACE(m),
971 ("sbcreatecontrol: short mbuf"));
972 if (p != NULL)
973 (void)memcpy(CMSG_DATA(cp), p, size);
974 m->m_len = CMSG_SPACE(size);
975 cp->cmsg_len = CMSG_LEN(size);

--- 162 unchanged lines hidden ---