• Jakub Kicinski's avatar
    net: ethtool: don't require empty header nests · 500e1340
    Jakub Kicinski authored
    
    
    Ethtool currently requires a header nest (which is used to carry
    the common family options) in all requests including dumps.
    
      $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get
      lib.ynl.NlError: Netlink error: Invalid argument
      nl_len = 64 (48) nl_flags = 0x300 nl_type = 2
    	error: -22      extack: {'msg': 'request header missing'}
    
      $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get \
               --json '{"header":{}}';  )
      [{'combined-count': 1,
        'combined-max': 1,
        'header': {'dev-index': 2, 'dev-name': 'enp1s0'}}]
    
    Requiring the header nest to always be there may seem nice
    from the consistency perspective, but it's not serving any
    practical purpose. We shouldn't burden the user like this.
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    500e1340
netlink.c 33.5 KB