summaryrefslogtreecommitdiff
path: root/sys/net/pfkeyv2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/pfkeyv2.c')
-rw-r--r--sys/net/pfkeyv2.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c
index bff9d982740..975df403a27 100644
--- a/sys/net/pfkeyv2.c
+++ b/sys/net/pfkeyv2.c
@@ -1103,7 +1103,6 @@ pfkeyv2_send(struct socket *socket, void *message, int len)
union sockaddr_union *src, *dst, *srcmask, *dstmask;
u_int8_t sproto = 0, replace;
struct rtentry *rt;
- int lp;
/*
* SADB_X_SAFLAGS_REPLACEFLOW set means we should remove any
@@ -1144,13 +1143,8 @@ pfkeyv2_send(struct socket *socket, void *message, int len)
sproto = 0;
/* Generic netmask handling, works for IPv4 and IPv6 */
- for (lp = 0;
- lp < src->sa.sa_len - (sizeof(u_int8_t) + sizeof(sa_family_t);
- lp++)
- {
- src->sa.sa_data[lp] &= srcmask->sa.sa_data[lp];
- dst->sa.sa_data[lp] &= dstmask->sa.sa_data[lp];
- }
+ rt_maskedcopy(&src->sa, &src->sa, &srcmask->sa);
+ rt_maskedcopy(&dst->sa, &dst->sa, &dstmask->sa);
s = spltdb();