summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-10-26 09:41:21 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-26 09:41:21 +0200
commitc7da57a183a255f53caa73b1f688a01b097fa5bc (patch)
treec043065fbe1229cdc348278df79b532fa1748820 /net/ipv4/tcp_ipv4.c
parent[IPSEC]: Fix scatterlist handling in skb_icv_walk(). (diff)
downloadlinux-c7da57a183a255f53caa73b1f688a01b097fa5bc.tar.xz
linux-c7da57a183a255f53caa73b1f688a01b097fa5bc.zip
[TCP]: Fix scatterlist handling in MD5 signature support.
Use sg_init_table() and sg_mark_end() as needed. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 38cf73a56731..ad759f1c3777 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1055,6 +1055,9 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
bp->pad = 0;
bp->protocol = protocol;
bp->len = htons(tcplen);
+
+ sg_init_table(sg, 4);
+
sg_set_buf(&sg[block++], bp, sizeof(*bp));
nbytes += sizeof(*bp);
@@ -1080,6 +1083,8 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
sg_set_buf(&sg[block++], key->key, key->keylen);
nbytes += key->keylen;
+ sg_mark_end(sg, block);
+
/* Now store the Hash into the packet */
err = crypto_hash_init(desc);
if (err)