diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-12-12 13:36:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:57:21 -0500 |
commit | 815f4e57e9fc67456624ecde0515a901368c78d2 (patch) | |
tree | a93d4c3922d9711a6d29d909c8d79694c931e2a4 | |
parent | 3f71c81ac37b27b824e9ce18fe17438dc2af4a16 (diff) |
[IPSEC]: Make xfrm_lookup flags argument a bit-field
This patch introduces an enum for bits in the flags argument of xfrm_lookup.
This is so that we can cram more information into it later.
Since all current users use just the values 0 and 1, XFRM_LOOKUP_WAIT has
been added with the value 1 << 0 to represent the current meaning of flags.
The test in __xfrm_lookup has been changed accordingly.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/dst.h | 5 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index e86b9a008ebf..aaa2dbb50179 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -265,6 +265,11 @@ static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie) | |||
265 | 265 | ||
266 | extern void dst_init(void); | 266 | extern void dst_init(void); |
267 | 267 | ||
268 | /* Flags for xfrm_lookup flags argument. */ | ||
269 | enum { | ||
270 | XFRM_LOOKUP_WAIT = 1 << 0, | ||
271 | }; | ||
272 | |||
268 | struct flowi; | 273 | struct flowi; |
269 | #ifndef CONFIG_XFRM | 274 | #ifndef CONFIG_XFRM |
270 | static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, | 275 | static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 95dc581861e8..3d516d57b5b2 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1565,7 +1565,7 @@ restart: | |||
1565 | xfrm_pol_put(policy); | 1565 | xfrm_pol_put(policy); |
1566 | return -EREMOTE; | 1566 | return -EREMOTE; |
1567 | } | 1567 | } |
1568 | if (err == -EAGAIN && flags) { | 1568 | if (err == -EAGAIN && (flags & XFRM_LOOKUP_WAIT)) { |
1569 | DECLARE_WAITQUEUE(wait, current); | 1569 | DECLARE_WAITQUEUE(wait, current); |
1570 | 1570 | ||
1571 | add_wait_queue(&km_waitq, &wait); | 1571 | add_wait_queue(&km_waitq, &wait); |