diff options
| -rw-r--r-- | net/dccp/ipv6.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index da509127e00c..25826b1bf685 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
| @@ -89,6 +89,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
| 89 | { | 89 | { |
| 90 | struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; | 90 | struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; |
| 91 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); | 91 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); |
| 92 | struct dccp_sock *dp; | ||
| 92 | struct ipv6_pinfo *np; | 93 | struct ipv6_pinfo *np; |
| 93 | struct sock *sk; | 94 | struct sock *sk; |
| 94 | int err; | 95 | int err; |
| @@ -116,6 +117,14 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
| 116 | if (sk->sk_state == DCCP_CLOSED) | 117 | if (sk->sk_state == DCCP_CLOSED) |
| 117 | goto out; | 118 | goto out; |
| 118 | 119 | ||
| 120 | dp = dccp_sk(sk); | ||
| 121 | seq = dccp_hdr_seq(dh); | ||
| 122 | if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && | ||
| 123 | !between48(seq, dp->dccps_awl, dp->dccps_awh)) { | ||
| 124 | NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); | ||
| 125 | goto out; | ||
| 126 | } | ||
| 127 | |||
| 119 | np = inet6_sk(sk); | 128 | np = inet6_sk(sk); |
| 120 | 129 | ||
| 121 | if (type == ICMPV6_PKT_TOOBIG) { | 130 | if (type == ICMPV6_PKT_TOOBIG) { |
| @@ -168,7 +177,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
| 168 | 177 | ||
| 169 | icmpv6_err_convert(type, code, &err); | 178 | icmpv6_err_convert(type, code, &err); |
| 170 | 179 | ||
| 171 | seq = dccp_hdr_seq(dh); | ||
| 172 | /* Might be for an request_sock */ | 180 | /* Might be for an request_sock */ |
| 173 | switch (sk->sk_state) { | 181 | switch (sk->sk_state) { |
| 174 | struct request_sock *req, **prev; | 182 | struct request_sock *req, **prev; |
