The code in tcp_input() to disallow a socket from connecting to itself
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 11 Aug 1993 05:17:33 +0000 (21:17 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 11 Aug 1993 05:17:33 +0000 (21:17 -0800)
is no longer needed as the problem with the SYN,ACK war has been fixed.

SCCS-vsn: sys/netinet/tcp_input.c 8.2

usr/src/sys/netinet/tcp_input.c

index 44e17b2..210bada 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)tcp_input.c 8.1 (Berkeley) %G%
+ *     @(#)tcp_input.c 8.2 (Berkeley) %G%
  */
 
 #ifndef TUBA_INCLUDE
  */
 
 #ifndef TUBA_INCLUDE
@@ -625,14 +625,6 @@ findpcb:
                        tp->t_state = TCPS_SYN_RECEIVED;
 
 trimthenstep6:
                        tp->t_state = TCPS_SYN_RECEIVED;
 
 trimthenstep6:
-               /*
-                * Must not talk to ourselves.
-                */
-               if (inp->inp_laddr.s_addr == inp->inp_faddr.s_addr &&
-                   inp->inp_lport == inp->inp_fport) {
-                       dropsocket = 1; /* do an ECONNRESET */
-                       goto dropwithreset;
-               }
                /*
                 * Advance ti->ti_seq to correspond to first data byte.
                 * If data, trim to stay within window,
                /*
                 * Advance ti->ti_seq to correspond to first data byte.
                 * If data, trim to stay within window,
@@ -708,8 +700,7 @@ trimthenstep6:
                                tiflags &= ~TH_URG;
                        todrop--;
                }
                                tiflags &= ~TH_URG;
                        todrop--;
                }
-               if (todrop > ti->ti_len ||
-                   todrop == ti->ti_len && (tiflags&TH_FIN) == 0) {
+               if (todrop >= ti->ti_len) {
                        tcpstat.tcps_rcvduppack++;
                        tcpstat.tcps_rcvdupbyte += ti->ti_len;
                        /*
                        tcpstat.tcps_rcvduppack++;
                        tcpstat.tcps_rcvdupbyte += ti->ti_len;
                        /*