summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorguy <guy>2003-07-30 00:20:28 +0000
committerguy <guy>2003-07-30 00:20:28 +0000
commit66b89d8fb86a633944c17c380fbd324253f360ba (patch)
tree6eed53f554c426064db0d5d60d2186b811123042 /util.c
parent424af667c39dd7b052f35f633e111d94a903cc59 (diff)
downloadtcpdump-66b89d8fb86a633944c17c380fbd324253f360ba.tar.gz
As per a comment by Alex Medvedev <alexm@pycckue.org>, start the search
for prefixes at bitmasks[32] (the last element of a 33-element array), not bitmasks[33] (one past the last element of that array). Clean up white space.
Diffstat (limited to 'util.c')
-rw-r--r--util.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/util.c b/util.c
index ad7e3fde..36b8611c 100644
--- a/util.c
+++ b/util.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.85 2003-04-21 16:59:52 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.86 2003-07-30 00:20:28 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -328,15 +328,15 @@ mask2plen (u_int32_t mask)
0xffffff80, 0xffffffc0, 0xffffffe0, 0xfffffff0,
0xfffffff8, 0xfffffffc, 0xfffffffe, 0xffffffff
};
- int prefix_len = 33;
+ int prefix_len = 32;
- /* lets see if we can transform the mask into a prefixlen */
- while (prefix_len >= 0) {
- if (bitmasks[prefix_len] == mask)
- break;
- prefix_len--;
- }
- return (prefix_len);
+ /* let's see if we can transform the mask into a prefixlen */
+ while (prefix_len >= 0) {
+ if (bitmasks[prefix_len] == mask)
+ break;
+ prefix_len--;
+ }
+ return (prefix_len);
}
/* VARARGS */