force a disconnect down all other interfaces if a node connects directly
authorminima <minima>
Wed, 17 Jan 2007 00:22:01 +0000 (00:22 +0000)
committerminima <minima>
Wed, 17 Jan 2007 00:22:01 +0000 (00:22 +0000)
thus (hopefully) clearing out the old inflated number of users with the
real data direct from the node.

Changes
perl/DXProt.pm
perl/Route/Node.pm

diff --git a/Changes b/Changes
index b8f6df82bc1b538d09f35c5c056a076f743aaf98..f4bc2d823f6e64722718a259d6d21dd1ff5c173a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+16Jan06=======================================================================
+1. back ported a change to PC16 handling so that a locally connected node's
+info clears out and generally overrides any residual PC16 info gathered from
+elsewhere.
 15Jan06=======================================================================
 1. added CTY-1701
 07Jan06=======================================================================
index 41c38f1aea9fd62a850934ee882fccd79fadc265..7a9e4ca15f108f0374fdcee54eb91d856082584b 100644 (file)
@@ -235,6 +235,14 @@ sub new
        # add this node to the table, the values get filled in later
        my $pkg = shift;
        my $call = shift;
+
+       # if we have an entry already, then send a PC21 to all connect
+       # old style connections, because we are about to get the real deal
+       if (my $ref = Route::Node::get($call)) {
+               dbg("ROUTE: $call is already in the routing table, deleting") if isdbg('route');
+               my @rout = $ref->delete;
+               $self->route_pc21($main::mycall, undef, @rout) if @rout;
+       }
        $main::routeroot->add($call, '5000', Route::here(1)) if $call ne $main::mycall;
 
        return $self;
@@ -739,7 +747,11 @@ sub handle_16
        }
        # is it me?
        if ($ncall eq $main::mycall) {
-               dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr');
+               dbg("PCPROT: trying to alter my config from outside!") if isdbg('chanerr');
+               return;
+       }
+       if (DXChannel::get($ncall) && $ncall ne $self->{call}) {
+               dbg("PCPROT: trying to alter locally connected $ncall from $self->{call}, ignored") if isdbg('chanerr');
                return;
        }
 
index d3b1e955411833567a8b2551c55e19d1616b4136..78cd05e4b7a2360a41228897f2bf4e8fa1382147 100644 (file)
@@ -111,6 +111,21 @@ sub del
        return @nodes;
 }
 
+# this deletes this node completely by grabbing the parents
+# and deleting me from them
+sub delete
+{
+       my $self = shift;
+       my @out;
+       
+       $self->_del_users;
+       foreach my $call (@{$self->{parent}}) {
+               my $parent = Route::Node::get($call);
+               push @out, $parent->del($self) if $parent;
+       }
+       return @out;
+}
+
 sub del_nodes
 {
        my $parent = shift;