Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369826
b: refs/heads/master
c: aebda15
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 29, 2013
1 parent c8d71df commit 594999e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2d177be8e4a1f6ea7e3280b3a578a6b86472a39d
refs/heads/master: aebda156a570782a86fc4426842152237a19427d
1 change: 1 addition & 0 deletions trunk/include/net/secure_seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <linux/types.h>

extern void net_secret_init(void);
extern __u32 secure_ip_id(__be32 daddr);
extern __u32 secure_ipv6_id(const __be32 daddr[4]);
extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
Expand Down
4 changes: 1 addition & 3 deletions trunk/net/core/secure_seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@

static u32 net_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned;

static int __init net_secret_init(void)
void net_secret_init(void)
{
get_random_bytes(net_secret, sizeof(net_secret));
return 0;
}
late_initcall(net_secret_init);

#ifdef CONFIG_INET
static u32 seq_scale(u32 seq)
Expand Down
5 changes: 4 additions & 1 deletion trunk/net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
#include <net/inet_common.h>
#include <net/xfrm.h>
#include <net/net_namespace.h>
#include <net/secure_seq.h>
#ifdef CONFIG_IP_MROUTE
#include <linux/mroute.h>
#endif
Expand Down Expand Up @@ -262,8 +263,10 @@ void build_ehash_secret(void)
get_random_bytes(&rnd, sizeof(rnd));
} while (rnd == 0);

if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0)
if (cmpxchg(&inet_ehash_secret, 0, rnd) == 0) {
get_random_bytes(&ipv6_hash_secret, sizeof(ipv6_hash_secret));
net_secret_init();
}
}
EXPORT_SYMBOL(build_ehash_secret);

Expand Down

0 comments on commit 594999e

Please sign in to comment.