Skip to content

Commit

Permalink
agent=<device> now only adjusts priority
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Jan 11, 2022
1 parent 29af4a0 commit 9f629db
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Linux/hsflowconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9f629db

Please sign in to comment.