mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
udp: In udp_flow_src_port use random hash value if skb_get_hash fails
In the unlikely event that skb_get_hash is unable to deduce a hash in udp_flow_src_port we use a consistent random value instead. This is specified in GRE/UDP draft section 3.2.1: https://tools.ietf.org/html/draft-ietf-tsvwg-gre-in-udp-encap-04 Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
fed0a159c8
commit
723b8e460d
2 changed files with 25 additions and 6 deletions
|
|
@ -2525,6 +2525,16 @@ void __init udp_table_init(struct udp_table *table, const char *name)
|
|||
}
|
||||
}
|
||||
|
||||
u32 udp_flow_hashrnd(void)
|
||||
{
|
||||
static u32 hashrnd __read_mostly;
|
||||
|
||||
net_get_random_once(&hashrnd, sizeof(hashrnd));
|
||||
|
||||
return hashrnd;
|
||||
}
|
||||
EXPORT_SYMBOL(udp_flow_hashrnd);
|
||||
|
||||
void __init udp_init(void)
|
||||
{
|
||||
unsigned long limit;
|
||||
|
|
|
|||
Loading…
Reference in a new issue