Deleted Added
full compact
uipc_socket.c (185169) uipc_socket.c (185435)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California.
4 * Copyright (c) 2004 The FreeBSD Foundation
5 * Copyright (c) 2004-2008 Robert N. M. Watson
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

90 * calls to explicitly manage socket references, soref(), and sorele().
91 * Currently, these are generally required only when transitioning a socket
92 * from a listen queue to a file descriptor, in order to prevent garbage
93 * collection of the socket at an untimely moment. For a number of reasons,
94 * these interfaces are not preferred, and should be avoided.
95 */
96
97#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California.
4 * Copyright (c) 2004 The FreeBSD Foundation
5 * Copyright (c) 2004-2008 Robert N. M. Watson
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

90 * calls to explicitly manage socket references, soref(), and sorele().
91 * Currently, these are generally required only when transitioning a socket
92 * from a listen queue to a file descriptor, in order to prevent garbage
93 * collection of the socket at an untimely moment. For a number of reasons,
94 * these interfaces are not preferred, and should be avoided.
95 */
96
97#include <sys/cdefs.h>
98__FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 185169 2008-11-22 12:36:15Z kib $");
98__FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 185435 2008-11-29 14:32:14Z bz $");
99
100#include "opt_inet.h"
99
100#include "opt_inet.h"
101#include "opt_inet6.h"
101#include "opt_mac.h"
102#include "opt_zero.h"
103#include "opt_compat.h"
104
105#include <sys/param.h>
106#include <sys/systm.h>
107#include <sys/fcntl.h>
108#include <sys/limits.h>

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

341
342 if (prp == NULL || prp->pr_usrreqs->pru_attach == NULL ||
343 prp->pr_usrreqs->pru_attach == pru_attach_notsupp)
344 return (EPROTONOSUPPORT);
345
346 if (jailed(cred) && jail_socket_unixiproute_only &&
347 prp->pr_domain->dom_family != PF_LOCAL &&
348 prp->pr_domain->dom_family != PF_INET &&
102#include "opt_mac.h"
103#include "opt_zero.h"
104#include "opt_compat.h"
105
106#include <sys/param.h>
107#include <sys/systm.h>
108#include <sys/fcntl.h>
109#include <sys/limits.h>

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

342
343 if (prp == NULL || prp->pr_usrreqs->pru_attach == NULL ||
344 prp->pr_usrreqs->pru_attach == pru_attach_notsupp)
345 return (EPROTONOSUPPORT);
346
347 if (jailed(cred) && jail_socket_unixiproute_only &&
348 prp->pr_domain->dom_family != PF_LOCAL &&
349 prp->pr_domain->dom_family != PF_INET &&
350#ifdef INET6
351 prp->pr_domain->dom_family != PF_INET6 &&
352#endif
349 prp->pr_domain->dom_family != PF_ROUTE) {
350 return (EPROTONOSUPPORT);
351 }
352
353 if (prp->pr_type != type)
354 return (EPROTOTYPE);
355 so = soalloc();
356 if (so == NULL)

--- 2933 unchanged lines hidden ---
353 prp->pr_domain->dom_family != PF_ROUTE) {
354 return (EPROTONOSUPPORT);
355 }
356
357 if (prp->pr_type != type)
358 return (EPROTOTYPE);
359 so = soalloc();
360 if (so == NULL)

--- 2933 unchanged lines hidden ---