Skip to content
  • Thomas Haller's avatar
    libnm/team: strict validate team settings by libnm clients not sending the JSON · 8ea5fddf
    Thomas Haller authored
    When parsing a NMSettingTeam/NMSettingTeamPort from GVariant, the JSON
    "config" is always preferred. If that field is present, all other
    attributes are ignored (aside from validating that the individual fields
    are as expected).
    
    The idea is that the JSON config anyway must contain everything that artificial
    properties could. In this mode, also no validation is performed and the setting is
    always accepted (regardless whether libnm thinks the setting verifies).
    
    When a libnm client created the setting via the artificial properties,
    only send them via D-Bus and exclude the JSON config. This turns on
    strict validation server side.
    
    Now we actually get validation of the settings:
    
      $ nmcli connection add type team team.runner-tx-hash l3
      Error: Failed to add 'team' connection: team.runner: runner-tx-hash is only allowed for runners loadbalance,lacp
    
    this is obviously a change in behavior as previously all settings
    would have been accepted, regardless whether they made sense.
    8ea5fddf