diff options
author | Ansis Atteka <aatteka@nicira.com> | 2012-11-13 18:44:14 -0500 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2012-11-13 18:57:33 -0500 |
commit | 3fdbd1ce11e5c0d7cafbe44c942c5cad61113d7b (patch) | |
tree | fb3c6207ea4a38c35ecc1017dce97254b36da5f5 /net/openvswitch/datapath.c | |
parent | 9195bb8e381d81d5a315f911904cdf0cfcc919b8 (diff) |
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>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 4c4b62ccc7d7..fd4a6a4ce3cd 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -479,6 +479,7 @@ static int validate_set(const struct nlattr *a, | |||
479 | 479 | ||
480 | switch (key_type) { | 480 | switch (key_type) { |
481 | const struct ovs_key_ipv4 *ipv4_key; | 481 | const struct ovs_key_ipv4 *ipv4_key; |
482 | const struct ovs_key_ipv6 *ipv6_key; | ||
482 | 483 | ||
483 | case OVS_KEY_ATTR_PRIORITY: | 484 | case OVS_KEY_ATTR_PRIORITY: |
484 | case OVS_KEY_ATTR_ETHERNET: | 485 | case OVS_KEY_ATTR_ETHERNET: |
@@ -500,6 +501,25 @@ static int validate_set(const struct nlattr *a, | |||
500 | 501 | ||
501 | break; | 502 | break; |
502 | 503 | ||
504 | case OVS_KEY_ATTR_IPV6: | ||
505 | if (flow_key->eth.type != htons(ETH_P_IPV6)) | ||
506 | return -EINVAL; | ||
507 | |||
508 | if (!flow_key->ip.proto) | ||
509 | return -EINVAL; | ||
510 | |||
511 | ipv6_key = nla_data(ovs_key); | ||
512 | if (ipv6_key->ipv6_proto != flow_key->ip.proto) | ||
513 | return -EINVAL; | ||
514 | |||
515 | if (ipv6_key->ipv6_frag != flow_key->ip.frag) | ||
516 | return -EINVAL; | ||
517 | |||
518 | if (ntohl(ipv6_key->ipv6_label) & 0xFFF00000) | ||
519 | return -EINVAL; | ||
520 | |||
521 | break; | ||
522 | |||
503 | case OVS_KEY_ATTR_TCP: | 523 | case OVS_KEY_ATTR_TCP: |
504 | if (flow_key->ip.proto != IPPROTO_TCP) | 524 | if (flow_key->ip.proto != IPPROTO_TCP) |
505 | return -EINVAL; | 525 | return -EINVAL; |