Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134631
b: refs/heads/master
c: e88721f
h: refs/heads/master
i:
  134629: e9c8151
  134627: 83fb2e4
  134623: 9616619
v: v3
  • Loading branch information
Krishna Kumar authored and David S. Miller committed Feb 19, 2009
1 parent df65d75 commit 37c103a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: 38bb045d493cc166920834087acd934dedc1b5d5
refs/heads/master: e88721f87d8caa679e62d6004a9a5661f1ac7b0e
14 changes: 8 additions & 6 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,17 +1745,11 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
}

static u32 skb_tx_hashrnd;
static int skb_tx_hashrnd_initialized = 0;

static u16 skb_tx_hash(struct net_device *dev, struct sk_buff *skb)
{
u32 hash;

if (unlikely(!skb_tx_hashrnd_initialized)) {
get_random_bytes(&skb_tx_hashrnd, 4);
skb_tx_hashrnd_initialized = 1;
}

if (skb_rx_queue_recorded(skb)) {
hash = skb_get_rx_queue(skb);
} else if (skb->sk && skb->sk->sk_hash) {
Expand Down Expand Up @@ -5291,6 +5285,14 @@ static int __init net_dev_init(void)

subsys_initcall(net_dev_init);

static int __init initialize_hashrnd(void)
{
get_random_bytes(&skb_tx_hashrnd, sizeof(skb_tx_hashrnd));
return 0;
}

late_initcall_sync(initialize_hashrnd);

EXPORT_SYMBOL(__dev_get_by_index);
EXPORT_SYMBOL(__dev_get_by_name);
EXPORT_SYMBOL(__dev_remove_pack);
Expand Down

0 comments on commit 37c103a

Please sign in to comment.