Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41644
b: refs/heads/master
c: d7f7365
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Dec 3, 2006
1 parent c8e7919 commit 848d5ca
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 865e9022d88ceedd89fa1079a6e1f9266ccd3711
refs/heads/master: d7f7365f5776723da6df73540d855069c2daaa5c
9 changes: 2 additions & 7 deletions trunk/net/dccp/ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,8 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
/* 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);

dp->dccps_iss = secure_dccp_sequence_number(inet->saddr, inet->daddr,
inet->sport, inet->dport);
inet->id = dp->dccps_iss ^ jiffies;

err = dccp_connect(sk);
Expand Down
28 changes: 16 additions & 12 deletions trunk/net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,19 @@ static inline void dccp_v6_send_check(struct sock *sk, int unused_value,
dh->dccph_checksum = dccp_v6_csum_finish(skb, &np->saddr, &np->daddr);
}

static inline __u32 dccp_v6_init_sequence(const struct sk_buff *skb)
static inline __u32 secure_dccpv6_sequence_number(__u32 *saddr, __u32 *daddr,
__u16 sport, __u16 dport )
{
return secure_tcpv6_sequence_number(skb->nh.ipv6h->daddr.s6_addr32,
skb->nh.ipv6h->saddr.s6_addr32,
dccp_hdr(skb)->dccph_dport,
dccp_hdr(skb)->dccph_sport );
return secure_tcpv6_sequence_number(saddr, daddr, sport, dport);
}

static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb)
{
return secure_dccpv6_sequence_number(skb->nh.ipv6h->daddr.s6_addr32,
skb->nh.ipv6h->saddr.s6_addr32,
dccp_hdr(skb)->dccph_dport,
dccp_hdr(skb)->dccph_sport );

}

static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
Expand Down Expand Up @@ -1065,13 +1072,10 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
err = inet6_hash_connect(&dccp_death_row, sk);
if (err)
goto late_failure;
/* FIXME */
#if 0
dp->dccps_gar = secure_dccp_v6_sequence_number(np->saddr.s6_addr32,
np->daddr.s6_addr32,
inet->sport,
inet->dport);
#endif

dp->dccps_iss = secure_dccpv6_sequence_number(np->saddr.s6_addr32,
np->daddr.s6_addr32,
inet->sport, inet->dport);
err = dccp_connect(sk);
if (err)
goto late_failure;
Expand Down
6 changes: 5 additions & 1 deletion trunk/net/dccp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ static inline void dccp_connect_init(struct sock *sk)

dccp_sync_mss(sk, dst_mtu(dst));

dccp_update_gss(sk, dp->dccps_iss);
/*
* SWL and AWL are initially adjusted so that they are not less than
* the initial Sequence Numbers received and sent, respectively:
Expand All @@ -457,8 +456,13 @@ static inline void dccp_connect_init(struct sock *sk)
* These adjustments MUST be applied only at the beginning of the
* connection.
*/
dccp_update_gss(sk, dp->dccps_iss);
dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss));

/* S.GAR - greatest valid acknowledgement number received on a non-Sync;
* initialized to S.ISS (sec. 8.5) */
dp->dccps_gar = dp->dccps_iss;

icsk->icsk_retransmits = 0;
init_timer(&dp->dccps_xmit_timer);
dp->dccps_xmit_timer.data = (unsigned long)sk;
Expand Down

0 comments on commit 848d5ca

Please sign in to comment.