datapath: Use ipv4_dst_hoplimit() instead of direct access.
authorJesse Gross <jesse@nicira.com>
Fri, 18 Mar 2011 21:37:33 +0000 (14:37 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 18 Mar 2011 22:10:04 +0000 (15:10 -0700)
In 2.6.38 dst metrics became shared and use copy-on-write instead
of using private versions.  This means that it is no longer permissible
to directly access the metric and we need to use the helper function
instead.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/tunnel.c

index a7d4943..7863b7a 100644 (file)
@@ -804,7 +804,7 @@ static void create_tunnel_header(const struct vport *vport,
        iph->saddr      = rt->rt_src;
        iph->ttl        = mutable->ttl;
        if (!iph->ttl)
-               iph->ttl = dst_metric(&rt_dst(rt), RTAX_HOPLIMIT);
+               iph->ttl = ip4_dst_hoplimit(&rt_dst(rt));
 
        tnl_vport->tnl_ops->build_header(vport, mutable, iph + 1);
 }
@@ -1233,7 +1233,7 @@ int tnl_send(struct vport *vport, struct sk_buff *skb)
        /* TTL */
        ttl = mutable->ttl;
        if (!ttl)
-               ttl = dst_metric(&rt_dst(rt), RTAX_HOPLIMIT);
+               ttl = ip4_dst_hoplimit(&rt_dst(rt));
 
        if (mutable->flags & TNL_F_TTL_INHERIT) {
                if (skb->protocol == htons(ETH_P_IP))