Skip to content

Commit

Permalink
[DECNET]: Only use local routers
Browse files Browse the repository at this point in the history
The attached patch makes DECnet routing only use routers from the same
area - rather than the highest rated router seen.

In theory there should not be an out-of-area router on a local network
but some networks are bridged rather than properly routed. VMS seems
to behave similarly: if I bring up a VMS node with no router then it
can't see anything else on the global network.

Signed-off-by: Patrick Caulfield <patrick@tykepenguin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick Caulfield authored and David S. Miller committed Jan 3, 2006
1 parent 4b5bdf5 commit 5062430
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions net/decnet/dn_neigh.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,14 @@ int dn_neigh_router_hello(struct sk_buff *skb)
}
}

if (!dn_db->router) {
dn_db->router = neigh_clone(neigh);
} else {
if (msg->priority > ((struct dn_neigh *)dn_db->router)->priority)
neigh_release(xchg(&dn_db->router, neigh_clone(neigh)));
/* Only use routers in our area */
if ((dn_ntohs(src)>>10) == dn_ntohs((decnet_address)>>10)) {
if (!dn_db->router) {
dn_db->router = neigh_clone(neigh);
} else {
if (msg->priority > ((struct dn_neigh *)dn_db->router)->priority)
neigh_release(xchg(&dn_db->router, neigh_clone(neigh)));
}
}
write_unlock(&neigh->lock);
neigh_release(neigh);
Expand Down

0 comments on commit 5062430

Please sign in to comment.