Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c7da57a183a255f53caa73b1f688a01b097fa5bc
Commit:     c7da57a183a255f53caa73b1f688a01b097fa5bc
Parent:     0e0940d4bb9b19c0a45c844a83e1d25686aaf433
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 26 00:41:21 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Fri Oct 26 00:41:21 2007 -0700

    [TCP]: Fix scatterlist handling in MD5 signature support.
    
    Use sg_init_table() and sg_mark_end() as needed.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_ipv4.c |    5 +++++
 net/ipv6/tcp_ipv6.c |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 38cf73a..ad759f1 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)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 737b755..32dc329 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -757,6 +757,8 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct 
tcp_md5sig_key *key,
        bp->len = htonl(tcplen);
        bp->protocol = htonl(protocol);
 
+       sg_init_table(sg, 4);
+
        sg_set_buf(&sg[block++], bp, sizeof(*bp));
        nbytes += sizeof(*bp);
 
@@ -778,6 +780,8 @@ static int tcp_v6_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) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to