aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-26 23:09:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-26 23:09:07 -0500
commit8c27eba54970c6ebbb408186e5baa2274435e869 (patch)
tree47348cfc4c008692eee4a9174fcc6d8b20f5e647 /net/ipv4/tcp_ipv4.c
parent8912858bcb9e314549a4abc15db6b5841a96fa2c (diff)
parent5dba4797115c8fa05c1a4d12927a6ae0b33ffc41 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6: (41 commits) [XFRM]: Fix leak of expired xfrm_states [ATM]: [he] initialize lock and tasklet earlier [IPV4]: Remove bogus ifdef mess in arp_process [SKBUFF]: Free old skb properly in skb_morph [IPV4]: Fix memory leak in inet_hashtables.h when NUMA is on [IPSEC]: Temporarily remove locks around copying of non-atomic fields [TCP] MTUprobe: Cleanup send queue check (no need to loop) [TCP]: MTUprobe: receiver window & data available checks fixed [MAINTAINERS]: tlan list is subscribers-only [SUNRPC]: Remove SPIN_LOCK_UNLOCKED [SUNRPC]: Make xprtsock.c:xs_setup_{udp,tcp}() static [PFKEY]: Sending an SADB_GET responds with an SADB_GET [IRDA]: Compilation for CONFIG_INET=n case [IPVS]: Fix compiler warning about unused register_ip_vs_protocol [ARP]: Fix arp reply when sender ip 0 [IPV6] TCPMD5: Fix deleting key operation. [IPV6] TCPMD5: Check return value of tcp_alloc_md5sig_pool(). [IPV4] TCPMD5: Use memmove() instead of memcpy() because we have overlaps. [IPV4] TCPMD5: Omit redundant NULL check for kfree() argument. ieee80211: Stop net_ratelimit/IEEE80211_DEBUG_DROP log pollution ...
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index e566f3c67677..652c32368ccc 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -900,8 +900,7 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
900 sizeof(*keys) * md5sig->entries4); 900 sizeof(*keys) * md5sig->entries4);
901 901
902 /* Free old key list, and reference new one */ 902 /* Free old key list, and reference new one */
903 if (md5sig->keys4) 903 kfree(md5sig->keys4);
904 kfree(md5sig->keys4);
905 md5sig->keys4 = keys; 904 md5sig->keys4 = keys;
906 md5sig->alloced4++; 905 md5sig->alloced4++;
907 } 906 }
@@ -939,10 +938,10 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr)
939 tp->md5sig_info->alloced4 = 0; 938 tp->md5sig_info->alloced4 = 0;
940 } else if (tp->md5sig_info->entries4 != i) { 939 } else if (tp->md5sig_info->entries4 != i) {
941 /* Need to do some manipulation */ 940 /* Need to do some manipulation */
942 memcpy(&tp->md5sig_info->keys4[i], 941 memmove(&tp->md5sig_info->keys4[i],
943 &tp->md5sig_info->keys4[i+1], 942 &tp->md5sig_info->keys4[i+1],
944 (tp->md5sig_info->entries4 - i) * 943 (tp->md5sig_info->entries4 - i) *
945 sizeof(struct tcp4_md5sig_key)); 944 sizeof(struct tcp4_md5sig_key));
946 } 945 }
947 tcp_free_md5sig_pool(); 946 tcp_free_md5sig_pool();
948 return 0; 947 return 0;