Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73137147 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

xfrm: fix __xfrm_route_forward()



This function should return 0 in case of error, 1 if OK
commit 452edd59 (xfrm: Return dst directly from xfrm_lookup())
got it wrong.

Reported-and-bisected-by: default avatarMichael Smith <msmith@cbnco.com>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c337ffb6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2175,7 +2175,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
	struct net *net = dev_net(skb->dev);
	struct flowi fl;
	struct dst_entry *dst;
	int res = 0;
	int res = 1;

	if (xfrm_decode_session(skb, &fl, family) < 0) {
		XFRM_INC_STATS(net, LINUX_MIB_XFRMFWDHDRERROR);
@@ -2186,7 +2186,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)

	dst = xfrm_lookup(net, skb_dst(skb), &fl, NULL, 0);
	if (IS_ERR(dst)) {
		res = 1;
		res = 0;
		dst = NULL;
	}
	skb_dst_set(skb, dst);