From 9f629dbb432d8918fc75537614a8c2df51123343 Mon Sep 17 00:00:00 2001 From: Neil McKee Date: Tue, 11 Jan 2022 15:11:46 -0800 Subject: [PATCH] agent= now only adjusts priority --- src/Linux/hsflowconfig.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Linux/hsflowconfig.c b/src/Linux/hsflowconfig.c index 6865156..903b698 100644 --- a/src/Linux/hsflowconfig.c +++ b/src/Linux/hsflowconfig.c @@ -1077,14 +1077,19 @@ extern "C" { static bool priorityHigher(HSP *sp, HSPLocalIP *localIP, HSPLocalIP *challenger, char *dev) { - if(dev - && !my_strequal(dev, challenger->dev)) - return NO; if(localIP == NULL) return YES; - if(challenger->ipPriority < localIP->ipPriority) + int pri_local = localIP->ipPriority; + int pri_challenge = challenger->ipPriority; + if(dev) { + if(my_strequal(dev, challenger->dev)) + pri_challenge += IPSP_NUM_PRIORITIES; + if(my_strequal(dev, localIP->dev)) + pri_local += IPSP_NUM_PRIORITIES; + } + if(pri_challenge < pri_local) return NO; - if(challenger->ipPriority > localIP->ipPriority) + if(pri_challenge > pri_local) return YES; SFLAdaptor *adaptor1 = adaptorByName(sp, localIP->dev); if(adaptor1 == NULL)