mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
openvswitch: add ipv6 'set' action
This patch adds ipv6 set action functionality. It allows to change traffic class, flow label, hop-limit, ipv6 source and destination address fields. Signed-off-by: Ansis Atteka <aatteka@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
parent
9195bb8e38
commit
3fdbd1ce11
2 changed files with 113 additions and 0 deletions
|
@ -479,6 +479,7 @@ static int validate_set(const struct nlattr *a,
|
|||
|
||||
switch (key_type) {
|
||||
const struct ovs_key_ipv4 *ipv4_key;
|
||||
const struct ovs_key_ipv6 *ipv6_key;
|
||||
|
||||
case OVS_KEY_ATTR_PRIORITY:
|
||||
case OVS_KEY_ATTR_ETHERNET:
|
||||
|
@ -500,6 +501,25 @@ static int validate_set(const struct nlattr *a,
|
|||
|
||||
break;
|
||||
|
||||
case OVS_KEY_ATTR_IPV6:
|
||||
if (flow_key->eth.type != htons(ETH_P_IPV6))
|
||||
return -EINVAL;
|
||||
|
||||
if (!flow_key->ip.proto)
|
||||
return -EINVAL;
|
||||
|
||||
ipv6_key = nla_data(ovs_key);
|
||||
if (ipv6_key->ipv6_proto != flow_key->ip.proto)
|
||||
return -EINVAL;
|
||||
|
||||
if (ipv6_key->ipv6_frag != flow_key->ip.frag)
|
||||
return -EINVAL;
|
||||
|
||||
if (ntohl(ipv6_key->ipv6_label) & 0xFFF00000)
|
||||
return -EINVAL;
|
||||
|
||||
break;
|
||||
|
||||
case OVS_KEY_ATTR_TCP:
|
||||
if (flow_key->ip.proto != IPPROTO_TCP)
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue