All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: md5: using remote adress for md5 lookup in rst packet
@ 2012-01-20 22:22 Shawn Lu
  2012-01-22 19:25 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Lu @ 2012-01-20 22:22 UTC (permalink / raw)
  To: davem; +Cc: netdev, xiaoclu

From: shawnlu <shawn.lu@ericsson.com>

md5 key is added in socket through remote address.
remote address should be used in finding md5 key when
sending out reset packet.

Signed-off-by: shawnlu <shawn.lu@ericsson.com>
---
 net/ipv4/tcp_ipv4.c |    2 +-
 net/ipv6/tcp_ipv6.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 1eb4ad5..337ba4c 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -631,7 +631,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
 	arg.iov[0].iov_len  = sizeof(rep.th);
 
 #ifdef CONFIG_TCP_MD5SIG
-	key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->daddr) : NULL;
+	key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->saddr) : NULL;
 	if (key) {
 		rep.opt[0] = htonl((TCPOPT_NOP << 24) |
 				   (TCPOPT_NOP << 16) |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 906c7ca..3edd05a 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1083,7 +1083,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
 
 #ifdef CONFIG_TCP_MD5SIG
 	if (sk)
-		key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr);
+		key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->saddr);
 #endif
 
 	if (th->ack)
-- 
1.7.0.4

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

* Re: [PATCH] tcp: md5: using remote adress for md5 lookup in rst packet
  2012-01-20 22:22 [PATCH] tcp: md5: using remote adress for md5 lookup in rst packet Shawn Lu
@ 2012-01-22 19:25 ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-01-22 19:25 UTC (permalink / raw)
  To: shawn.lu; +Cc: netdev, xiaoclu

From: Shawn Lu <shawn.lu@ericsson.com>
Date: Fri, 20 Jan 2012 14:22:04 -0800

> From: shawnlu <shawn.lu@ericsson.com>
> 
> md5 key is added in socket through remote address.
> remote address should be used in finding md5 key when
> sending out reset packet.
> 
> Signed-off-by: shawnlu <shawn.lu@ericsson.com>

Applied.

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

* [PATCH] tcp: md5: using remote adress for md5 lookup in rst packet
@ 2012-01-20 22:20 Shawn Lu
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Lu @ 2012-01-20 22:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, xiaoclu

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]


md5 key is added in socket through remote address.
remote address should be used in finding md5 key when
sending out reset packet.

Signed-off-by: shawnlu <shawn.lu@ericsson.com>
---
 net/ipv4/tcp_ipv4.c |    2 +-
 net/ipv6/tcp_ipv6.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-tcp-md5-using-remote-adress-for-md5-lookup-in-rst-pa.patch --]
[-- Type: text/x-patch; name="0001-tcp-md5-using-remote-adress-for-md5-lookup-in-rst-pa.patch", Size: 916 bytes --]

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 1eb4ad5..337ba4c 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -631,7 +631,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
 	arg.iov[0].iov_len  = sizeof(rep.th);
 
 #ifdef CONFIG_TCP_MD5SIG
-	key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->daddr) : NULL;
+	key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->saddr) : NULL;
 	if (key) {
 		rep.opt[0] = htonl((TCPOPT_NOP << 24) |
 				   (TCPOPT_NOP << 16) |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 906c7ca..3edd05a 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1083,7 +1083,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
 
 #ifdef CONFIG_TCP_MD5SIG
 	if (sk)
-		key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr);
+		key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->saddr);
 #endif
 
 	if (th->ack)

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

end of thread, other threads:[~2012-01-22 19:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-20 22:22 [PATCH] tcp: md5: using remote adress for md5 lookup in rst packet Shawn Lu
2012-01-22 19:25 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2012-01-20 22:20 Shawn Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.