netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] tcpv[46]: fix md5 pseudoheader address field ordering
@ 2008-10-09  9:35 Ilpo Järvinen
  2008-10-09  9:35 ` [PATCH 2/4] tcpv6: trivial formatting changes to send_(ack|reset) Ilpo Järvinen
  2008-10-09 21:37 ` [PATCH 1/4] tcpv[46]: fix md5 pseudoheader address field ordering David Miller
  0 siblings, 2 replies; 13+ messages in thread
From: Ilpo Järvinen @ 2008-10-09  9:35 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Ilpo J�rvinen

Maybe it's just me but I guess those md5 people made a mess
out of it by having *_md5_hash_* to use daddr, saddr order
instead of the one that is natural (and equal to what csum
functions use). For the segment were sending, the original
addresses are reversed so buff's saddr == skb's daddr and
vice-versa.

Maybe I can finally proceed with unification of some code
after fixing it first... :-)

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 net/ipv4/tcp_ipv4.c |    4 ++--
 net/ipv6/tcp_ipv6.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index ba46769..5c8fa7f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -583,8 +583,8 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
 		rep.th.doff = arg.iov[0].iov_len / 4;
 
 		tcp_v4_md5_hash_hdr((__u8 *) &rep.opt[1],
-				     key, ip_hdr(skb)->daddr,
-				     ip_hdr(skb)->saddr, &rep.th);
+				     key, ip_hdr(skb)->saddr,
+				     ip_hdr(skb)->daddr, &rep.th);
 	}
 #endif
 	arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr,
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 9c9ecf4..2084f5a 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1006,8 +1006,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
 			       (TCPOPT_MD5SIG << 8) |
 			       TCPOLEN_MD5SIG);
 		tcp_v6_md5_hash_hdr((__u8 *)&opt[1], key,
-				    &ipv6_hdr(skb)->daddr,
-				    &ipv6_hdr(skb)->saddr, t1);
+				    &ipv6_hdr(skb)->saddr,
+				    &ipv6_hdr(skb)->daddr, t1);
 	}
 #endif
 
-- 
1.5.2.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-10-10 12:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-09  9:35 [PATCH 1/4] tcpv[46]: fix md5 pseudoheader address field ordering Ilpo Järvinen
2008-10-09  9:35 ` [PATCH 2/4] tcpv6: trivial formatting changes to send_(ack|reset) Ilpo Järvinen
2008-10-09  9:35   ` [PATCH 3/4] tcpv6: convert opt[] -> topt in tcp_v6_send_reset Ilpo Järvinen
2008-10-09  9:35     ` [PATCH 4/4] tcpv6: combine tcp_v6_send_(reset|ack) Ilpo Järvinen
2008-10-09 21:42       ` David Miller
2008-10-09 21:42     ` [PATCH 3/4] tcpv6: convert opt[] -> topt in tcp_v6_send_reset David Miller
2008-10-09  9:52   ` [PATCH 2/4] tcpv6: trivial formatting changes to send_(ack|reset) YOSHIFUJI Hideaki / 吉藤英明
2008-10-09  9:58     ` Ilpo Järvinen
2008-10-09 14:16       ` Arnaldo Carvalho de Melo
2008-10-09 21:38         ` David Miller
2008-10-09 21:40           ` David Miller
2008-10-10 12:00             ` Ilpo Järvinen
2008-10-09 21:37 ` [PATCH 1/4] tcpv[46]: fix md5 pseudoheader address field ordering David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).