1. 13 Aug, 2018 2 commits
  2. 08 Aug, 2018 2 commits
  3. 27 Jul, 2018 2 commits
  4. 23 Jul, 2018 3 commits
  5. 19 Jul, 2018 1 commit
    • Jesus Sanchez-Palencia's avatar
      tc: Do not use addattr_nest_compat on mqprio and netem · b625e361
      Jesus Sanchez-Palencia authored
      Here we are partially reverting commit c14f9d92
      "treewide: Use addattr_nest()/addattr_nest_end() to handle nested
      attributes" .
      
      As discussed in [1], changing from the 'manually' coded version that
      used addattr_l() to addattr_nest_compat() wasn't functionally
      equivalent, because now the messages have extra fields appended to it.
      
      This introduced a regression since the implementation of parse_attr()
      from both mqprio and netem can't handle this new message format.
      
      Without this fix, mqprio returns an error. netem won't return an error
      but its internal configuration ends up wrong.
      
      As an example, this can be reproduced by the following commands when
      this patch is not applied:
      
       1) mqprio
      $ tc qdisc replace dev enp3s0 parent root handle 100 mqprio \
      	num_tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
      	queues 1@0 1@1 2@2 hw 0
      
      RTNETLINK answers: Numerical result out of range
      
       2) netem
      $ tc qdisc add dev enp3s0 root netem rate 5kbit 20 100 5 \
      	distribution normal latency 1 1
      
      $ tc -s qdisc
      
      (...)
      qdisc netem 8001: dev enp3s0 root refcnt 9 limit 1000 delay 0us  0us
       Sent 402 bytes 1 pkt (dropped 0, overlimits 0 requeues 0)
       backlog 0b 0p requeues 0
      (...)
      
      With this patch applied, the tc -s qdisc command above for netem instead
      reads:
      
      (...)
      qdisc netem 8002: dev enp3s0 root refcnt 9 limit 1000 delay 0us  0us \
      	rate 5Kbit packetoverhead 20 cellsize 100 celloverhead 5
       Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
       backlog 0b 0p requeues 0
      (...)
      
      [1] https://patchwork.ozlabs.org/patch/867860/#1893405
      
      Fixes: c14f9d92 ("treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes")
      Reported-by: 's avatarVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: 's avatarJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
      Signed-off-by: 's avatarStephen Hemminger <stephen@networkplumber.org>
      b625e361
  6. 18 Jul, 2018 2 commits
    • Mathieu Xhonneux's avatar
      ip: add support for seg6local End.BPF action · 04cb3c0d
      Mathieu Xhonneux authored
      This patch adds support for the End.BPF action of the seg6local
      lightweight tunnel. Functions from the BPF lightweight tunnel are
      re-used in this patch. Example:
      
      $ ip -6 route add fc00::18 encap seg6local action End.BPF endpoint
      obj my_bpf.o sec my_func dev eth0
      
      $ ip -6 route show fc00::18
      fc00::18  encap seg6local action End.BPF endpoint my_bpf.o:[my_func]
      dev eth0 metric 1024 pref medium
      
      v2: - re-use of print_encap_bpf_prog instead of fprintf
          - introduction of "endpoint" keyword for more consistency with
            others parameters
      Signed-off-by: 's avatarMathieu Xhonneux <m.xhonneux@gmail.com>
      Signed-off-by: 's avatarStephen Hemminger <stephen@networkplumber.org>
      04cb3c0d
    • Serhey Popovych's avatar
      ipaddress: Fix and make consistent label match handling · 8df708af
      Serhey Popovych authored
      Since commit 95168230 ("ipaddress: Improve print_linkinfo()") we
      return -1 instead of 0 when ip-address(8) label does not match network
      device name as we did before change. This causes regression when trying
      to output ip address matching label:
      
           # ip addr add 192.168.192.1/24 dev lo label lo:1
           # ip addr show label lo:1
           <no output>
      
      This is special case and return 0 from print_linkinfo() earlier to match
      only filter.ifindex and filter.up if given, but not rest fields in
      @filter. Then call print_selected_addrinfo() without calling
      print_link_stats() in ipaddr_list_flush_or_save().
      
      Later print_selected_addrinfo() calls print_addrinfo() that finally
      matches IFA_LABEL attribute in netlink buffer with filter.label using
      ifa_label_match_rta().
      
      On the other hand there is three conditions checked in print_linkinfo()
      to determine label special case:
      
          1) filter.label != NULL
          2) filter.family == AF_UNSPEC || filter.family == AF_PACKET
          3) fnmatch(filter.label, name, 0)
      
      With 1) it is ok to check if filtering by label is on by given pattern
      in @filter.label.
      
      Since label is IPv4 specific and AF_PACKET is for printing ip-link(8)
      information (see ipaddr_link_list()::ipaddress.c as example) checking
      for AF_PACKET in 2) doesn't take much sense: better to defer these
      checks to print_addrinfo() determine valid combinations before calling
      ifa_label_match_rta() to finally match IFA_LABEL to pattern in
      filter.label.
      
      For 3) we have following call for test case:
      
          fnmatch(pattern, string, flags) ->
            fnmatch(filter.label, name, 0) ->
              fnmatch("lo:1", "lo", 0) == FNM_NOMATCH (1) or non-zero on error
      
      To support special case in print_linkinfo() for filtering by label we
      only need to check if label pattern is given in filter.label and return
      0 to skip print_link_stats() in ipaddr_list_flush_or_save(): actual
      filtering will be done in print_addrinfo().
      
      Before commit 95168230 ("ipaddress: Improve print_linkinfo()"):
      -------------------------------------------------------------------
      
      $ ip addr sh label lo
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN \
      group default qlen 1000
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                fnmatch("lo", "lo", 0) == 0
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host
             valid_lft forever preferred_lft forever
      $ ip addr show label 'lo:*'
          inet 192.168.192.1/24 scope global lo:1
             valid_lft forever preferred_lft forever
      $ ip addr sh label lo:1
          inet 192.168.192.1/24 scope global lo:1
             valid_lft forever preferred_lft forever
      $ ip -4 addr sh label lo:1
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN \
      group default qlen 1000
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   filter.family == AF_INET
          inet 192.168.192.1/24 scope global lo:1
             valid_lft forever preferred_lft forever
      
      After this change applied:
      --------------------------
      
      $ ip/ip addr show label lo
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host
             valid_lft forever preferred_lft forever
      $ ip/ip addr show label 'lo:*'
          inet 192.168.192.1/24 scope global lo:1
              valid_lft forever preferred_lft forever
      $ ip/ip addr show label lo:1
          inet 192.168.192.1/24 scope global lo:1
             valid_lft forever preferred_lft forever
      $ ip/ip -4 addr show label lo:1
          inet 192.168.192.1/24 scope global lo:1
             valid_lft forever preferred_lft forever
      
      Note that we no longer show link information as we did previously:
          we are filtering by "label" pattern, not showing by "dev".
      
      Fixes: commit 95168230 ("ipaddress: Improve print_linkinfo()")
      Reported-by: Vincent Bernat's avatarVincent Bernat <vincent@bernat.im>
      Signed-off-by: 's avatarSerhey Popovych <serhe.popovych@gmail.com>
      Signed-off-by: 's avatarStephen Hemminger <stephen@networkplumber.org>
      8df708af
  7. 09 Jul, 2018 1 commit
  8. 07 Jul, 2018 4 commits
  9. 20 Jun, 2018 2 commits
  10. 15 Jun, 2018 3 commits
  11. 11 Jun, 2018 1 commit
  12. 08 Jun, 2018 7 commits
  13. 05 Jun, 2018 2 commits
  14. 01 Jun, 2018 8 commits