aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/xfrm.h5
-rw-r--r--net/key/af_key.c4
-rw-r--r--net/xfrm/xfrm_policy.c8
-rw-r--r--net/xfrm/xfrm_user.c10
4 files changed, 14 insertions, 13 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 693523c870b9..a7df3275b860 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1450,11 +1450,12 @@ extern int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk,
1450 int (*func)(struct xfrm_policy *, int, int, void*), void *); 1450 int (*func)(struct xfrm_policy *, int, int, void*), void *);
1451extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); 1451extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk);
1452int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1452int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1453struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u8 type, int dir, 1453struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark,
1454 u8 type, int dir,
1454 struct xfrm_selector *sel, 1455 struct xfrm_selector *sel,
1455 struct xfrm_sec_ctx *ctx, int delete, 1456 struct xfrm_sec_ctx *ctx, int delete,
1456 int *err); 1457 int *err);
1457struct xfrm_policy *xfrm_policy_byid(struct net *net, u8, int dir, u32 id, int delete, int *err); 1458struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, u32 id, int delete, int *err);
1458int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1459int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1459u32 xfrm_get_acqseq(void); 1460u32 xfrm_get_acqseq(void);
1460extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1461extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
diff --git a/net/key/af_key.c b/net/key/af_key.c
index aae3cd86ccd7..368707882647 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2326,7 +2326,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
2326 return err; 2326 return err;
2327 } 2327 }
2328 2328
2329 xp = xfrm_policy_bysel_ctx(net, XFRM_POLICY_TYPE_MAIN, 2329 xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, XFRM_POLICY_TYPE_MAIN,
2330 pol->sadb_x_policy_dir - 1, &sel, pol_ctx, 2330 pol->sadb_x_policy_dir - 1, &sel, pol_ctx,
2331 1, &err); 2331 1, &err);
2332 security_xfrm_policy_free(pol_ctx); 2332 security_xfrm_policy_free(pol_ctx);
@@ -2574,7 +2574,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
2574 return -EINVAL; 2574 return -EINVAL;
2575 2575
2576 delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2); 2576 delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2);
2577 xp = xfrm_policy_byid(net, XFRM_POLICY_TYPE_MAIN, 2577 xp = xfrm_policy_byid(net, DUMMY_MARK, XFRM_POLICY_TYPE_MAIN,
2578 dir, pol->sadb_x_policy_id, delete, &err); 2578 dir, pol->sadb_x_policy_id, delete, &err);
2579 if (xp == NULL) 2579 if (xp == NULL)
2580 return -ENOENT; 2580 return -ENOENT;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index d6eb16d75243..e67d3ca6e657 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -635,8 +635,8 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
635} 635}
636EXPORT_SYMBOL(xfrm_policy_insert); 636EXPORT_SYMBOL(xfrm_policy_insert);
637 637
638struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u8 type, int dir, 638struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, u8 type,
639 struct xfrm_selector *sel, 639 int dir, struct xfrm_selector *sel,
640 struct xfrm_sec_ctx *ctx, int delete, 640 struct xfrm_sec_ctx *ctx, int delete,
641 int *err) 641 int *err)
642{ 642{
@@ -676,8 +676,8 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u8 type, int dir,
676} 676}
677EXPORT_SYMBOL(xfrm_policy_bysel_ctx); 677EXPORT_SYMBOL(xfrm_policy_bysel_ctx);
678 678
679struct xfrm_policy *xfrm_policy_byid(struct net *net, u8 type, int dir, u32 id, 679struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8 type,
680 int delete, int *err) 680 int dir, u32 id, int delete, int *err)
681{ 681{
682 struct xfrm_policy *pol, *ret; 682 struct xfrm_policy *pol, *ret;
683 struct hlist_head *chain; 683 struct hlist_head *chain;
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 331ae731080a..02a67b4a64dd 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1457,7 +1457,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1457 return err; 1457 return err;
1458 1458
1459 if (p->index) 1459 if (p->index)
1460 xp = xfrm_policy_byid(net, type, p->dir, p->index, delete, &err); 1460 xp = xfrm_policy_byid(net, DUMMY_MARK, type, p->dir, p->index, delete, &err);
1461 else { 1461 else {
1462 struct nlattr *rt = attrs[XFRMA_SEC_CTX]; 1462 struct nlattr *rt = attrs[XFRMA_SEC_CTX];
1463 struct xfrm_sec_ctx *ctx; 1463 struct xfrm_sec_ctx *ctx;
@@ -1474,8 +1474,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1474 if (err) 1474 if (err)
1475 return err; 1475 return err;
1476 } 1476 }
1477 xp = xfrm_policy_bysel_ctx(net, type, p->dir, &p->sel, ctx, 1477 xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, type, p->dir,
1478 delete, &err); 1478 &p->sel, ctx, delete, &err);
1479 security_xfrm_policy_free(ctx); 1479 security_xfrm_policy_free(ctx);
1480 } 1480 }
1481 if (xp == NULL) 1481 if (xp == NULL)
@@ -1712,7 +1712,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
1712 return err; 1712 return err;
1713 1713
1714 if (p->index) 1714 if (p->index)
1715 xp = xfrm_policy_byid(net, type, p->dir, p->index, 0, &err); 1715 xp = xfrm_policy_byid(net, DUMMY_MARK, type, p->dir, p->index, 0, &err);
1716 else { 1716 else {
1717 struct nlattr *rt = attrs[XFRMA_SEC_CTX]; 1717 struct nlattr *rt = attrs[XFRMA_SEC_CTX];
1718 struct xfrm_sec_ctx *ctx; 1718 struct xfrm_sec_ctx *ctx;
@@ -1729,7 +1729,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
1729 if (err) 1729 if (err)
1730 return err; 1730 return err;
1731 } 1731 }
1732 xp = xfrm_policy_bysel_ctx(net, type, p->dir, &p->sel, ctx, 0, &err); 1732 xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, type, p->dir, &p->sel, ctx, 0, &err);
1733 security_xfrm_policy_free(ctx); 1733 security_xfrm_policy_free(ctx);
1734 } 1734 }
1735 if (xp == NULL) 1735 if (xp == NULL)