On 10/03/17 02:54, David Ahern wrote:
On 3/7/17 5:46 PM, Robert Shearman wrote:
@@ -78,6 +70,29 @@ static int mpls_xmit(struct sk_buff *skb)

        tun_encap_info = mpls_lwtunnel_encap(dst->lwtstate);

+       /* Obtain the ttl */
+       if (dst->ops->family == AF_INET) {
+               if (tun_encap_info->ttl_propagate == MPLS_TTL_PROP_DISABLED)
+                       ttl = tun_encap_info->default_ttl;
+               else if (tun_encap_info->ttl_propagate == MPLS_TTL_PROP_DEFAULT 
&&
+                        !net->mpls.ip_ttl_propagate)
+                       ttl = net->mpls.default_ttl;
+               else
+                       ttl = ip_hdr(skb)->ttl;

After staring at that for a while, an explanation above this if {} else
{} section on the ttl selection will be very helpful.


Ok, would a comment like the following improve things sufficiently?

        /* Obtain the ttl using the following set of rules.
         *
         * LWT ttl propagation setting:
         *  - disabled => use default TTL value from LWT
         *  - enabled  => use TTL value from IPv4/IPv6 header
         *  - default  =>
         *   Global ttl propagation setting:
         *    - disabled => use default TTL value from global setting
         *    - enabled => use TTL value from IPv4/IPv6 header
         */

Thanks,
Rob

Reply via email to