# HG changeset patch # User Carl Byington # Date 1211258745 25200 # Node ID bb3f804f13a0c3663318192c86fe10802f12e067 # Parent 47f787af96c13a9f2e450c469c4dca14ab950b62 add random unsynchronization to hourly timer, trust prefix only for same origin AS, ignore self adjacency diff -r 47f787af96c1 -r bb3f804f13a0 src/routeconfig.cpp --- a/src/routeconfig.cpp Tue May 13 15:46:53 2008 -0700 +++ b/src/routeconfig.cpp Mon May 19 21:45:45 2008 -0700 @@ -66,6 +66,7 @@ uint32_t prefix() const { return prefix_value; }; bool active() const { return announced; }; adjacent aspair(int i) const { return adjacent(path[i], path[i+1]); }; + bool selfpair(int i) const { return (path[1] == path[i+1]); }; bool empty() const { return !announced && origin_history.empty(); }; void update_history(a_set &adj_set); suspicion suspicious(a_history &adj_history, bool debug = false, int prefix_length = 0, uint32_t ip = 0); @@ -167,7 +168,9 @@ void route_prefix::add_route(aspath path_, a_history &adj_history) { suspicion s = suspicious(adj_history); - trusted = announced && (s == suspicious_none); + int oldorig = path.empty() ? 0 : path [path.size() - 1]; + int neworig = path_.empty() ? 0 : path_[path_.size() - 1]; + trusted = announced && (s == suspicious_none) && (oldorig == neworig); announced = true; path = path_; } @@ -226,7 +229,7 @@ } // update current adjacency set for (int k=0; k