]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: release dst_orig in case of error in xfrm_lookup()
authorhuaibin Wang <huaibin.wang@6wind.com>
Wed, 11 Feb 2015 17:10:36 +0000 (18:10 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 12 Feb 2015 06:10:56 +0000 (07:10 +0100)
commit7cf8001fb1e6aaeba23acaecb8f54768727e9d1d
treea1d2ad2b28b5b4cd032dca88c6c297afb7155d24
parent0a654dda80de90693c326d4bd75bc3b8df262aba
xfrm: release dst_orig in case of error in xfrm_lookup()

dst_orig should be released on error. Function like __xfrm_route_forward()
expects that behavior.
Since a recent commit, xfrm_lookup() may also be called by xfrm_lookup_route(),
which expects the opposite.
Let's introduce a new flag (XFRM_LOOKUP_KEEP_DST_REF) to tell what should be
done in case of error.

Fixes: b3ad3e083eb("xfrm: Generate blackhole routes only from route lookup functions")
Signed-off-by: huaibin Wang <huaibin.wang@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
include/net/dst.h
net/xfrm/xfrm_policy.c