]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/ipv4/xfrm4_policy.c
net: xfrm: support setting an output mark.
[mirror_ubuntu-bionic-kernel.git] / net / ipv4 / xfrm4_policy.c
index 4aefb149fe0aa3931f8c00ad200af1ae5d6eeb56..d7bf0b0418858cac8c2689fea8bfe3e83a160a15 100644 (file)
@@ -20,7 +20,8 @@
 static struct dst_entry *__xfrm4_dst_lookup(struct net *net, struct flowi4 *fl4,
                                            int tos, int oif,
                                            const xfrm_address_t *saddr,
-                                           const xfrm_address_t *daddr)
+                                           const xfrm_address_t *daddr,
+                                           u32 mark)
 {
        struct rtable *rt;
 
@@ -28,6 +29,7 @@ static struct dst_entry *__xfrm4_dst_lookup(struct net *net, struct flowi4 *fl4,
        fl4->daddr = daddr->a4;
        fl4->flowi4_tos = tos;
        fl4->flowi4_oif = l3mdev_master_ifindex_by_index(net, oif);
+       fl4->flowi4_mark = mark;
        if (saddr)
                fl4->saddr = saddr->a4;
 
@@ -42,20 +44,22 @@ static struct dst_entry *__xfrm4_dst_lookup(struct net *net, struct flowi4 *fl4,
 
 static struct dst_entry *xfrm4_dst_lookup(struct net *net, int tos, int oif,
                                          const xfrm_address_t *saddr,
-                                         const xfrm_address_t *daddr)
+                                         const xfrm_address_t *daddr,
+                                         u32 mark)
 {
        struct flowi4 fl4;
 
-       return __xfrm4_dst_lookup(net, &fl4, tos, oif, saddr, daddr);
+       return __xfrm4_dst_lookup(net, &fl4, tos, oif, saddr, daddr, mark);
 }
 
 static int xfrm4_get_saddr(struct net *net, int oif,
-                          xfrm_address_t *saddr, xfrm_address_t *daddr)
+                          xfrm_address_t *saddr, xfrm_address_t *daddr,
+                          u32 mark)
 {
        struct dst_entry *dst;
        struct flowi4 fl4;
 
-       dst = __xfrm4_dst_lookup(net, &fl4, 0, oif, NULL, daddr);
+       dst = __xfrm4_dst_lookup(net, &fl4, 0, oif, NULL, daddr, mark);
        if (IS_ERR(dst))
                return -EHOSTUNREACH;