/* Check that ns is within the receive window.  */
int nr_in_rx_window(struct sock *sk, unsigned short ns)
/* Check that ns is within the receive window.  */
int nr_in_rx_window(struct sock *sk, unsigned short ns)
{
	struct nr_sock *nr = nr_sk(sk);
	unsigned short vc = nr->vr;
	unsigned short vt = (nr->vl + nr->window) % NR_MODULUS;
	while (vc != vt) {
		if (ns == vc) return 1;
		vc = (vc + 1) % NR_MODULUS;
	}
	return 0;
}