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

Simon Horman horms at verge.net.au
Thu Dec 27 05:23:08 UTC 2012


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.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 6dd92e4..d902c16 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -668,6 +668,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;
 
@@ -684,6 +688,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