diff options
author | russ <russ@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-02-12 22:20:19 +0000 |
---|---|---|
committer | russ <russ@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-02-12 22:20:19 +0000 |
commit | 8171b515eff444e08d8da16d1e4728538ceaeb81 (patch) | |
tree | 8c90a053f1c976985368292b7f3d01bfc71e67e0 /networking/udhcp/script.c | |
parent | bce815faade9b4526b62dd237a9827228a2632a6 (diff) | |
download | busybox-w32-8171b515eff444e08d8da16d1e4728538ceaeb81.tar.gz busybox-w32-8171b515eff444e08d8da16d1e4728538ceaeb81.tar.bz2 busybox-w32-8171b515eff444e08d8da16d1e4728538ceaeb81.zip |
sync with udhcp bug fixes
git-svn-id: svn://busybox.net/trunk/busybox@6597 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking/udhcp/script.c')
-rw-r--r-- | networking/udhcp/script.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index 2eb4459dd..48ff8e07e 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c | |||
@@ -68,10 +68,11 @@ static int sprintip(char *dest, char *pre, unsigned char *ip) | |||
68 | static int mton(struct in_addr *mask) | 68 | static int mton(struct in_addr *mask) |
69 | { | 69 | { |
70 | int i; | 70 | int i; |
71 | /* note: mask will always be in network byte order, so | 71 | unsigned long bits = ntohl(mask->s_addr); |
72 | * there are no endian issues */ | 72 | /* too bad one can't check the carry bit, etc in c bit |
73 | for (i = 31; i >= 0 && !((mask->s_addr >> i) & 1); i--); | 73 | * shifting */ |
74 | return i + 1; | 74 | for (i = 0; i < 32 && !((bits >> i) & 1); i++); |
75 | return 32 - i; | ||
75 | } | 76 | } |
76 | 77 | ||
77 | 78 | ||