View | Details | Raw Unified | Return to bug 196035 | Differences between
and this patch

Collapse All | Expand All

(-)sys/netinet/tcp_usrreq.c (-7 / +15 lines)
Lines 460-467 Link Here
460
	inp = sotoinpcb(so);
461
	inp = sotoinpcb(so);
461
	KASSERT(inp != NULL, ("tcp_usr_connect: inp == NULL"));
462
	KASSERT(inp != NULL, ("tcp_usr_connect: inp == NULL"));
462
	INP_WLOCK(inp);
463
	INP_WLOCK(inp);
463
	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
464
	if (inp->inp_flags & (INP_TIMEWAIT)) {
464
		error = EINVAL;
465
		error = EADDRINUSE;
466
		goto out;
467
	}
468
	if (inp->inp_flags & (INP_DROPPED)) {
469
		error = ECONNREFUSED;
465
		goto out;
470
		goto out;
466
	}
471
	}
467
	tp = intotcpcb(inp);
472
	tp = intotcpcb(inp);
Lines 507-514 Link Here
507
	inp = sotoinpcb(so);
512
	inp = sotoinpcb(so);
508
	KASSERT(inp != NULL, ("tcp6_usr_connect: inp == NULL"));
513
	KASSERT(inp != NULL, ("tcp6_usr_connect: inp == NULL"));
509
	INP_WLOCK(inp);
514
	INP_WLOCK(inp);
510
	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
515
	if (inp->inp_flags & (INP_TIMEWAIT)) {
511
		error = EINVAL;
516
		error = EADDRINUSE;
517
		goto out;
518
	}
519
	if (inp->inp_flags & (INP_DROPPED)) {
520
		error = ECONNREFUSED;
512
		goto out;
521
		goto out;
513
	}
522
	}
514
	tp = intotcpcb(inp);
523
	tp = intotcpcb(inp);
Lines 730-736 Link Here
730
	KASSERT(inp != NULL, ("inp == NULL"));
739
	KASSERT(inp != NULL, ("inp == NULL"));
731
	INP_WLOCK(inp);
740
	INP_WLOCK(inp);
732
	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
741
	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
733
		error = ECONNRESET;
742
		error = ENOTCONN;
734
		goto out;
743
		goto out;
735
	}
744
	}
736
	tp = intotcpcb(inp);
745
	tp = intotcpcb(inp);
Lines 763-769 Link Here
763
	KASSERT(inp != NULL, ("tcp_usr_rcvd: inp == NULL"));
772
	KASSERT(inp != NULL, ("tcp_usr_rcvd: inp == NULL"));
764
	INP_WLOCK(inp);
773
	INP_WLOCK(inp);
765
	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
774
	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
766
		error = ECONNRESET;
775
		error = ENOTCONN;
767
		goto out;
776
		goto out;
768
	}
777
	}
769
	tp = intotcpcb(inp);
778
	tp = intotcpcb(inp);
Lines 814-820 Link Here
814
			m_freem(control);
823
			m_freem(control);
815
		if (m)
824
		if (m)
816
			m_freem(m);
825
			m_freem(m);
817
		error = ECONNRESET;
826
		error = ENOTCONN;
818
		goto out;
827
		goto out;
819
	}
828
	}
820
#ifdef INET6
829
#ifdef INET6

Return to bug 196035