View | Details | Raw Unified | Return to bug 25195
Collapse All | Expand All

(-)sys/netinet/in_pcb.c (-10 / +8 lines)
Lines 671-677 Link Here
671
 * a valid TCP sequence number for the session.
671
 * a valid TCP sequence number for the session.
672
 */
672
 */
673
void
673
void
674
in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify, tcp_sequence, tcp_seq_check)
674
in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify, tcp_sequence,
675
		tcp_seq_check, wild_match)
675
	struct inpcbhead *head;
676
	struct inpcbhead *head;
676
	struct sockaddr *dst;
677
	struct sockaddr *dst;
677
	u_int fport_arg, lport_arg;
678
	u_int fport_arg, lport_arg;
Lines 680-685 Link Here
680
	void (*notify) __P((struct inpcb *, int));
681
	void (*notify) __P((struct inpcb *, int));
681
	u_int32_t tcp_sequence;
682
	u_int32_t tcp_sequence;
682
	int tcp_seq_check;
683
	int tcp_seq_check;
684
	int wild_match;
683
{
685
{
684
	register struct inpcb *inp, *oinp;
686
	register struct inpcb *inp, *oinp;
685
	struct in_addr faddr;
687
	struct in_addr faddr;
Lines 700-708 Link Here
700
	 * deliver only to that socket.
702
	 * deliver only to that socket.
701
	 */
703
	 */
702
	if (PRC_IS_REDIRECT(cmd) || cmd == PRC_HOSTDEAD) {
704
	if (PRC_IS_REDIRECT(cmd) || cmd == PRC_HOSTDEAD) {
703
		fport = 0;
705
		wild_match = IN_PCBNOTIFY_WILDCARD;
704
		lport = 0;
705
		laddr.s_addr = 0;
706
		if (cmd != PRC_HOSTDEAD)
706
		if (cmd != PRC_HOSTDEAD)
707
			notify = in_rtchange;
707
			notify = in_rtchange;
708
	}
708
	}
Lines 715-725 Link Here
715
			continue;
715
			continue;
716
		}
716
		}
717
#endif
717
#endif
718
		if (inp->inp_faddr.s_addr != faddr.s_addr ||
718
		if (inp->inp_faddr.s_addr != faddr.s_addr || inp->inp_socket == 0 ||
719
		    inp->inp_socket == 0 ||
719
			(wild_match == IN_PCBNOTIFY_NOT_WILDCARD &&
720
		    (lport && inp->inp_lport != lport) ||
720
			(inp->inp_lport != lport || inp->inp_laddr.s_addr != laddr.s_addr ||
721
		    (laddr.s_addr && inp->inp_laddr.s_addr != laddr.s_addr) ||
721
		    inp->inp_fport != fport))) {
722
		    (fport && inp->inp_fport != fport)) {
723
			inp = LIST_NEXT(inp, inp_list);
722
			inp = LIST_NEXT(inp, inp_list);
724
			continue;
723
			continue;
725
		}
724
		}
Lines 733-739 Link Here
733
		 * and TCP port numbers.
732
		 * and TCP port numbers.
734
		 */
733
		 */
735
		if ((tcp_seq_check == 1) && (tcp_seq_vs_sess(inp, tcp_sequence) == 0)) {
734
		if ((tcp_seq_check == 1) && (tcp_seq_vs_sess(inp, tcp_sequence) == 0)) {
736
			inp = LIST_NEXT(inp, inp_list);
737
			break;
735
			break;
738
		}
736
		}
739
		oinp = inp;
737
		oinp = inp;
(-)sys/netinet/in_pcb.h (-1 / +3 lines)
Lines 291-297 Link Here
291
			       int, struct ifnet *));
291
			       int, struct ifnet *));
292
void	in_pcbnotify __P((struct inpcbhead *, struct sockaddr *,
292
void	in_pcbnotify __P((struct inpcbhead *, struct sockaddr *,
293
	    u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int),
293
	    u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int),
294
		u_int32_t, int));
294
		u_int32_t, int, int));
295
#define	IN_PCBNOTIFY_NOT_WILDCARD	0
296
#define	IN_PCBNOTIFY_WILDCARD	1
295
void	in_pcbrehash __P((struct inpcb *));
297
void	in_pcbrehash __P((struct inpcb *));
296
int	in_setpeeraddr __P((struct socket *so, struct sockaddr **nam));
298
int	in_setpeeraddr __P((struct socket *so, struct sockaddr **nam));
297
int	in_setsockaddr __P((struct socket *so, struct sockaddr **nam));
299
int	in_setsockaddr __P((struct socket *so, struct sockaddr **nam));
(-)sys/netinet/tcp_subr.c (-2 / +4 lines)
Lines 1033-1041 Link Here
1033
		if (tcp_seq_check == 1)
1033
		if (tcp_seq_check == 1)
1034
			tcp_sequence = ntohl(th->th_seq);
1034
			tcp_sequence = ntohl(th->th_seq);
1035
		in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport,
1035
		in_pcbnotify(&tcb, sa, th->th_dport, ip->ip_src, th->th_sport,
1036
			cmd, notify, tcp_sequence, tcp_seq_check);
1036
			cmd, notify, tcp_sequence, tcp_seq_check,
1037
			IN_PCBNOTIFY_NOT_WILDCARD);
1037
	} else
1038
	} else
1038
		in_pcbnotify(&tcb, sa, 0, zeroin_addr, 0, cmd, notify, 0, 0);
1039
		in_pcbnotify(&tcb, sa, 0, zeroin_addr, 0, cmd, notify, 0,
1040
			0, IN_PCBNOTIFY_WILDCARD);
1039
}
1041
}
1040
1042
1041
#ifdef INET6
1043
#ifdef INET6
(-)sys/netinet/udp_usrreq.c (-2 / +3 lines)
Lines 512-520 Link Here
512
	if (ip) {
512
	if (ip) {
513
		uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
513
		uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
514
		in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
514
		in_pcbnotify(&udb, sa, uh->uh_dport, ip->ip_src, uh->uh_sport,
515
			cmd, udp_notify, 0, 0);
515
			cmd, udp_notify, 0, 0, IN_PCBNOTIFY_NOT_WILDCARD);
516
	} else
516
	} else
517
		in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify, 0, 0);
517
		in_pcbnotify(&udb, sa, 0, zeroin_addr, 0, cmd, udp_notify, 0,
518
			0, IN_PCBNOTIFY_WILDCARD);
518
}
519
}
519
520
520
static int
521
static int

Return to bug 25195