forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
datapath: Provide compatibility for kernels up to 3.17
Port datapath to work with kernrels up to 3.17 and use 3.16.2 as the new kernel for CI testing. Tested with 3.14, 3.16.2, and net-next (3.17). Signed-off-by: Thomas Graf <[email protected]> Co-authored-by: Madhu Challa <[email protected]> Acked-by: Pravin B Shelar <[email protected]>
- Loading branch information
1 parent
3b2bbce
commit f6a0c89
Showing
18 changed files
with
114 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#ifndef __NET_UDP_WRAPPER_H | ||
#define __NET_UDP_WRAPPER_H 1 | ||
|
||
#include_next <net/udp.h> | ||
|
||
#ifndef HAVE_UDP_FLOW_SRC_PORT | ||
static inline __be16 udp_flow_src_port(struct net *net, struct sk_buff *skb, | ||
int min, int max, bool use_eth) | ||
{ | ||
u32 hash; | ||
|
||
if (min >= max) { | ||
/* Use default range */ | ||
inet_get_local_port_range(net, &min, &max); | ||
} | ||
|
||
hash = skb_get_hash(skb); | ||
if (unlikely(!hash) && use_eth) { | ||
/* Can't find a normal hash, caller has indicated an Ethernet | ||
* packet so use that to compute a hash. | ||
*/ | ||
hash = jhash(skb->data, 2 * ETH_ALEN, | ||
(__force u32) skb->protocol); | ||
} | ||
|
||
/* Since this is being sent on the wire obfuscate hash a bit | ||
* to minimize possbility that any useful information to an | ||
* attacker is leaked. Only upper 16 bits are relevant in the | ||
* computation for 16 bit port value. | ||
*/ | ||
hash ^= hash << 16; | ||
|
||
return htons((((u64) hash * (max - min)) >> 32) + min); | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters