aboutsummaryrefslogtreecommitdiffstats
path: root/net/key
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/key
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/key')
-rw-r--r--net/key/af_key.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 5b426a646544..cc2630ac8061 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -762,7 +762,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
762 } 762 }
763 763
764 /* identity & sensitivity */ 764 /* identity & sensitivity */
765 if (xfrm_addr_cmp(&x->sel.saddr, &x->props.saddr, x->props.family)) 765 if (!xfrm_addr_equal(&x->sel.saddr, &x->props.saddr, x->props.family))
766 size += sizeof(struct sadb_address) + sockaddr_size; 766 size += sizeof(struct sadb_address) + sockaddr_size;
767 767
768 if (add_keys) { 768 if (add_keys) {
@@ -909,8 +909,8 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x,
909 if (!addr->sadb_address_prefixlen) 909 if (!addr->sadb_address_prefixlen)
910 BUG(); 910 BUG();
911 911
912 if (xfrm_addr_cmp(&x->sel.saddr, &x->props.saddr, 912 if (!xfrm_addr_equal(&x->sel.saddr, &x->props.saddr,
913 x->props.family)) { 913 x->props.family)) {
914 addr = (struct sadb_address*) skb_put(skb, 914 addr = (struct sadb_address*) skb_put(skb,
915 sizeof(struct sadb_address)+sockaddr_size); 915 sizeof(struct sadb_address)+sockaddr_size);
916 addr->sadb_address_len = 916 addr->sadb_address_len =
@@ -1321,7 +1321,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_
1321 1321
1322 if (hdr->sadb_msg_seq) { 1322 if (hdr->sadb_msg_seq) {
1323 x = xfrm_find_acq_byseq(net, DUMMY_MARK, hdr->sadb_msg_seq); 1323 x = xfrm_find_acq_byseq(net, DUMMY_MARK, hdr->sadb_msg_seq);
1324 if (x && xfrm_addr_cmp(&x->id.daddr, xdaddr, family)) { 1324 if (x && !xfrm_addr_equal(&x->id.daddr, xdaddr, family)) {
1325 xfrm_state_put(x); 1325 xfrm_state_put(x);
1326 x = NULL; 1326 x = NULL;
1327 } 1327 }