Detect IP address in URLs like http://ip:port/

This if for devices like the Tenvis TH661 which responds with:

http://192.168.1.246:8080/onvif/devices
This commit is contained in:
Jon Burgess 2016-03-19 13:31:33 +00:00
parent fe46785e94
commit 16cf1b6245
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ sub interpret_messages
my $xaddr; my $xaddr;
foreach my $l_xaddr (split ' ', $result->get_ProbeMatch()->get_XAddrs()) { foreach my $l_xaddr (split ' ', $result->get_ProbeMatch()->get_XAddrs()) {
# find IPv4 address # find IPv4 address
if($l_xaddr =~ m|//[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/|) { if($l_xaddr =~ m|//[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[:/]|) {
$xaddr = $l_xaddr; $xaddr = $l_xaddr;
last; last;
} }