[Stgt-devel] [PATCH] iscsi: unsigned comparison
Pete Wyckoff
pw
Wed Dec 26 22:09:33 CET 2007
Unsigned value cannot be less than zero.
Signed-off-by: Pete Wyckoff <pw at osc.edu>
---
usr/iscsi/target.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/usr/iscsi/target.c b/usr/iscsi/target.c
index 0471d15..ffa18b2 100644
--- a/usr/iscsi/target.c
+++ b/usr/iscsi/target.c
@@ -84,8 +84,7 @@ static int netmask_match(struct sockaddr *sa1, struct sockaddr *sa2, char *buf)
uint8_t family = sa1->sa_family;
mbit = strtoul(buf, NULL, 0);
- if (mbit < 0 ||
- (family == AF_INET && mbit > 31) ||
+ if ((family == AF_INET && mbit > 31) ||
(family == AF_INET6 && mbit > 127))
return 0;
--
1.5.3.6
More information about the stgt
mailing list