git://developer.intra2net.com
/
libi2ncommon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
0bc951d
)
better errormessage in case of invalid range ends
author
Gerd von Egidy
<gerd.von.egidy@intra2net.com>
Fri, 15 Oct 2010 14:35:25 +0000 (16:35 +0200)
committer
Gerd von Egidy
<gerd.von.egidy@intra2net.com>
Fri, 15 Oct 2010 14:35:54 +0000 (16:35 +0200)
src/ipfunc.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/ipfunc.cpp
b/src/ipfunc.cpp
index
521c6a3
..
12fdca5
100644
(file)
--- a/
src/ipfunc.cpp
+++ b/
src/ipfunc.cpp
@@
-105,9
+105,12
@@
void IP_RANGE::load(type t, const std::string& ip, const std::string& mask_or_en
}
else if (t==RANGE)
{
- if(!inet_aton(ip.c_str(),&ia_ip1) || !inet_aton(mask_or_end.c_str(),&ia_ip2))
+ if(!inet_aton(ip.c_str(),&ia_ip1))
throw runtime_error("invalid IP given: "+ip);
-
+
+ if(!inet_aton(mask_or_end.c_str(),&ia_ip2))
+ throw runtime_error("invalid IP given: "+mask_or_end);
+
this->ip=ia_ip1.s_addr;
this->end=ia_ip2.s_addr;