提交 c86ab2b6 编写于 作者: G Gerrit Renker 提交者: David S. Miller

[DCCP]: Ignore Ack Vectors / Elapsed Time on DCCP-Request also

Small update with regard to RFC 4340 (references added as documentation):
on Requests, Ack Vectors / Elapsed Time should be ignored.
Length handling of Elapsed Time also simplified.
Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: NIan McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6d57b43b
...@@ -136,7 +136,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb) ...@@ -136,7 +136,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
break; break;
case DCCPO_ACK_VECTOR_0: case DCCPO_ACK_VECTOR_0:
case DCCPO_ACK_VECTOR_1: case DCCPO_ACK_VECTOR_1:
if (pkt_type == DCCP_PKT_DATA) if (dccp_packet_without_ack(skb)) /* RFC 4340, 11.4 */
break; break;
if (dccp_msk(sk)->dccpms_send_ack_vector && if (dccp_msk(sk)->dccpms_send_ack_vector &&
...@@ -194,18 +194,17 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb) ...@@ -194,18 +194,17 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
opt_recv->dccpor_elapsed_time = elapsed_time; opt_recv->dccpor_elapsed_time = elapsed_time;
break; break;
case DCCPO_ELAPSED_TIME: case DCCPO_ELAPSED_TIME:
if (len != 2 && len != 4) if (dccp_packet_without_ack(skb)) /* RFC 4340, 13.2 */
goto out_invalid_option; break;
if (pkt_type == DCCP_PKT_DATA)
continue;
if (len == 2) { if (len == 2) {
__be16 opt_val2 = get_unaligned((__be16 *)value); __be16 opt_val2 = get_unaligned((__be16 *)value);
elapsed_time = ntohs(opt_val2); elapsed_time = ntohs(opt_val2);
} else { } else if (len == 4) {
opt_val = get_unaligned((__be32 *)value); opt_val = get_unaligned((__be32 *)value);
elapsed_time = ntohl(opt_val); elapsed_time = ntohl(opt_val);
} else {
goto out_invalid_option;
} }
if (elapsed_time > opt_recv->dccpor_elapsed_time) if (elapsed_time > opt_recv->dccpor_elapsed_time)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册