2.6.27 [BUG-FIX] [PATCH 1/1] dccp: Port redirection support for DCCP
Subsystems (2)
Dave, can you please consider the patch below. This fixes a bug for DCCP in the current netdev-2.6 tree (2.6.27).
---------------------------> 2.6.27 patch <-----------------------------
dccp: Port redirection support for DCCP
Commit a3116ac5c216fc3c145906a46df9ce542ff7dcf2 from 1st October ("tcp: Port redirection support for TCP") broke DCCP skb lookup by changing inet_csk_clone, which is used by DCCP to generate the child socket after the handshake.
This patch updates DCCP to use 'loc_port' instead of 'sport', which fixes the problem, and thus inheriting port redirection support via the new interface.
--- net/dccp/ipv6.c | 2 +- net/dccp/minisocks.c | 1 + net/dccp/output.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
net/dccp/minisocks.c +1 -0
@@ -309,6 +309,7 @@ void dccp_reqsk_init(struct request_sockstruct dccp_request_sock *dreq =dccp_rsk (req);inet_rsk (req)->rmt_port =dccp_hdr (skb)->dccph_sport; +inet_rsk (req)->loc_port =dccp_hdr (skb)->dccph_dport;inet_rsk (req)->acked =0 ; req->rcv_wnd = sysctl_dccp_feat_sequence_window; dreq->dreq_timestamp_echo =0 ;
net/dccp/ipv6.c +1 -1
@@ -259,7 +259,7 @@ static int dccp_v6_send_response(struct fl.fl6_flowlabel =0 ; fl.oif = ireq6->iif; fl.fl_ip_dport =inet_rsk (req)->rmt_port; - fl.fl_ip_sport =inet_sk (sk)->sport; + fl.fl_ip_sport =inet_rsk (req)->loc_port;security_req_classify_flow (req, &fl); opt = np->opt;
net/dccp/output.c +1 -1
@@ -347,7 +347,7 @@ struct sk_buff *dccp_make_response(struc/* Build and checksum header */ dh =dccp_zeroed_hdr (skb, dccp_header_size); - dh->dccph_sport =inet_sk (sk)->sport; + dh->dccph_sport =inet_rsk (req)->loc_port; dh->dccph_dport =inet_rsk (req)->rmt_port; dh->dccph_doff = (dccp_header_size +DCCP_SKB_CB (skb)->dccpd_opt_len) /4 ;
Hi,
Quoted 10 lines · Gerrit Renker
Commit
a3116ac5c216fc3c145906a46df9ce542ff7dcf2from 1st October ("tcp:
Port redirection support for TCP") broke DCCP skb lookup by changinginet_csk_clone, which is used by DCCP to generate the child socket after the handshake.This patch updates DCCP to use '
loc_port' instead of 'sport', which fixes the problem, and thus inheriting port redirection support via the new interface.Signed-off-by Gerrit Renker <[email protected]>
Yeah, Gerrit and me simultaneously found this to be the culprit. One minor comment below.
Quoted 30 lines
--- net/dccp/ipv6.c | 2 +- net/dccp/minisocks.c | 1 + net/dccp/output.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)net/dccp/minisocks.c +1
-0@@ -309,6 +309,7 @@ void dccp_reqsk_init(struct request_sockstruct dccp_request_sock *dreq =dccp_rsk (req);inet_rsk (req)->rmt_port =dccp_hdr (skb)->dccph_sport; +inet_rsk (req)->loc_port =dccp_hdr (skb)->dccph_dport;inet_rsk (req)->acked =0 ; req->rcv_wnd = sysctl_dccp_feat_sequence_window; dreq->dreq_timestamp_echo =0 ;net/dccp/ipv6.c +1
-1@@ -259,7 +259,7 @@ static int dccp_v6_send_response(struct fl.fl6_flowlabel =0 ; fl.oif = ireq6->iif; fl.fl_ip_dport =inet_rsk (req)->rmt_port; - fl.fl_ip_sport =inet_sk (sk)->sport; + fl.fl_ip_sport =inet_rsk (req)->loc_port;security_req_classify_flow (req, &fl); opt = np->opt;
net/dccp/output.c struct sk_buff *dccp_make_response(struc · line 353
Quoted 8 lines
net/dccp/output.c +1
-1@@ -347,7 +347,7 @@ struct sk_buff *dccp_make_response(struc/* Build and checksum header */ dh =dccp_zeroed_hdr (skb, dccp_header_size); - dh->dccph_sport =inet_sk (sk)->sport; + dh->dccph_sport =inet_rsk (req)->loc_port; dh->dccph_dport =inet_rsk (req)->rmt_port; dh->dccph_doff = (dccp_header_size +DCCP_SKB_CB (skb)->dccpd_opt_len) /4 ;
I think we're still missing this one:
net/dccp/ipv6.c +1 -1
@@ -558,7 +558,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,ipv6_addr_copy (&fl.fl6_src, &ireq6->loc_addr); fl.oif = sk->sk_bound_dev_if; fl.fl_ip_dport =inet_rsk (req)->rmt_port; - fl.fl_ip_sport =inet_sk (sk)->sport; + fl.fl_ip_sport =inet_rsk (req)->loc_port;security_sk_classify_flow (sk, &fl);if (ip6_dst_lookup (sk, &dst, &fl))
What do you think?
Signature · 1 line
KOVACS Krisztian
Re: 2.6.27 [BUG-FIX] [PATCH 1/1] dccp: Port redirection support for?DCCP
| I think we're still missing this one: | | diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c | index 1106278..aa00cdd 100644 | --- a/net/dccp/ipv6.c | +++ b/net/dccp/ipv6.c | @@ -558,7 +558,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk, | ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); | fl.oif = sk->sk_bound_dev_if; | fl.fl_ip_dport = inet_rsk(req)->rmt_port; | - fl.fl_ip_sport = inet_sk(sk)->sport; | + fl.fl_ip_sport = inet_rsk(req)->loc_port; | security_sk_classify_flow(sk, &fl); | | if (ip6_dst_lookup(sk, &dst, &fl)) | | What do you think?
Ack - missed this one. Do you want to send your patch or would you like me to send an update for the above?
Thanks
Gerrit
Hi,
Quoted 19 lines · Gerrit Renker
| I think we're still missing this one: | | diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c | index 1106278..aa00cdd 100644 | --- a/net/dccp/ipv6.c | +++ b/net/dccp/ipv6.c | @@ -558,7 +558,7 @@ static struct sock | *dccp_v6_request_recv_sock(struct sock *sk, | ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); | fl.oif = sk->sk_bound_dev_if; | fl.fl_ip_dport = inet_rsk(req)->rmt_port; | - fl.fl_ip_sport = inet_sk(sk)->sport; | + fl.fl_ip_sport = inet_rsk(req)->loc_port; | security_sk_classify_flow(sk, &fl); | | if (ip6_dst_lookup(sk, &dst, &fl)) | | What do you think?
Quoted 2 lines
Ack - missed this one. Do you want to send your patch or would you like me to send an update for the above?
Dave & Gerrit, please find the updated patch below.
- 8< -
dccp: Port redirection support for DCCP
Commit a3116ac5c216fc3c145906a46df9ce542ff7dcf2 from 1st October ("tcp: Port redirection support for TCP") broke DCCP skb lookup by changing inet_csk_clone, which is used by DCCP to generate the child socket after the handshake.
This patch updates DCCP to use 'loc_port' instead of 'sport', which fixes the problem, and thus inheriting port redirection support via the new interface.
--- net/dccp/ipv6.c | 4 ++-- net/dccp/minisocks.c | 1 + net/dccp/output.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
net/dccp/ipv6.c +2 -2
@@ -259,7 +259,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req) fl.fl6_flowlabel =0 ; fl.oif = ireq6->iif; fl.fl_ip_dport =inet_rsk (req)->rmt_port; - fl.fl_ip_sport =inet_sk (sk)->sport; + fl.fl_ip_sport =inet_rsk (req)->loc_port;security_req_classify_flow (req, &fl); opt = np->opt;
@@ -558,7 +558,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,ipv6_addr_copy (&fl.fl6_src, &ireq6->loc_addr); fl.oif = sk->sk_bound_dev_if; fl.fl_ip_dport =inet_rsk (req)->rmt_port; - fl.fl_ip_sport =inet_sk (sk)->sport; + fl.fl_ip_sport =inet_rsk (req)->loc_port;security_sk_classify_flow (sk, &fl);if (ip6_dst_lookup (sk, &dst, &fl))
net/dccp/minisocks.c +1 -0
@@ -309,6 +309,7 @@ void dccp_reqsk_init(struct request_sock *req, struct sk_buff *skb)struct dccp_request_sock *dreq =dccp_rsk (req);inet_rsk (req)->rmt_port =dccp_hdr (skb)->dccph_sport; +inet_rsk (req)->loc_port =dccp_hdr (skb)->dccph_dport;inet_rsk (req)->acked =0 ; req->rcv_wnd = sysctl_dccp_feat_sequence_window; dreq->dreq_timestamp_echo =0 ;
net/dccp/output.c +1 -1
@@ -347,7 +347,7 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,/* Build and checksum header */ dh =dccp_zeroed_hdr (skb, dccp_header_size); - dh->dccph_sport =inet_sk (sk)->sport; + dh->dccph_sport =inet_rsk (req)->loc_port; dh->dccph_dport =inet_rsk (req)->rmt_port; dh->dccph_doff = (dccp_header_size +DCCP_SKB_CB (skb)->dccpd_opt_len) /4 ;
Signature · 1 line
1.5.4.4
Arnaldo Carvalho de Melo
Acked-byEm Sat, Oct 18, 2008 at 12:21:58PM +0200, KOVACS Krisztian escreveu:
Quoted 34 lines
Hi,
Quoted 19 lines · Gerrit Renker
| I think we're still missing this one: | | diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c | index 1106278..aa00cdd 100644 | --- a/net/dccp/ipv6.c | +++ b/net/dccp/ipv6.c | @@ -558,7 +558,7 @@ static struct sock | *dccp_v6_request_recv_sock(struct sock *sk, | ipv6_addr_copy(&fl.fl6_src, &ireq6->loc_addr); | fl.oif = sk->sk_bound_dev_if; | fl.fl_ip_dport = inet_rsk(req)->rmt_port; | - fl.fl_ip_sport = inet_sk(sk)->sport; | + fl.fl_ip_sport = inet_rsk(req)->loc_port; | security_sk_classify_flow(sk, &fl); | | if (ip6_dst_lookup(sk, &dst, &fl)) | | What do you think?Quoted 2 lines
Ack - missed this one. Do you want to send your patch or would you like me to send an update for the above?
Dave & Gerrit, please find the updated patch below.
- 8< -
dccp: Port redirection support for DCCPCommit
a3116ac5c216fc3c145906a46df9ce542ff7dcf2from 1st October ("tcp: Port redirection support for TCP") broke DCCP skb lookup by changinginet_csk_clone, which is used by DCCP to generate the child socket after the handshake.
Quoted 5 lines
This patch updates DCCP to use '
loc_port' instead of 'sport', which fixes the problem, and thus inheriting port redirection support via the new interface.Signed-off-by Gerrit Renker <[email protected]>Signed-off-by KOVACS Krisztian <[email protected]>
Good work! Better two fixes than none! :-)
- Arnaldo
From: Arnaldo Carvalho de Melo <[email protected]>
Date: Sat, 18 Oct 2008 12:25:02 -0300
Quoted 10 lines
Em Sat, Oct 18, 2008 at 12:21:58PM +0200, KOVACS Krisztian escreveu:
Quoted 9 lines
dccp: Port redirection support for DCCP
Commit
a3116ac5c216fc3c145906a46df9ce542ff7dcf2from 1st October ("tcp: Port redirection support for TCP") broke DCCP skb lookup by changinginet_csk_clone, which is used by DCCP to generate the child socket after the handshake.This patch updates DCCP to use '
loc_port' instead of 'sport', which fixes the problem, and thus inheriting port redirection support via the new interface.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Gerrit Renker <[email protected]>Signed-off-by KOVACS Krisztian <[email protected]>Good work! Better two fixes than none! :-)
Applied, thanks everyone.