Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tcp: md5: using remote adress for md5 lookup in rst packet

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

shawnlu and committed by
David S. Miller
8a622e71 df505eb8

+2 -2
+1 -1
net/ipv4/tcp_ipv4.c
··· 631 631 arg.iov[0].iov_len = sizeof(rep.th); 632 632 633 633 #ifdef CONFIG_TCP_MD5SIG 634 - key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->daddr) : NULL; 634 + key = sk ? tcp_v4_md5_do_lookup(sk, ip_hdr(skb)->saddr) : NULL; 635 635 if (key) { 636 636 rep.opt[0] = htonl((TCPOPT_NOP << 24) | 637 637 (TCPOPT_NOP << 16) |
+1 -1
net/ipv6/tcp_ipv6.c
··· 1083 1083 1084 1084 #ifdef CONFIG_TCP_MD5SIG 1085 1085 if (sk) 1086 - key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr); 1086 + key = tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->saddr); 1087 1087 #endif 1088 1088 1089 1089 if (th->ack)