in_pcb.c (f1d19042b082d95f07a0027e596ba2405aa8a9a5) in_pcb.c (831a80b0d5d50e416fe5e4b237d3a9fd4eea00b8)
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

--- 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 * @(#)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

--- 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 * @(#)in_pcb.c 8.4 (Berkeley) 5/24/95
34 * $Id: in_pcb.c,v 1.45 1998/09/17 18:42:16 fenner Exp $
34 * $Id: in_pcb.c,v 1.46 1998/12/07 21:58:37 archie Exp $
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/malloc.h>
40#include <sys/mbuf.h>
41#include <sys/protosw.h>
42#include <sys/socket.h>

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

434{
435 struct sockaddr_in *ifaddr;
436 register struct sockaddr_in *sin = (struct sockaddr_in *)nam;
437 int error;
438
439 /*
440 * Call inner routine, to assign local interface address.
441 */
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/malloc.h>
40#include <sys/mbuf.h>
41#include <sys/protosw.h>
42#include <sys/socket.h>

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

434{
435 struct sockaddr_in *ifaddr;
436 register struct sockaddr_in *sin = (struct sockaddr_in *)nam;
437 int error;
438
439 /*
440 * Call inner routine, to assign local interface address.
441 */
442 if (error = in_pcbladdr(inp, nam, &ifaddr))
442 if ((error = in_pcbladdr(inp, nam, &ifaddr)) != 0)
443 return(error);
444
445 if (in_pcblookup_hash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
446 inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
447 inp->inp_lport, 0) != NULL) {
448 return (EADDRINUSE);
449 }
450 if (inp->inp_laddr.s_addr == INADDR_ANY) {

--- 447 unchanged lines hidden ---
443 return(error);
444
445 if (in_pcblookup_hash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
446 inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
447 inp->inp_lport, 0) != NULL) {
448 return (EADDRINUSE);
449 }
450 if (inp->inp_laddr.s_addr == INADDR_ANY) {

--- 447 unchanged lines hidden ---