X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mbd%2Fmbd.pl;fp=mbd%2Fmbd.pl;h=e1f9824de481b7acb121296ad9e6254b8d472df7;hb=5d0a12aca506c2a2d1a92a03d007836859da5011;hp=5be1ca0e22232243f35b53a18da503aa9a1017f8;hpb=fc0c7448e97779541aa7e27269bf842906d7e138;p=nms diff --git a/mbd/mbd.pl b/mbd/mbd.pl index 5be1ca0..e1f9824 100644 --- a/mbd/mbd.pl +++ b/mbd/mbd.pl @@ -94,7 +94,7 @@ while (1) { my ($sport, $saddr) = sockaddr_in($addr); my ($dport, $daddr) = sockaddr_in(getsockname($sock)); my $size = length($data); - + # Check if this is a survey reply if ($dport >= $Config::survey_port_low && $dport <= $Config::survey_port_high) { if (!exists($active_surveys{$dport})) { @@ -110,17 +110,17 @@ while (1) { next; } - + # Rate limiting if (exists($last_sent{$saddr}{$dport})) { my $elapsed = Time::HiRes::tv_interval($last_sent{$saddr}{$dport}, $now); if ($elapsed < 1.0) { print LOG "$dport $size 2\n"; print inet_ntoa($saddr), ", $dport, $size bytes => rate-limited ($elapsed secs since last)\n"; + next; } - next; } - + # We don't get the packet's destination address, but I guess this should do... # Check against the ACL. my $pass = 0;