summaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_state.c
diff options
context:
space:
mode:
authorFan Du <fan.du@windriver.com>2013-09-27 16:32:50 +0800
committerSteffen Klassert <steffen.klassert@secunet.com>2013-10-01 10:09:33 +0200
commitf59bbdfa5c6e2a2f74f0e03d1beab6ddb9b3d466 (patch)
treee23099b592a25afe33fa49f3adcd5a751d3013e4 /net/xfrm/xfrm_state.c
parent6f1156383a419a4d19bdc196ffa8d4dbe2f01b36 (diff)
downloadblackbird-obmc-linux-f59bbdfa5c6e2a2f74f0e03d1beab6ddb9b3d466.tar.gz
blackbird-obmc-linux-f59bbdfa5c6e2a2f74f0e03d1beab6ddb9b3d466.zip
xfrm: Simplify SA looking up when using wildcard source
__xfrm4/6_state_addr_check is a four steps check, all we need to do is checking whether the destination address match when looking SA using wildcard source address. Passing saddr from flow is worst option, as the checking needs to reach the fourth step while actually only one time checking will do the work. So, simplify this process by only checking destination address when using wildcard source address for looking up SAs. Signed-off-by: Fan Du <fan.du@windriver.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r--net/xfrm/xfrm_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index b2117a161d8b..68c2f357a183 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -824,7 +824,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
x->props.reqid == tmpl->reqid &&
(mark & x->mark.m) == x->mark.v &&
!(x->props.flags & XFRM_STATE_WILDRECV) &&
- xfrm_state_addr_check(x, daddr, saddr, encap_family) &&
+ xfrm_addr_equal(&x->id.daddr, daddr, encap_family) &&
tmpl->mode == x->props.mode &&
tmpl->id.proto == x->id.proto &&
(tmpl->id.spi == x->id.spi || !tmpl->id.spi))
OpenPOWER on IntegriCloud