diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-07-08 23:17:39 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2004-07-08 23:17:39 +0000 |
commit | 874d091f8e32cf317dec9b34ef72a956327310c2 (patch) | |
tree | 4cff2df9372fb3b158955c2350b901ae3f133202 /sys/net | |
parent | 59dab498838589ddba099340ad02c7f6b7a5bb91 (diff) |
Make 0/0 table entries work; also fix a problem setting the network mask
on v6 addresses.
Reported by Ilya A. Kovalenko, fix from Cedric Berger.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf_table.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index 7a6723868a0..d7f1d952fbd 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.58 2004/06/23 04:34:17 mcbride Exp $ */ +/* $OpenBSD: pf_table.c,v 1.59 2004/07/08 23:17:38 mcbride Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -911,14 +911,14 @@ pfr_prepare_network(union sockaddr_union *sa, int af, int net) if (af == AF_INET) { sa->sin.sin_len = sizeof(sa->sin); sa->sin.sin_family = AF_INET; - sa->sin.sin_addr.s_addr = htonl(-1 << (32-net)); + sa->sin.sin_addr.s_addr = net ? htonl(-1 << (32-net)) : 0; } else if (af == AF_INET6) { sa->sin6.sin6_len = sizeof(sa->sin6); sa->sin6.sin6_family = AF_INET6; for (i = 0; i < 4; i++) { if (net <= 32) { sa->sin6.sin6_addr.s6_addr32[i] = - htonl(-1 << (32-net)); + net ? htonl(-1 << (32-net)) : 0; break; } sa->sin6.sin6_addr.s6_addr32[i] = 0xFFFFFFFF; |