diff options
author | Ansis Atteka <aatteka@nicira.com> | 2012-11-05 15:53:32 +0200 |
---|---|---|
committer | Ansis Atteka <aatteka@nicira.com> | 2012-11-13 13:51:59 +0200 |
commit | bc7a5acdff087b7e7a162da42ae608a83f3cf902 (patch) | |
tree | 11ec19960540c9f3034f707def8ad5c647069226 /lib/dpif-netdev.c | |
parent | 3d974905842e211a62d198b0b8ae752f173d0efc (diff) |
datapath: 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.
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Diffstat (limited to 'lib/dpif-netdev.c')
-rw-r--r-- | lib/dpif-netdev.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index a80b1b06..4ce4147c 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1181,13 +1181,13 @@ execute_set_action(struct ofpbuf *packet, const struct nlattr *a) { enum ovs_key_attr type = nl_attr_type(a); const struct ovs_key_ipv4 *ipv4_key; + const struct ovs_key_ipv6 *ipv6_key; const struct ovs_key_tcp *tcp_key; const struct ovs_key_udp *udp_key; switch (type) { case OVS_KEY_ATTR_TUN_ID: case OVS_KEY_ATTR_PRIORITY: - case OVS_KEY_ATTR_IPV6: case OVS_KEY_ATTR_IPV4_TUNNEL: /* not implemented */ break; @@ -1203,6 +1203,13 @@ execute_set_action(struct ofpbuf *packet, const struct nlattr *a) ipv4_key->ipv4_tos, ipv4_key->ipv4_ttl); break; + case OVS_KEY_ATTR_IPV6: + ipv6_key = nl_attr_get_unspec(a, sizeof(struct ovs_key_ipv6)); + packet_set_ipv6(packet, ipv6_key->ipv6_proto, ipv6_key->ipv6_src, + ipv6_key->ipv6_dst, ipv6_key->ipv6_tclass, + ipv6_key->ipv6_label, ipv6_key->ipv6_hlimit); + break; + case OVS_KEY_ATTR_TCP: tcp_key = nl_attr_get_unspec(a, sizeof(struct ovs_key_tcp)); packet_set_tcp_port(packet, tcp_key->tcp_src, tcp_key->tcp_dst); |