diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/esp4.c | 12 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index cad4278025ad..c31bccb9b526 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -111,9 +111,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) | |||
111 | goto unlock; | 111 | goto unlock; |
112 | } | 112 | } |
113 | sg_init_table(sg, nfrags); | 113 | sg_init_table(sg, nfrags); |
114 | sg_mark_end(sg, skb_to_sgvec(skb, sg, esph->enc_data + | 114 | skb_to_sgvec(skb, sg, |
115 | esp->conf.ivlen - | 115 | esph->enc_data + |
116 | skb->data, clen)); | 116 | esp->conf.ivlen - |
117 | skb->data, clen); | ||
117 | err = crypto_blkcipher_encrypt(&desc, sg, sg, clen); | 118 | err = crypto_blkcipher_encrypt(&desc, sg, sg, clen); |
118 | if (unlikely(sg != &esp->sgbuf[0])) | 119 | if (unlikely(sg != &esp->sgbuf[0])) |
119 | kfree(sg); | 120 | kfree(sg); |
@@ -205,8 +206,9 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb) | |||
205 | goto out; | 206 | goto out; |
206 | } | 207 | } |
207 | sg_init_table(sg, nfrags); | 208 | sg_init_table(sg, nfrags); |
208 | sg_mark_end(sg, skb_to_sgvec(skb, sg, sizeof(*esph) + esp->conf.ivlen, | 209 | skb_to_sgvec(skb, sg, |
209 | elen)); | 210 | sizeof(*esph) + esp->conf.ivlen, |
211 | elen); | ||
210 | err = crypto_blkcipher_decrypt(&desc, sg, sg, elen); | 212 | err = crypto_blkcipher_decrypt(&desc, sg, sg, elen); |
211 | if (unlikely(sg != &esp->sgbuf[0])) | 213 | if (unlikely(sg != &esp->sgbuf[0])) |
212 | kfree(sg); | 214 | kfree(sg); |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index d3d8d5dfcee3..eec02b29ffcf 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1083,7 +1083,7 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
1083 | sg_set_buf(&sg[block++], key->key, key->keylen); | 1083 | sg_set_buf(&sg[block++], key->key, key->keylen); |
1084 | nbytes += key->keylen; | 1084 | nbytes += key->keylen; |
1085 | 1085 | ||
1086 | sg_mark_end(sg, block); | 1086 | __sg_mark_end(&sg[block - 1]); |
1087 | 1087 | ||
1088 | /* Now store the Hash into the packet */ | 1088 | /* Now store the Hash into the packet */ |
1089 | err = crypto_hash_init(desc); | 1089 | err = crypto_hash_init(desc); |