[IPSEC]: Make sure idev is consistent with dev in xfrm_dst
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 14 Nov 2007 05:36:07 +0000 (21:36 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:53:40 +0000 (14:53 -0800)
commitfff693888012806370c98c601fbaa141fb12dfca
treedfa42737bee5f14d1acfaabbc9320fdc45487dec
parent45ff5a3f9a3d0b1b4f063b5285ab39b7fac59471
[IPSEC]: Make sure idev is consistent with dev in xfrm_dst

Previously we took the device from the bottom route and idev from the
top route.  This is bad because idev may well point to a different
device.  This patch changes it so that we get the idev from the device
directly.

It also makes it an error if either dev or idev is NULL.  This is
consistent with the rest of the routing code which also treats these
cases as errors.

I've removed the err initialisation in xfrm6_policy.c because it
achieves no purpose and hid a bug when an initial version of this
patch neglected to set err to -ENODEV (fortunately the IPv4 version
warned about it).

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/xfrm4_policy.c
net/ipv6/xfrm6_policy.c