Deleted Added
full compact
tcp_reass.c (27135) tcp_reass.c (28270)
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95
34 * $Id: tcp_input.c,v 1.58 1997/04/27 20:01:13 wollman Exp $
34 * $Id: tcp_input.c,v 1.59 1997/07/01 05:42:16 jdp Exp $
35 */
36
37#ifndef TUBA_INCLUDE
38#include <sys/param.h>
39#include <sys/queue.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#include <sys/sysctl.h>

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

635 /*
636 * RFC1122 4.2.3.10, p. 104: discard bcast/mcast SYN
637 * in_broadcast() should never return true on a received
638 * packet with M_BCAST not set.
639 */
640 if (m->m_flags & (M_BCAST|M_MCAST) ||
641 IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
642 goto drop;
35 */
36
37#ifndef TUBA_INCLUDE
38#include <sys/param.h>
39#include <sys/queue.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#include <sys/sysctl.h>

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

635 /*
636 * RFC1122 4.2.3.10, p. 104: discard bcast/mcast SYN
637 * in_broadcast() should never return true on a received
638 * packet with M_BCAST not set.
639 */
640 if (m->m_flags & (M_BCAST|M_MCAST) ||
641 IN_MULTICAST(ntohl(ti->ti_dst.s_addr)))
642 goto drop;
643 am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */
644 if (am == NULL)
643 MALLOC(sin, struct sockaddr_in *, sizeof *sin, M_SONAME,
644 M_NOWAIT);
645 if (sin == NULL)
645 goto drop;
646 goto drop;
646 am->m_len = sizeof (struct sockaddr_in);
647 sin = mtod(am, struct sockaddr_in *);
648 sin->sin_family = AF_INET;
649 sin->sin_len = sizeof(*sin);
650 sin->sin_addr = ti->ti_src;
651 sin->sin_port = ti->ti_sport;
652 bzero((caddr_t)sin->sin_zero, sizeof(sin->sin_zero));
653 laddr = inp->inp_laddr;
654 if (inp->inp_laddr.s_addr == INADDR_ANY)
655 inp->inp_laddr = ti->ti_dst;
647 sin->sin_family = AF_INET;
648 sin->sin_len = sizeof(*sin);
649 sin->sin_addr = ti->ti_src;
650 sin->sin_port = ti->ti_sport;
651 bzero((caddr_t)sin->sin_zero, sizeof(sin->sin_zero));
652 laddr = inp->inp_laddr;
653 if (inp->inp_laddr.s_addr == INADDR_ANY)
654 inp->inp_laddr = ti->ti_dst;
656 if (in_pcbconnect(inp, am, &proc0)) { /* XXX creds */
655 if (in_pcbconnect(inp, (struct sockaddr *)sin, &proc0)) {
657 inp->inp_laddr = laddr;
656 inp->inp_laddr = laddr;
658 (void) m_free(am);
657 FREE(sin, M_SONAME);
659 goto drop;
660 }
658 goto drop;
659 }
661 (void) m_free(am);
660 FREE(sin, M_SONAME);
662 tp->t_template = tcp_template(tp);
663 if (tp->t_template == 0) {
664 tp = tcp_drop(tp, ENOBUFS);
665 dropsocket = 0; /* socket is already gone */
666 goto drop;
667 }
668 if ((taop = tcp_gettaocache(inp)) == NULL) {
669 taop = &tao_noncached;

--- 1464 unchanged lines hidden ---
661 tp->t_template = tcp_template(tp);
662 if (tp->t_template == 0) {
663 tp = tcp_drop(tp, ENOBUFS);
664 dropsocket = 0; /* socket is already gone */
665 goto drop;
666 }
667 if ((taop = tcp_gettaocache(inp)) == NULL) {
668 taop = &tao_noncached;

--- 1464 unchanged lines hidden ---