1. 03 Jul, 2018 1 commit
  2. 09 Jun, 2018 4 commits
  3. 08 Jun, 2018 5 commits
  4. 01 Jun, 2018 5 commits
  5. 25 May, 2018 1 commit
    • Stephen Hemminger's avatar
      ip: defer lookup interface index · 65083b5f
      Stephen Hemminger authored
      The ip command would always lookup the network device index
      even when not necessary. This slows down operations like creating
      lots of VLAN's.
      
      David reported the original issue, this is an alternative patch
      that solves it in a slightly more general method.
      
      Using iproute2 to create a bridge and add 4094 vlans to it can take from
      2 to 3 *minutes*. The reason is the extraneous call to ll_name_to_index.
      ll_name_to_index results in an ioctl(SIOCGIFINDEX) call which in turn
      invokes dev_load. If the index does not exist, which it won't when
      creating a new link, dev_load calls modprobe twice -- once for
      netdev-NAME and again for NAME. This is unnecessary overhead for each
      link create.
      
      When ip link is invoked for a new device, there is no reason to
      call ll_name_to_index for the new device. With this patch, creating
      a bridge and adding 4094 vlans takes less than 3 *seconds*.
      
      	old:
      	# time ip -batch ip-vlan.batch
      	real    3m13.727s
      	user    0m0.076s
      	sys     0m1.959s
      
      	new:
      	# time ip -batch ip-vlan.batch
      	real    0m3.222s
      	user    0m0.044s
      	sys     0m1.777s
      Reported-off-by: 's avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: 's avatarStephen Hemminger <stephen@networkplumber.org>
      65083b5f
  6. 23 May, 2018 2 commits
  7. 22 May, 2018 1 commit
  8. 18 May, 2018 1 commit
  9. 17 May, 2018 1 commit
  10. 16 May, 2018 3 commits
  11. 15 May, 2018 4 commits
  12. 11 May, 2018 1 commit
    • Luca Boccassi's avatar
      iproute2.postinst: use setcap -r instead of empty set · 5219bbc7
      Luca Boccassi authored
      Calling setcap with an empty strings does not remove the xattr, but sets
      it to an empty set, which breaks programs with ambient caps forking and
      exec'ing ip.
      Use setcap -r instead to remove the xattr if the user chooses to do so.
      
      Thanks to Mantas Mikulėnas for spotting the error!
      5219bbc7
  13. 09 May, 2018 4 commits
  14. 08 May, 2018 1 commit
  15. 03 May, 2018 2 commits
  16. 02 May, 2018 3 commits
  17. 25 Apr, 2018 1 commit
    • Toke Høiland-Jørgensen's avatar
      json_print: Fix hidden 64-bit type promotion · 4db2ff0d
      Toke Høiland-Jørgensen authored
      print_uint() will silently promote its variable type to uint64_t, but there
      is nothing that ensures that the format string specifier passed along with
      it fits (and the function name suggest to pass "%u").
      
      Fix this by changing print_uint() to use a native 'unsigned int' type, and
      introduce a separate print_u64() function for printing 64-bit values. All
      call sites that were actually printing 64-bit values using print_uint() are
      converted to use print_u64() instead.
      
      Since print_int() was already using native int types, just add a
      print_s64() to match, but don't convert any call sites. For symmetry,
      also add a print_luint() method (with no users).
      Signed-off-by: Toke Høiland-Jørgensen's avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: 's avatarStephen Hemminger <stephen@networkplumber.org>
      4db2ff0d