/* * SWL and AWL are initially adjusted so that they are not less than * the initial Sequence Numbers received and sent, respectively: *	SWL := max(GSR + 1 - floor(W/4), ISR), *	AWL := max(GSS - W' + 1, ISS). * These adjustments MUST be applied only at the beginning of the * connection. */ dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss));  
static int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr,			   int addr_len){	struct inet_sock *inet = inet_sk(sk);	struct dccp_sock *dp = dccp_sk(sk);	const struct sockaddr_in *usin = (struct sockaddr_in *)uaddr;	struct rtable *rt;	u32 daddr, nexthop;	int tmp;	int err;	dp->dccps_role = DCCP_ROLE_CLIENT;	if (addr_len < sizeof(struct sockaddr_in))		return -EINVAL;	if (usin->sin_family != AF_INET)		return -EAFNOSUPPORT;	nexthop = daddr = usin->sin_addr.s_addr;	if (inet->opt != NULL && inet->opt->srr) {		if (daddr == 0)			return -EINVAL;		nexthop = inet->opt->faddr;	}	tmp = ip_route_connect(&rt, nexthop, inet->saddr,			       RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,			       IPPROTO_DCCP,			       inet->sport, usin->sin_port, sk);	if (tmp < 0)		return tmp;	if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) {		ip_rt_put(rt);		return -ENETUNREACH;	}	if (inet->opt == NULL || !inet->opt->srr)		daddr = rt->rt_dst;	if (inet->saddr == 0)		inet->saddr = rt->rt_src;	inet->rcv_saddr = inet->saddr;	inet->dport = usin->sin_port;	inet->daddr = daddr;	dp->dccps_ext_header_len = 0;	if (inet->opt != NULL)		dp->dccps_ext_header_len = inet->opt->optlen;	/*	 * Socket identity is still unknown (sport may be zero).	 * However we set state to DCCP_REQUESTING and not releasing socket	 * lock select source port, enter ourselves into the hash tables and	 * complete initialization after this.	 */	dccp_set_state(sk, DCCP_REQUESTING);	err = dccp_v4_hash_connect(sk);	if (err != 0)		goto failure;	err = ip_route_newports(&rt, inet->sport, inet->dport, sk);	if (err != 0)		goto failure;	/* OK, now commit destination to socket.  */	sk_setup_caps(sk, &rt->u.dst);	dp->dccps_gar =		dp->dccps_iss = secure_dccp_sequence_number(inet->saddr,							    inet->daddr,							    inet->sport,							    usin->sin_port);	dccp_update_gss(sk, dp->dccps_iss);	inet->id = dp->dccps_iss ^ jiffies;	err = dccp_connect(sk);	rt = NULL;	if (err != 0)		goto failure;out:	return err;failure:	/*	 * This unhashes the socket and releases the local port, if necessary.	 */	dccp_set_state(sk, DCCP_CLOSED);	ip_rt_put(rt);	sk->sk_route_caps = 0;	inet->dport = 0;	goto out;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/03ace394ac9bcad38043a381ae5f4860b9c9fa1c/ipv4.c/clean/net/dccp/ipv4.c