Deleted Added
full compact
in_pcb.c (132653) in_pcb.c (132794)
1/*
2 * Copyright (c) 1982, 1986, 1991, 1993, 1995
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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
1/*
2 * Copyright (c) 1982, 1986, 1991, 1993, 1995
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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
30 * $FreeBSD: head/sys/netinet/in_pcb.c 132653 2004-07-26 07:24:04Z cperciva $
30 * $FreeBSD: head/sys/netinet/in_pcb.c 132794 2004-07-28 13:03:07Z yar $
31 */
32
33#include "opt_ipsec.h"
34#include "opt_inet6.h"
35#include "opt_mac.h"
36
37#include <sys/param.h>
38#include <sys/systm.h>

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

338 ((t->inp_vflag & INP_TIMEWAIT) == 0) &&
339 (so->so_type != SOCK_STREAM ||
340 ntohl(t->inp_faddr.s_addr) == INADDR_ANY) &&
341 (ntohl(sin->sin_addr.s_addr) != INADDR_ANY ||
342 ntohl(t->inp_laddr.s_addr) != INADDR_ANY ||
343 (t->inp_socket->so_options &
344 SO_REUSEPORT) == 0) &&
345 (so->so_cred->cr_uid !=
31 */
32
33#include "opt_ipsec.h"
34#include "opt_inet6.h"
35#include "opt_mac.h"
36
37#include <sys/param.h>
38#include <sys/systm.h>

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

338 ((t->inp_vflag & INP_TIMEWAIT) == 0) &&
339 (so->so_type != SOCK_STREAM ||
340 ntohl(t->inp_faddr.s_addr) == INADDR_ANY) &&
341 (ntohl(sin->sin_addr.s_addr) != INADDR_ANY ||
342 ntohl(t->inp_laddr.s_addr) != INADDR_ANY ||
343 (t->inp_socket->so_options &
344 SO_REUSEPORT) == 0) &&
345 (so->so_cred->cr_uid !=
346 t->inp_socket->so_cred->cr_uid)) {
347#if defined(INET6)
348 if (ntohl(sin->sin_addr.s_addr) !=
349 INADDR_ANY ||
350 ntohl(t->inp_laddr.s_addr) !=
351 INADDR_ANY ||
352 INP_SOCKAF(so) ==
353 INP_SOCKAF(t->inp_socket))
354#endif /* defined(INET6) */
346 t->inp_socket->so_cred->cr_uid))
355 return (EADDRINUSE);
347 return (EADDRINUSE);
356 }
357 }
358 if (prison && prison_ip(cred, 0, &sin->sin_addr.s_addr))
359 return (EADDRNOTAVAIL);
360 t = in_pcblookup_local(pcbinfo, sin->sin_addr,
361 lport, prison ? 0 : wild);
362 if (t && (t->inp_vflag & INP_TIMEWAIT)) {
363 if ((reuseport & intotw(t)->tw_so_options) == 0)
364 return (EADDRINUSE);

--- 821 unchanged lines hidden ---
348 }
349 if (prison && prison_ip(cred, 0, &sin->sin_addr.s_addr))
350 return (EADDRNOTAVAIL);
351 t = in_pcblookup_local(pcbinfo, sin->sin_addr,
352 lport, prison ? 0 : wild);
353 if (t && (t->inp_vflag & INP_TIMEWAIT)) {
354 if ((reuseport & intotw(t)->tw_so_options) == 0)
355 return (EADDRINUSE);

--- 821 unchanged lines hidden ---