[ovs-dev] [PATCH 16/16] datapath: Allow IP actions for MPLS

Simon Horman horms at verge.net.au
Wed Feb 6 09:04:43 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.13 - v2.17
* 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 c0c6d03..c2629d4 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -682,6 +682,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;
 
@@ -698,6 +702,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