mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Fixed linux UDP Server. It did not get the peer IP.
This commit is contained in:
parent
da159f9464
commit
59dcb8fb80
@ -1829,9 +1829,7 @@ sub udp_server ($$) {
|
|||||||
$sock = IO::Socket::INET->new(LocalPort => $udp_port, Proto => 'udp') or die "socket: $@";
|
$sock = IO::Socket::INET->new(LocalPort => $udp_port, Proto => 'udp') or die "socket: $@";
|
||||||
|
|
||||||
while ($sock->recv($newmsg, $MAXLEN)) {
|
while ($sock->recv($newmsg, $MAXLEN)) {
|
||||||
my($port, $ipaddr) = sockaddr_in($sock->peername);
|
my $hishost = $sock->peerhost();
|
||||||
$hishost = gethostbyaddr($ipaddr, AF_INET);
|
|
||||||
|
|
||||||
if (($udp_auth_address eq "0.0.0.0") || ($hishost eq $udp_auth_address)){
|
if (($udp_auth_address eq "0.0.0.0") || ($hishost eq $udp_auth_address)){
|
||||||
if ($newmsg =~ /REFRESH AGENT/){
|
if ($newmsg =~ /REFRESH AGENT/){
|
||||||
# Send signal to restart agent
|
# Send signal to restart agent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user