projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix an ordering problem with node checking
[spider.git]
/
perl
/
DXProt.pm
diff --git
a/perl/DXProt.pm
b/perl/DXProt.pm
index e6380b563e6bc5188a640249c9d7800bc8716d76..d6a81ec4328ff0e4d8db67eda6010474df64bca2 100644
(file)
--- a/
perl/DXProt.pm
+++ b/
perl/DXProt.pm
@@
-578,6
+578,11
@@
sub normal
if ($pcno == 16) { # add a user
if ($pcno == 16) { # add a user
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC16 detected") if isdbg('chanerr');
+ return;
+ }
+
# general checks
my $dxchan;
my $ncall = $field[1];
# general checks
my $dxchan;
my $ncall = $field[1];
@@
-587,17
+592,17
@@
sub normal
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
- $dxchan = DXChannel->get($ncall);
- if ($dxchan && $dxchan ne $self) {
- dbg("PCPROT: PC16 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
- return;
- }
my $parent = Route::Node::get($ncall);
unless ($parent) {
dbg("PCPROT: Node $ncall not in config") if isdbg('chanerr');
return;
}
my $parent = Route::Node::get($ncall);
unless ($parent) {
dbg("PCPROT: Node $ncall not in config") if isdbg('chanerr');
return;
}
-
+ $dxchan = $parent->dxchan;
+ if ($dxchan && $dxchan ne $self) {
+ dbg("PCPROT: PC16 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
+ return;
+ }
+
# input filter if required
return unless $self->in_filter_route($parent);
# input filter if required
return unless $self->in_filter_route($parent);
@@
-642,11
+647,6
@@
sub normal
$user->lastin($main::systime) unless DXChannel->get($call);
$user->put;
}
$user->lastin($main::systime) unless DXChannel->get($call);
$user->put;
}
-
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC16 detected") if isdbg('chanerr');
- return;
- }
# queue up any messages (look for privates only)
DXMsg::queue_msg(1) if $self->state eq 'normal';
# queue up any messages (look for privates only)
DXMsg::queue_msg(1) if $self->state eq 'normal';
@@
-660,17
+660,17
@@
sub normal
my $ncall = $field[2];
my $ucall = $field[1];
my $ncall = $field[2];
my $ucall = $field[1];
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC17 detected") if isdbg('chanerr');
+ return;
+ }
+
eph_del_regex("^PC16.*$ncall.*$ucall");
if ($ncall eq $main::mycall) {
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
eph_del_regex("^PC16.*$ncall.*$ucall");
if ($ncall eq $main::mycall) {
dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
return;
}
- $dxchan = DXChannel->get($ncall);
- if ($dxchan && $dxchan ne $self) {
- dbg("PCPROT: PC17 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
- return;
- }
my $uref = Route::User::get($ucall);
unless ($uref) {
my $uref = Route::User::get($ucall);
unless ($uref) {
@@
-683,16
+683,17
@@
sub normal
return;
}
return;
}
+ $dxchan = $parent->dxchan;
+ if ($dxchan && $dxchan ne $self) {
+ dbg("PCPROT: PC17 from $self->{call} trying to alter locally connected $ncall, ignored!") if isdbg('chanerr');
+ return;
+ }
+
# input filter if required
return unless $self->in_filter_route($parent);
my @rout = $parent->del_user($uref);
# input filter if required
return unless $self->in_filter_route($parent);
my @rout = $parent->del_user($uref);
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC17 detected") if isdbg('chanerr');
- return;
- }
-
$self->route_pc17($parent, @rout) if @rout;
return;
}
$self->route_pc17($parent, @rout) if @rout;
return;
}
@@
-713,6
+714,11
@@
sub normal
my $i;
my $newline = "PC19^";
my $i;
my $newline = "PC19^";
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC19 detected") if isdbg('chanerr');
+ return;
+ }
+
# new routing list
my @rout;
my $parent = Route::Node::get($self->{call});
# new routing list
my @rout;
my $parent = Route::Node::get($self->{call});
@@
-789,10
+795,6
@@
sub normal
$user->put;
}
$user->put;
}
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC19 detected") if isdbg('chanerr');
- return;
- }
$self->route_pc19(@rout) if @rout;
return;
$self->route_pc19(@rout) if @rout;
return;
@@
-809,6
+811,11
@@
sub normal
if ($pcno == 21) { # delete a cluster from the list
my $call = uc $field[1];
if ($pcno == 21) { # delete a cluster from the list
my $call = uc $field[1];
+ if (eph_dup($line)) {
+ dbg("PCPROT: dup PC21 detected") if isdbg('chanerr');
+ return;
+ }
+
eph_del_regex("^PC1[79].*$call");
my @rout;
eph_del_regex("^PC1[79].*$call");
my @rout;
@@
-818,14
+825,21
@@
sub normal
$self->disconnect;
return;
}
$self->disconnect;
return;
}
- my $node = Route::Node::get($call);
if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
if ($call eq $self->{call}) {
dbg("PCPROT: Trying to disconnect myself with PC21") if isdbg('chanerr');
return;
}
if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
if ($call eq $self->{call}) {
dbg("PCPROT: Trying to disconnect myself with PC21") if isdbg('chanerr');
return;
}
+ my $node = Route::Node::get($call);
if ($node) {
if ($node) {
+
+ my $dxchan = $node->dxchan;
+ if ($dxchan && $dxchan ne $self) {
+ dbg("PCPROT: PC21 from $self->{call} trying to alter locally connected $call, ignored!") if isdbg('chanerr');
+ return;
+ }
+
# input filter it
return unless $self->in_filter_route($node);
# input filter it
return unless $self->in_filter_route($node);
@@
-837,11
+851,6
@@
sub normal
return;
}
return;
}
- if (eph_dup($line)) {
- dbg("PCPROT: dup PC21 detected") if isdbg('chanerr');
- return;
- }
-
$self->route_pc21(@rout) if @rout;
return;
}
$self->route_pc21(@rout) if @rout;
return;
}