pvxvct IP range parsing
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@ parsePeer(const char *optarg)
|
||||
// only # of bits. eg. "/24"
|
||||
std::istringstream strm(match[2].str());
|
||||
unsigned nbit=0;
|
||||
if((strm>>nbit).good()) {
|
||||
if(!(strm>>nbit).good() || nbit>32) {
|
||||
throw std::runtime_error(pva::SB()<<"Expected number of bits. not "<<match[2]);
|
||||
}
|
||||
mask.s_addr = htonl(0xffffffff<<(32-nbit));
|
||||
|
||||
Reference in New Issue
Block a user