|
@@ -2994,17 +2994,19 @@ void tcp_put_md5sig_pool(void)
|
|
EXPORT_SYMBOL(tcp_put_md5sig_pool);
|
|
EXPORT_SYMBOL(tcp_put_md5sig_pool);
|
|
|
|
|
|
int tcp_md5_hash_header(struct tcp_md5sig_pool *hp,
|
|
int tcp_md5_hash_header(struct tcp_md5sig_pool *hp,
|
|
- struct tcphdr *th)
|
|
|
|
|
|
+ const struct tcphdr *th)
|
|
{
|
|
{
|
|
struct scatterlist sg;
|
|
struct scatterlist sg;
|
|
|
|
+ struct tcphdr hdr;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
- __sum16 old_checksum = th->check;
|
|
|
|
- th->check = 0;
|
|
|
|
|
|
+ /* We are not allowed to change tcphdr, make a local copy */
|
|
|
|
+ memcpy(&hdr, th, sizeof(hdr));
|
|
|
|
+ hdr.check = 0;
|
|
|
|
+
|
|
/* options aren't included in the hash */
|
|
/* options aren't included in the hash */
|
|
- sg_init_one(&sg, th, sizeof(struct tcphdr));
|
|
|
|
- err = crypto_hash_update(&hp->md5_desc, &sg, sizeof(struct tcphdr));
|
|
|
|
- th->check = old_checksum;
|
|
|
|
|
|
+ sg_init_one(&sg, &hdr, sizeof(hdr));
|
|
|
|
+ err = crypto_hash_update(&hp->md5_desc, &sg, sizeof(hdr));
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(tcp_md5_hash_header);
|
|
EXPORT_SYMBOL(tcp_md5_hash_header);
|