summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-09 23:37:04 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-09 23:37:04 +0000
commit8711db1a766b04b5a2affbddd77484ac2f1c1639 (patch)
treeb555ab646daf8000fde1888f68f375e815c4dc3d /sys/net
parent0f1aa781de5bde8c6b345cb166cc2f87bfece14d (diff)
Use rt_maskedcopy() instead of handling netmasks manually.
Diffstat (limited to 'sys/net')
-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();