mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
xfrm: Use VRF master index if output device is enslaved
Directs route lookups to VRF table. Compiles out if NET_VRF is not enabled. With this patch able to successfully bring up ipsec tunnels in VRFs, even with duplicate network configuration. Signed-off-by: David Ahern <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Acked-by: Steffen Klassert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6f021c62d6
commit
4ec3b28c27
2 changed files with 10 additions and 4 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include <net/dst.h>
|
||||
#include <net/xfrm.h>
|
||||
#include <net/ip.h>
|
||||
#include <net/vrf.h>
|
||||
|
||||
static struct xfrm_policy_afinfo xfrm4_policy_afinfo;
|
||||
|
||||
|
|
@ -107,8 +108,10 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
|
|||
struct flowi4 *fl4 = &fl->u.ip4;
|
||||
int oif = 0;
|
||||
|
||||
if (skb_dst(skb))
|
||||
oif = skb_dst(skb)->dev->ifindex;
|
||||
if (skb_dst(skb)) {
|
||||
oif = vrf_master_ifindex(skb_dst(skb)->dev) ?
|
||||
: skb_dst(skb)->dev->ifindex;
|
||||
}
|
||||
|
||||
memset(fl4, 0, sizeof(struct flowi4));
|
||||
fl4->flowi4_mark = skb->mark;
|
||||
|
|
|
|||
Loading…
Reference in a new issue