[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4711aeb8-5da5-4a2b-7304-6b9696e8c1cb@cumulusnetworks.com>
Date: Thu, 9 Mar 2017 19:00:41 -0700
From: David Ahern <dsa@...ulusnetworks.com>
To: Robert Shearman <rshearma@...cade.com>, davem@...emloft.net
Cc: netdev@...r.kernel.org,
"Eric W. Biederman" <ebiederm@...ssion.com>,
roopa <roopa@...ulusnetworks.com>
Subject: Re: [PATCH net-next v2 1/2] mpls: allow TTL propagation to IP packets
to be configured
On 3/7/17 5:46 PM, Robert Shearman wrote:
> @@ -244,24 +245,33 @@ static bool mpls_egress(struct mpls_route *rt, struct sk_buff *skb,
> payload_type = ip_hdr(skb)->version;
>
> switch (payload_type) {
> - case MPT_IPV4: {
> - struct iphdr *hdr4 = ip_hdr(skb);
> + case MPT_IPV4:
> + if (rt->rt_ttl_propagate == MPLS_TTL_PROP_ENABLED ||
> + (rt->rt_ttl_propagate == MPLS_TTL_PROP_DEFAULT &&
> + net->mpls.ip_ttl_propagate)) {
> + struct iphdr *hdr4 = ip_hdr(skb);
> +
> + csum_replace2(&hdr4->check,
> + htons(hdr4->ttl << 8),
> + htons(dec.ttl << 8));
> + hdr4->ttl = dec.ttl;
> + }
> skb->protocol = htons(ETH_P_IP);
> - csum_replace2(&hdr4->check,
> - htons(hdr4->ttl << 8),
> - htons(dec.ttl << 8));
> - hdr4->ttl = dec.ttl;
> success = true;
> break;
> - }
> - case MPT_IPV6: {
> - struct ipv6hdr *hdr6 = ipv6_hdr(skb);
> + case MPT_IPV6:
> + if (rt->rt_ttl_propagate == MPLS_TTL_PROP_ENABLED ||
> + (rt->rt_ttl_propagate == MPLS_TTL_PROP_DEFAULT &&
> + net->mpls.ip_ttl_propagate)) {
> + struct ipv6hdr *hdr6 = ipv6_hdr(skb);
> +
> + hdr6->hop_limit = dec.ttl;
> + }
> skb->protocol = htons(ETH_P_IPV6);
> - hdr6->hop_limit = dec.ttl;
> success = true;
> break;
> - }
What decrements the TTL if it is not propagated from MPLS to IP?
Powered by blists - more mailing lists