Skip to content

refactor: Clarify logic for autodetection of network interface

Niels Möller requested to merge nisse/clarify-autobonding-logic into main

Prior to this change, we had the condition

optInterface == "" && optAutodetect || optBondingAuto

which by precedence rules is the same as

(optInterface == "" && optAutodetect) || optBondingAuto

I think it makes more sense to write it as

optInterface == "" && (optAutodetect || optBondingAuto)

I.e., never override a non-empty optInterface.

This changes behavior only when optInterface is provided (!= "") and optBondingAuto is true (-B option). Which shouldn't happen, since from my reading of the code, optInterface can be non-empty at this point only if one of the -I, -m, or -b options are used, and those are mutually exclusive with -B (as well as with -A, controlling the optAutoDetect variable).

Merge request reports

Loading