[ovs-dev] [PATCH 16/16] datapath: Allow IP actions for MPLS
Simon Horman
horms at verge.net.au
Tue Jan 8 05:46:17 UTC 2013
Allow copy_ttl_in to function in the case where:
a) The outer header is MPLS;
b) The next-outer header is IP and;
c) The resulting nw ttl will be different from its existing value
In this circumstance a set ipv4 action will be used to adjust the TTL
but the dl_type of the match will be ETH_P_MPLS_UC or ETH_P_MPLS_MC.
Signed-off-by: Simon Horman <horms at verge.net.au>
---
v2.14
* No change
v2.13
* No change
v2.12
* Use eth_p_mpls helper
v2.11
* First post
---
datapath/datapath.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/datapath/datapath.c b/datapath/datapath.c
index a0accb7..d66c439 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -566,6 +566,10 @@ static int validate_set(const struct nlattr *a,
break;
case OVS_KEY_ATTR_IPV4:
+ /* Gratuitous exception for MPLS to allow copy_ttl_in */
+ if (eth_p_mpls(flow_key->eth.type))
+ break;
+
if (flow_key->eth.type != htons(ETH_P_IP))
return -EINVAL;
@@ -582,6 +586,10 @@ static int validate_set(const struct nlattr *a,
break;
case OVS_KEY_ATTR_IPV6:
+ /* Gratuitous exception for MPLS to allow copy_ttl_in */
+ if (eth_p_mpls(flow_key->eth.type))
+ break;
+
if (flow_key->eth.type != htons(ETH_P_IPV6))
return -EINVAL;
--
1.7.10.4
More information about the dev
mailing list