xfrm: Mark flowi arg to ->fill_dst() const.
[pandora-kernel.git] / net / ipv4 / xfrm4_policy.c
index b057d40..1e9844d 100644 (file)
@@ -56,7 +56,7 @@ static int xfrm4_get_saddr(struct net *net,
        return 0;
 }
 
-static int xfrm4_get_tos(struct flowi *fl)
+static int xfrm4_get_tos(const struct flowi *fl)
 {
        return IPTOS_RT_MASK & fl->fl4_tos; /* Strip ECN bits */
 }
@@ -68,7 +68,7 @@ static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst,
 }
 
 static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
-                         struct flowi *fl)
+                         const struct flowi *fl)
 {
        struct rtable *rt = (struct rtable *)xdst->route;
 
@@ -196,8 +196,11 @@ static void xfrm4_dst_destroy(struct dst_entry *dst)
 {
        struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
 
+       dst_destroy_metrics_generic(dst);
+
        if (likely(xdst->u.rt.peer))
                inet_putpeer(xdst->u.rt.peer);
+
        xfrm_dst_destroy(xdst);
 }
 
@@ -215,6 +218,7 @@ static struct dst_ops xfrm4_dst_ops = {
        .protocol =             cpu_to_be16(ETH_P_IP),
        .gc =                   xfrm4_garbage_collect,
        .update_pmtu =          xfrm4_update_pmtu,
+       .cow_metrics =          dst_cow_metrics_generic,
        .destroy =              xfrm4_dst_destroy,
        .ifdown =               xfrm4_dst_ifdown,
        .local_out =            __ip_local_out,