aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 737b755342b..4b903288095 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -59,6 +59,7 @@
59#include <net/snmp.h> 59#include <net/snmp.h>
60#include <net/dsfield.h> 60#include <net/dsfield.h>
61#include <net/timewait_sock.h> 61#include <net/timewait_sock.h>
62#include <net/netdma.h>
62 63
63#include <asm/uaccess.h> 64#include <asm/uaccess.h>
64 65
@@ -560,16 +561,16 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
560 char *newkey, u8 newkeylen) 561 char *newkey, u8 newkeylen)
561{ 562{
562 /* Add key to the list */ 563 /* Add key to the list */
563 struct tcp6_md5sig_key *key; 564 struct tcp_md5sig_key *key;
564 struct tcp_sock *tp = tcp_sk(sk); 565 struct tcp_sock *tp = tcp_sk(sk);
565 struct tcp6_md5sig_key *keys; 566 struct tcp6_md5sig_key *keys;
566 567
567 key = (struct tcp6_md5sig_key*) tcp_v6_md5_do_lookup(sk, peer); 568 key = tcp_v6_md5_do_lookup(sk, peer);
568 if (key) { 569 if (key) {
569 /* modify existing entry - just update that one */ 570 /* modify existing entry - just update that one */
570 kfree(key->base.key); 571 kfree(key->key);
571 key->base.key = newkey; 572 key->key = newkey;
572 key->base.keylen = newkeylen; 573 key->keylen = newkeylen;
573 } else { 574 } else {
574 /* reallocate new list if current one is full. */ 575 /* reallocate new list if current one is full. */
575 if (!tp->md5sig_info) { 576 if (!tp->md5sig_info) {
@@ -757,6 +758,8 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
757 bp->len = htonl(tcplen); 758 bp->len = htonl(tcplen);
758 bp->protocol = htonl(protocol); 759 bp->protocol = htonl(protocol);
759 760
761 sg_init_table(sg, 4);
762
760 sg_set_buf(&sg[block++], bp, sizeof(*bp)); 763 sg_set_buf(&sg[block++], bp, sizeof(*bp));
761 nbytes += sizeof(*bp); 764 nbytes += sizeof(*bp);
762 765
@@ -778,6 +781,8 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
778 sg_set_buf(&sg[block++], key->key, key->keylen); 781 sg_set_buf(&sg[block++], key->key, key->keylen);
779 nbytes += key->keylen; 782 nbytes += key->keylen;
780 783
784 __sg_mark_end(&sg[block - 1]);
785
781 /* Now store the hash into the packet */ 786 /* Now store the hash into the packet */
782 err = crypto_hash_init(desc); 787 err = crypto_hash_init(desc);
783 if (err) { 788 if (err) {
@@ -1728,6 +1733,8 @@ process:
1728 if (!sock_owned_by_user(sk)) { 1733 if (!sock_owned_by_user(sk)) {
1729#ifdef CONFIG_NET_DMA 1734#ifdef CONFIG_NET_DMA
1730 struct tcp_sock *tp = tcp_sk(sk); 1735 struct tcp_sock *tp = tcp_sk(sk);
1736 if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list)
1737 tp->ucopy.dma_chan = get_softnet_dma();
1731 if (tp->ucopy.dma_chan) 1738 if (tp->ucopy.dma_chan)
1732 ret = tcp_v6_do_rcv(sk, skb); 1739 ret = tcp_v6_do_rcv(sk, skb);
1733 else 1740 else