diff options
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 110 |
1 files changed, 69 insertions, 41 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 11c890ad8ebb..2e9f5c0018ae 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -38,22 +38,15 @@ | |||
38 | MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto)) | 38 | MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto)) |
39 | 39 | ||
40 | #ifdef CONFIG_XFRM_STATISTICS | 40 | #ifdef CONFIG_XFRM_STATISTICS |
41 | DECLARE_SNMP_STAT(struct linux_xfrm_mib, xfrm_statistics); | 41 | #define XFRM_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.xfrm_statistics, field) |
42 | #define XFRM_INC_STATS(field) SNMP_INC_STATS(xfrm_statistics, field) | 42 | #define XFRM_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.xfrm_statistics, field) |
43 | #define XFRM_INC_STATS_BH(field) SNMP_INC_STATS_BH(xfrm_statistics, field) | 43 | #define XFRM_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)-mib.xfrm_statistics, field) |
44 | #define XFRM_INC_STATS_USER(field) SNMP_INC_STATS_USER(xfrm_statistics, field) | ||
45 | #else | 44 | #else |
46 | #define XFRM_INC_STATS(field) | 45 | #define XFRM_INC_STATS(net, field) ((void)(net)) |
47 | #define XFRM_INC_STATS_BH(field) | 46 | #define XFRM_INC_STATS_BH(net, field) ((void)(net)) |
48 | #define XFRM_INC_STATS_USER(field) | 47 | #define XFRM_INC_STATS_USER(net, field) ((void)(net)) |
49 | #endif | 48 | #endif |
50 | 49 | ||
51 | extern struct sock *xfrm_nl; | ||
52 | extern u32 sysctl_xfrm_aevent_etime; | ||
53 | extern u32 sysctl_xfrm_aevent_rseqth; | ||
54 | extern int sysctl_xfrm_larval_drop; | ||
55 | extern u32 sysctl_xfrm_acq_expires; | ||
56 | |||
57 | extern struct mutex xfrm_cfg_mutex; | 50 | extern struct mutex xfrm_cfg_mutex; |
58 | 51 | ||
59 | /* Organization of SPD aka "XFRM rules" | 52 | /* Organization of SPD aka "XFRM rules" |
@@ -130,6 +123,9 @@ struct xfrm_state_walk { | |||
130 | /* Full description of state of transformer. */ | 123 | /* Full description of state of transformer. */ |
131 | struct xfrm_state | 124 | struct xfrm_state |
132 | { | 125 | { |
126 | #ifdef CONFIG_NET_NS | ||
127 | struct net *xs_net; | ||
128 | #endif | ||
133 | union { | 129 | union { |
134 | struct hlist_node gclist; | 130 | struct hlist_node gclist; |
135 | struct hlist_node bydst; | 131 | struct hlist_node bydst; |
@@ -223,6 +219,11 @@ struct xfrm_state | |||
223 | void *data; | 219 | void *data; |
224 | }; | 220 | }; |
225 | 221 | ||
222 | static inline struct net *xs_net(struct xfrm_state *x) | ||
223 | { | ||
224 | return read_pnet(&x->xs_net); | ||
225 | } | ||
226 | |||
226 | /* xflags - make enum if more show up */ | 227 | /* xflags - make enum if more show up */ |
227 | #define XFRM_TIME_DEFER 1 | 228 | #define XFRM_TIME_DEFER 1 |
228 | 229 | ||
@@ -249,6 +250,7 @@ struct km_event | |||
249 | u32 seq; | 250 | u32 seq; |
250 | u32 pid; | 251 | u32 pid; |
251 | u32 event; | 252 | u32 event; |
253 | struct net *net; | ||
252 | }; | 254 | }; |
253 | 255 | ||
254 | struct net_device; | 256 | struct net_device; |
@@ -257,10 +259,11 @@ struct xfrm_dst; | |||
257 | struct xfrm_policy_afinfo { | 259 | struct xfrm_policy_afinfo { |
258 | unsigned short family; | 260 | unsigned short family; |
259 | struct dst_ops *dst_ops; | 261 | struct dst_ops *dst_ops; |
260 | void (*garbage_collect)(void); | 262 | void (*garbage_collect)(struct net *net); |
261 | struct dst_entry *(*dst_lookup)(int tos, xfrm_address_t *saddr, | 263 | struct dst_entry *(*dst_lookup)(struct net *net, int tos, |
264 | xfrm_address_t *saddr, | ||
262 | xfrm_address_t *daddr); | 265 | xfrm_address_t *daddr); |
263 | int (*get_saddr)(xfrm_address_t *saddr, xfrm_address_t *daddr); | 266 | int (*get_saddr)(struct net *net, xfrm_address_t *saddr, xfrm_address_t *daddr); |
264 | struct dst_entry *(*find_bundle)(struct flowi *fl, struct xfrm_policy *policy); | 267 | struct dst_entry *(*find_bundle)(struct flowi *fl, struct xfrm_policy *policy); |
265 | void (*decode_session)(struct sk_buff *skb, | 268 | void (*decode_session)(struct sk_buff *skb, |
266 | struct flowi *fl, | 269 | struct flowi *fl, |
@@ -467,7 +470,9 @@ struct xfrm_policy_walk { | |||
467 | 470 | ||
468 | struct xfrm_policy | 471 | struct xfrm_policy |
469 | { | 472 | { |
470 | struct xfrm_policy *next; | 473 | #ifdef CONFIG_NET_NS |
474 | struct net *xp_net; | ||
475 | #endif | ||
471 | struct hlist_node bydst; | 476 | struct hlist_node bydst; |
472 | struct hlist_node byidx; | 477 | struct hlist_node byidx; |
473 | 478 | ||
@@ -492,6 +497,11 @@ struct xfrm_policy | |||
492 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; | 497 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; |
493 | }; | 498 | }; |
494 | 499 | ||
500 | static inline struct net *xp_net(struct xfrm_policy *xp) | ||
501 | { | ||
502 | return read_pnet(&xp->xp_net); | ||
503 | } | ||
504 | |||
495 | struct xfrm_kmaddress { | 505 | struct xfrm_kmaddress { |
496 | xfrm_address_t local; | 506 | xfrm_address_t local; |
497 | xfrm_address_t remote; | 507 | xfrm_address_t remote; |
@@ -537,15 +547,13 @@ struct xfrm_mgr | |||
537 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); | 547 | struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); |
538 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 548 | int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
539 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); | 549 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); |
540 | int (*report)(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 550 | int (*report)(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); |
541 | int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles, struct xfrm_kmaddress *k); | 551 | int (*migrate)(struct xfrm_selector *sel, u8 dir, u8 type, struct xfrm_migrate *m, int num_bundles, struct xfrm_kmaddress *k); |
542 | }; | 552 | }; |
543 | 553 | ||
544 | extern int xfrm_register_km(struct xfrm_mgr *km); | 554 | extern int xfrm_register_km(struct xfrm_mgr *km); |
545 | extern int xfrm_unregister_km(struct xfrm_mgr *km); | 555 | extern int xfrm_unregister_km(struct xfrm_mgr *km); |
546 | 556 | ||
547 | extern unsigned int xfrm_policy_count[XFRM_POLICY_MAX*2]; | ||
548 | |||
549 | /* | 557 | /* |
550 | * This structure is used for the duration where packets are being | 558 | * This structure is used for the duration where packets are being |
551 | * transformed by IPsec. As soon as the packet leaves IPsec the | 559 | * transformed by IPsec. As soon as the packet leaves IPsec the |
@@ -882,6 +890,7 @@ struct xfrm_dst | |||
882 | u32 path_cookie; | 890 | u32 path_cookie; |
883 | }; | 891 | }; |
884 | 892 | ||
893 | #ifdef CONFIG_XFRM | ||
885 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | 894 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) |
886 | { | 895 | { |
887 | dst_release(xdst->route); | 896 | dst_release(xdst->route); |
@@ -894,6 +903,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | |||
894 | xdst->partner = NULL; | 903 | xdst->partner = NULL; |
895 | #endif | 904 | #endif |
896 | } | 905 | } |
906 | #endif | ||
897 | 907 | ||
898 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | 908 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); |
899 | 909 | ||
@@ -977,12 +987,13 @@ static inline int __xfrm_policy_check2(struct sock *sk, int dir, | |||
977 | struct sk_buff *skb, | 987 | struct sk_buff *skb, |
978 | unsigned int family, int reverse) | 988 | unsigned int family, int reverse) |
979 | { | 989 | { |
990 | struct net *net = dev_net(skb->dev); | ||
980 | int ndir = dir | (reverse ? XFRM_POLICY_MASK + 1 : 0); | 991 | int ndir = dir | (reverse ? XFRM_POLICY_MASK + 1 : 0); |
981 | 992 | ||
982 | if (sk && sk->sk_policy[XFRM_POLICY_IN]) | 993 | if (sk && sk->sk_policy[XFRM_POLICY_IN]) |
983 | return __xfrm_policy_check(sk, ndir, skb, family); | 994 | return __xfrm_policy_check(sk, ndir, skb, family); |
984 | 995 | ||
985 | return (!xfrm_policy_count[dir] && !skb->sp) || | 996 | return (!net->xfrm.policy_count[dir] && !skb->sp) || |
986 | (skb->dst->flags & DST_NOPOLICY) || | 997 | (skb->dst->flags & DST_NOPOLICY) || |
987 | __xfrm_policy_check(sk, ndir, skb, family); | 998 | __xfrm_policy_check(sk, ndir, skb, family); |
988 | } | 999 | } |
@@ -1034,7 +1045,9 @@ extern int __xfrm_route_forward(struct sk_buff *skb, unsigned short family); | |||
1034 | 1045 | ||
1035 | static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family) | 1046 | static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family) |
1036 | { | 1047 | { |
1037 | return !xfrm_policy_count[XFRM_POLICY_OUT] || | 1048 | struct net *net = dev_net(skb->dev); |
1049 | |||
1050 | return !net->xfrm.policy_count[XFRM_POLICY_OUT] || | ||
1038 | (skb->dst->flags & DST_NOXFRM) || | 1051 | (skb->dst->flags & DST_NOXFRM) || |
1039 | __xfrm_route_forward(skb, family); | 1052 | __xfrm_route_forward(skb, family); |
1040 | } | 1053 | } |
@@ -1268,7 +1281,8 @@ struct xfrm6_tunnel { | |||
1268 | 1281 | ||
1269 | extern void xfrm_init(void); | 1282 | extern void xfrm_init(void); |
1270 | extern void xfrm4_init(void); | 1283 | extern void xfrm4_init(void); |
1271 | extern void xfrm_state_init(void); | 1284 | extern int xfrm_state_init(struct net *net); |
1285 | extern void xfrm_state_fini(struct net *net); | ||
1272 | extern void xfrm4_state_init(void); | 1286 | extern void xfrm4_state_init(void); |
1273 | #ifdef CONFIG_XFRM | 1287 | #ifdef CONFIG_XFRM |
1274 | extern int xfrm6_init(void); | 1288 | extern int xfrm6_init(void); |
@@ -1287,19 +1301,30 @@ static inline void xfrm6_fini(void) | |||
1287 | #endif | 1301 | #endif |
1288 | 1302 | ||
1289 | #ifdef CONFIG_XFRM_STATISTICS | 1303 | #ifdef CONFIG_XFRM_STATISTICS |
1290 | extern int xfrm_proc_init(void); | 1304 | extern int xfrm_proc_init(struct net *net); |
1305 | extern void xfrm_proc_fini(struct net *net); | ||
1306 | #endif | ||
1307 | |||
1308 | extern int xfrm_sysctl_init(struct net *net); | ||
1309 | #ifdef CONFIG_SYSCTL | ||
1310 | extern void xfrm_sysctl_fini(struct net *net); | ||
1311 | #else | ||
1312 | static inline void xfrm_sysctl_fini(struct net *net) | ||
1313 | { | ||
1314 | } | ||
1291 | #endif | 1315 | #endif |
1292 | 1316 | ||
1293 | extern void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); | 1317 | extern void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); |
1294 | extern int xfrm_state_walk(struct xfrm_state_walk *walk, | 1318 | extern int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, |
1295 | int (*func)(struct xfrm_state *, int, void*), void *); | 1319 | int (*func)(struct xfrm_state *, int, void*), void *); |
1296 | extern void xfrm_state_walk_done(struct xfrm_state_walk *walk); | 1320 | extern void xfrm_state_walk_done(struct xfrm_state_walk *walk); |
1297 | extern struct xfrm_state *xfrm_state_alloc(void); | 1321 | extern struct xfrm_state *xfrm_state_alloc(struct net *net); |
1298 | extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | 1322 | extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, |
1299 | struct flowi *fl, struct xfrm_tmpl *tmpl, | 1323 | struct flowi *fl, struct xfrm_tmpl *tmpl, |
1300 | struct xfrm_policy *pol, int *err, | 1324 | struct xfrm_policy *pol, int *err, |
1301 | unsigned short family); | 1325 | unsigned short family); |
1302 | extern struct xfrm_state * xfrm_stateonly_find(xfrm_address_t *daddr, | 1326 | extern struct xfrm_state * xfrm_stateonly_find(struct net *net, |
1327 | xfrm_address_t *daddr, | ||
1303 | xfrm_address_t *saddr, | 1328 | xfrm_address_t *saddr, |
1304 | unsigned short family, | 1329 | unsigned short family, |
1305 | u8 mode, u8 proto, u32 reqid); | 1330 | u8 mode, u8 proto, u32 reqid); |
@@ -1307,8 +1332,8 @@ extern int xfrm_state_check_expire(struct xfrm_state *x); | |||
1307 | extern void xfrm_state_insert(struct xfrm_state *x); | 1332 | extern void xfrm_state_insert(struct xfrm_state *x); |
1308 | extern int xfrm_state_add(struct xfrm_state *x); | 1333 | extern int xfrm_state_add(struct xfrm_state *x); |
1309 | extern int xfrm_state_update(struct xfrm_state *x); | 1334 | extern int xfrm_state_update(struct xfrm_state *x); |
1310 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family); | 1335 | extern struct xfrm_state *xfrm_state_lookup(struct net *net, xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family); |
1311 | extern struct xfrm_state *xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family); | 1336 | extern struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family); |
1312 | #ifdef CONFIG_XFRM_SUB_POLICY | 1337 | #ifdef CONFIG_XFRM_SUB_POLICY |
1313 | extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, | 1338 | extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, |
1314 | int n, unsigned short family); | 1339 | int n, unsigned short family); |
@@ -1345,9 +1370,9 @@ struct xfrmk_spdinfo { | |||
1345 | u32 spdhmcnt; | 1370 | u32 spdhmcnt; |
1346 | }; | 1371 | }; |
1347 | 1372 | ||
1348 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); | 1373 | extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 seq); |
1349 | extern int xfrm_state_delete(struct xfrm_state *x); | 1374 | extern int xfrm_state_delete(struct xfrm_state *x); |
1350 | extern int xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); | 1375 | extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); |
1351 | extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si); | 1376 | extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si); |
1352 | extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si); | 1377 | extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si); |
1353 | extern int xfrm_replay_check(struct xfrm_state *x, | 1378 | extern int xfrm_replay_check(struct xfrm_state *x, |
@@ -1415,22 +1440,22 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb) | |||
1415 | } | 1440 | } |
1416 | #endif | 1441 | #endif |
1417 | 1442 | ||
1418 | struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); | 1443 | struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp); |
1419 | 1444 | ||
1420 | extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); | 1445 | extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); |
1421 | extern int xfrm_policy_walk(struct xfrm_policy_walk *walk, | 1446 | extern int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, |
1422 | int (*func)(struct xfrm_policy *, int, int, void*), void *); | 1447 | int (*func)(struct xfrm_policy *, int, int, void*), void *); |
1423 | extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); | 1448 | extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); |
1424 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); | 1449 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); |
1425 | struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, | 1450 | struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u8 type, int dir, |
1426 | struct xfrm_selector *sel, | 1451 | struct xfrm_selector *sel, |
1427 | struct xfrm_sec_ctx *ctx, int delete, | 1452 | struct xfrm_sec_ctx *ctx, int delete, |
1428 | int *err); | 1453 | int *err); |
1429 | struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); | 1454 | struct xfrm_policy *xfrm_policy_byid(struct net *net, u8, int dir, u32 id, int delete, int *err); |
1430 | int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); | 1455 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); |
1431 | u32 xfrm_get_acqseq(void); | 1456 | u32 xfrm_get_acqseq(void); |
1432 | extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); | 1457 | extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); |
1433 | struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, | 1458 | struct xfrm_state * xfrm_find_acq(struct net *net, u8 mode, u32 reqid, u8 proto, |
1434 | xfrm_address_t *daddr, xfrm_address_t *saddr, | 1459 | xfrm_address_t *daddr, xfrm_address_t *saddr, |
1435 | int create, unsigned short family); | 1460 | int create, unsigned short family); |
1436 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); | 1461 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); |
@@ -1449,10 +1474,9 @@ extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type, | |||
1449 | struct xfrm_kmaddress *k); | 1474 | struct xfrm_kmaddress *k); |
1450 | #endif | 1475 | #endif |
1451 | 1476 | ||
1452 | extern wait_queue_head_t km_waitq; | ||
1453 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 1477 | extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
1454 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); | 1478 | extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid); |
1455 | extern int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); | 1479 | extern int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); |
1456 | 1480 | ||
1457 | extern void xfrm_input_init(void); | 1481 | extern void xfrm_input_init(void); |
1458 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); | 1482 | extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); |
@@ -1497,18 +1521,20 @@ static inline int xfrm_policy_id2dir(u32 index) | |||
1497 | return index & 7; | 1521 | return index & 7; |
1498 | } | 1522 | } |
1499 | 1523 | ||
1500 | static inline int xfrm_aevent_is_on(void) | 1524 | #ifdef CONFIG_XFRM |
1525 | static inline int xfrm_aevent_is_on(struct net *net) | ||
1501 | { | 1526 | { |
1502 | struct sock *nlsk; | 1527 | struct sock *nlsk; |
1503 | int ret = 0; | 1528 | int ret = 0; |
1504 | 1529 | ||
1505 | rcu_read_lock(); | 1530 | rcu_read_lock(); |
1506 | nlsk = rcu_dereference(xfrm_nl); | 1531 | nlsk = rcu_dereference(net->xfrm.nlsk); |
1507 | if (nlsk) | 1532 | if (nlsk) |
1508 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); | 1533 | ret = netlink_has_listeners(nlsk, XFRMNLGRP_AEVENTS); |
1509 | rcu_read_unlock(); | 1534 | rcu_read_unlock(); |
1510 | return ret; | 1535 | return ret; |
1511 | } | 1536 | } |
1537 | #endif | ||
1512 | 1538 | ||
1513 | static inline int xfrm_alg_len(struct xfrm_algo *alg) | 1539 | static inline int xfrm_alg_len(struct xfrm_algo *alg) |
1514 | { | 1540 | { |
@@ -1536,9 +1562,11 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n) | |||
1536 | } | 1562 | } |
1537 | #endif | 1563 | #endif |
1538 | 1564 | ||
1565 | #ifdef CONFIG_XFRM | ||
1539 | static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) | 1566 | static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) |
1540 | { | 1567 | { |
1541 | return skb->sp->xvec[skb->sp->len - 1]; | 1568 | return skb->sp->xvec[skb->sp->len - 1]; |
1542 | } | 1569 | } |
1570 | #endif | ||
1543 | 1571 | ||
1544 | #endif /* _NET_XFRM_H */ | 1572 | #endif /* _NET_XFRM_H */ |