X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=2df6b03ac511c4b333021bea6f3ed322174ec4e1;hb=4176dc3ee603f4b13c27d4267f8acbec3bf8f851;hp=8571a2fa36d26b12c3368f61dff5532f25ba4d08;hpb=aaf4228b14eaaaf1d8510ed9e46c373fd41092b3;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 8571a2fa..2df6b03a 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -504,7 +504,18 @@ sub normal # broadcast_ak1a(pc19($dxchan, $node), $dxchan, $self) unless $dxchan->{isolate}; } - return unless $node; # ignore if havn't seen a PC19 for this one yet + if ($field[1] eq $main::mycall || $field[2] eq $main::mycall) { + dbg('chan', "LOOP: trying to alter config on this node from outside!"); + return; + } + if ($field[2] eq $main::myalias && DXChannel->get($field[1])) { + dbg('chan', "LOOP: trying to connect sysop from outside!"); + return; + } + unless ($node) { + dbg('chan', "Node $field[1] not in config"); + return; + } unless ($node->isa('DXNode')) { dbg('chan', "$field[1] is not a node"); return; @@ -528,7 +539,7 @@ sub normal dbg('chan', "LOOP: $call is a node"); next; } - my $rcall = $ref->call; + my $rcall = $ref->mynode->call; dbg('chan', "LOOP: already have $call on $rcall"); next; } @@ -561,7 +572,18 @@ sub normal dbg('chan', "$field[2] no PC19 yet, autovivified as node"); # broadcast_ak1a(pc19($dxchan, $node), $dxchan, $self) unless $dxchan->{isolate}; } - return unless $node; + if ($field[1] eq $main::mycall || $field[2] eq $main::mycall) { + dbg('chan', "LOOP: trying to alter config on this node from outside!"); + return; + } + if ($field[1] eq $main::myalias && DXChannel->get($field[1])) { + dbg('chan', "LOOP: trying to disconnect sysop from outside!"); + return; + } + unless ($node) { + dbg('chan', "Node $field[2] not in config"); + return; + } unless ($node->isa('DXNode')) { dbg('chan', "LOOP: $field[2] is not a node"); return; @@ -579,6 +601,7 @@ sub normal $ref->del; } else { dbg('chan', "$field[1] not known" ); + return; } last SWITCH; } @@ -621,7 +644,8 @@ sub normal dbg('chan', "LOOP: $call come in on wrong channel"); next; } - dbg('chan', "already have $call"); + my $rcall = $node->mynode->call; + dbg('chan', "already have $call on $rcall"); next; } @@ -693,6 +717,9 @@ sub normal dbg('chan', "$call not in table, dropped"); return; } + } else { + dbg('chan', "I WILL NOT be disconnected!"); + return; } last SWITCH; } @@ -859,18 +886,17 @@ sub normal } if ($pcno == 39) { # incoming disconnect - $self->disconnect(1); + if ($field[1] eq $self->{call}) { + $self->disconnect(1); + } else { + dbg('chan', "LOOP: came in on wrong channel"); + } return; } if ($pcno == 41) { # user info # add this station to the user database, if required my $user = DXUser->get_current($field[1]); - if (!$user) { - # then try without an SSID - $field[1] =~ s/-\d+$//o; - $user = DXUser->get_current($field[1]); - } $user = DXUser->new($field[1]) if !$user; if ($field[2] == 1) {