Skip to content
  • Niels Möller's avatar
    fbc7f408
    refactor: Clarify logic for autodetection of network interface · fbc7f408
    Niels Möller authored
    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).
    fbc7f408
    refactor: Clarify logic for autodetection of network interface
    Niels Möller authored
    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).
Loading