aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_policy.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2013-01-29 07:48:50 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-29 22:58:40 -0500
commit70e94e66aec255aff276397f5ed3f3626c548f1c (patch)
treef8a266b768f73394271a58a90b7d8375705079df /net/xfrm/xfrm_policy.c
parentff88b30c717f21dffba6784cae4d3287da16f6ef (diff)
xfrm: Convert xfrm_addr_cmp() to boolean xfrm_addr_equal().
All users of xfrm_addr_cmp() use its result as boolean. Introduce xfrm_addr_equal() (which is equal to !xfrm_addr_cmp()) and convert all users. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_policy.c')
-rw-r--r--net/xfrm/xfrm_policy.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 07c585756d2a..6c9aa642a2ba 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2786,10 +2786,10 @@ static bool xfrm_migrate_selector_match(const struct xfrm_selector *sel_cmp,
2786{ 2786{
2787 if (sel_cmp->proto == IPSEC_ULPROTO_ANY) { 2787 if (sel_cmp->proto == IPSEC_ULPROTO_ANY) {
2788 if (sel_tgt->family == sel_cmp->family && 2788 if (sel_tgt->family == sel_cmp->family &&
2789 xfrm_addr_cmp(&sel_tgt->daddr, &sel_cmp->daddr, 2789 xfrm_addr_equal(&sel_tgt->daddr, &sel_cmp->daddr,
2790 sel_cmp->family) == 0 && 2790 sel_cmp->family) &&
2791 xfrm_addr_cmp(&sel_tgt->saddr, &sel_cmp->saddr, 2791 xfrm_addr_equal(&sel_tgt->saddr, &sel_cmp->saddr,
2792 sel_cmp->family) == 0 && 2792 sel_cmp->family) &&
2793 sel_tgt->prefixlen_d == sel_cmp->prefixlen_d && 2793 sel_tgt->prefixlen_d == sel_cmp->prefixlen_d &&
2794 sel_tgt->prefixlen_s == sel_cmp->prefixlen_s) { 2794 sel_tgt->prefixlen_s == sel_cmp->prefixlen_s) {
2795 return true; 2795 return true;
@@ -2847,10 +2847,10 @@ static int migrate_tmpl_match(const struct xfrm_migrate *m, const struct xfrm_tm
2847 switch (t->mode) { 2847 switch (t->mode) {
2848 case XFRM_MODE_TUNNEL: 2848 case XFRM_MODE_TUNNEL:
2849 case XFRM_MODE_BEET: 2849 case XFRM_MODE_BEET:
2850 if (xfrm_addr_cmp(&t->id.daddr, &m->old_daddr, 2850 if (xfrm_addr_equal(&t->id.daddr, &m->old_daddr,
2851 m->old_family) == 0 && 2851 m->old_family) &&
2852 xfrm_addr_cmp(&t->saddr, &m->old_saddr, 2852 xfrm_addr_equal(&t->saddr, &m->old_saddr,
2853 m->old_family) == 0) { 2853 m->old_family)) {
2854 match = 1; 2854 match = 1;
2855 } 2855 }
2856 break; 2856 break;
@@ -2916,10 +2916,10 @@ static int xfrm_migrate_check(const struct xfrm_migrate *m, int num_migrate)
2916 return -EINVAL; 2916 return -EINVAL;
2917 2917
2918 for (i = 0; i < num_migrate; i++) { 2918 for (i = 0; i < num_migrate; i++) {
2919 if ((xfrm_addr_cmp(&m[i].old_daddr, &m[i].new_daddr, 2919 if (xfrm_addr_equal(&m[i].old_daddr, &m[i].new_daddr,
2920 m[i].old_family) == 0) && 2920 m[i].old_family) &&
2921 (xfrm_addr_cmp(&m[i].old_saddr, &m[i].new_saddr, 2921 xfrm_addr_equal(&m[i].old_saddr, &m[i].new_saddr,
2922 m[i].old_family) == 0)) 2922 m[i].old_family))
2923 return -EINVAL; 2923 return -EINVAL;
2924 if (xfrm_addr_any(&m[i].new_daddr, m[i].new_family) || 2924 if (xfrm_addr_any(&m[i].new_daddr, m[i].new_family) ||
2925 xfrm_addr_any(&m[i].new_saddr, m[i].new_family)) 2925 xfrm_addr_any(&m[i].new_saddr, m[i].new_family))