From ced9c30127ffb6abc0eb38506fcff26e91d27a6a Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Sun, 15 Sep 2013 15:58:32 +0200 Subject: Fix: kernel learned qualities < configured worst_qual. First compute the node quality by remotely reported quality * best_quality) + 128) / 256; (the well known algorithm) and afterwards verify if it's < worst_qual. Signed-off-by: Thomas Osterried --- netrom/netromr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'netrom') diff --git a/netrom/netromr.c b/netrom/netromr.c index 9ed716f..9c1f17e 100644 --- a/netrom/netromr.c +++ b/netrom/netromr.c @@ -106,14 +106,14 @@ static int add_node(int s, unsigned char *buffer, struct nr_route_struct *nr_nod return FALSE; } - if (best_quality < port_list[index].worst_qual) { + nr_node->quality = ((quality * best_quality) + 128) / 256; + + if (nr_node->quality < port_list[index].worst_qual) { if (debug && logging) syslog(LOG_DEBUG, "netromr: add_node: quality less than worst_qual"); return FALSE; } - nr_node->quality = ((quality * best_quality) + 128) / 256; - /* log this only when logging verbosely */ if (debug > 1 && logging) { syslog(LOG_DEBUG, "Node update: %s:%s", -- cgit v1.2.3