1. 21 Feb, 2017 1 commit
    • Ralf Baechle's avatar
      Fix incorrect ARP output · 479bb4a7
      Ralf Baechle authored
      arp(8) obtains the information it prints the old way from /proc/net/arp
      which for incomplete ARP entries contains no HW address such as in the
      following example:
      
      IP address       HW type     Flags       HW address            Mask     Device
      192.168.122.99   0x1         0x0         00:00:00:00:00:00     *        ens3
      192.168.122.98   0x1         0x0         00:00:00:00:00:00     *        ens3
      192.168.122.1    0x1         0x2         52:54:00:00:5d:5f     *        ens3
      172.20.1.99      0x3         0x0              *        bpq0
      10.0.0.2         0x1         0x0         00:00:00:00:00:00     *        ens7
      
      This means the scanf call will incorrectly scan the * character for the
      HW address, the device (bpq0 in above example) for the mask and nothing
      for the device, that is the last scanf'ed device name or "-" if non has
      been read before, will be used resulting in the following incorrect output
      for 172.20.1.99:
      
      Address                  HWtype  HWaddress           Flags Mask            Iface
      [...]
      172.20.1.99                      (incomplete)                              ens3
      
      Fixed by calling scanf a 2nd time if we notice that the first time around
      only 5 elements were read.
      
      Arguably this is a kernel bug caused by the silly attempt of printing a
      MAC address that consists of only blanks for incomplete ARP entries of
      HW type 0x3 but it exists for so long that it virtually has become part of
      the API so this just tries to live with it.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      479bb4a7
  2. 21 Jan, 2017 3 commits
    • Ralf Baechle's avatar
      Fix conversion of some ROSE addresses. · b4f51826
      Ralf Baechle authored
      The ROSE code is using %02x for conversion of the BCD encoded ROSE
      address to ASCII resulting in
      
        # ifconfig rose0 hw rose 0123456789
        # ifconfig rose0
        rose0: flags=128<NOARP>  mtu 249
                rose 01234567ff  txqueuelen 1  (AMPR ROSE)
                RX packets 0  bytes 0 (0.0 B)
                RX errors 0  dropped 0  overruns 0  frame 0
                TX packets 0  bytes 0 (0.0 B)
                TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      
      This is due to the stdio %02x conversion doesn't as the code seems o
      expect truncate the converted output to two rightmost digits as illustrated
      by this little test case:
      
        #include <stdio.h>
      
        static char array[] = { 0x88 };
      
        int main(int argc, char *argv[])
        {
                printf("%02hx\n", array[0]);
      
                return 0;
        }
      
      Fixed by replacing the use of %02x with %02hhx.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      b4f51826
    • Ralf Baechle's avatar
      Update all instances of my email address. · 80765331
      Ralf Baechle authored
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      80765331
    • Ralf Baechle's avatar
      AX.25: Rename all references to axattach to kissattach. · bfbadfcc
      Ralf Baechle authored
      Axattach has been renamed to kissattach early in the history of the
      ax25-utils package which itself has been superseeded by libax25,
      ax25-tools and ax25-apps but stale referenes have remained.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      bfbadfcc
  3. 16 Nov, 2016 2 commits
  4. 15 Nov, 2016 1 commit
  5. 10 Nov, 2016 1 commit
    • Mike Frysinger's avatar
      iptunnel: drop netinet/ip.h include · 45d573a8
      Mike Frysinger authored
      The only reason we include this header is to get the IP_DF define.
      However, we already have a local #define fallback in case that isn't
      already defined for us.
      
      Including this header while also including linux/if_tunnel.h causes
      problems with newer Linux headers (v4.8+):
      cc -O2 -g -Wall -fno-strict-aliasing  -D_GNU_SOURCE \
      	-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
      	-I. -I/usr/local/src/net-tools/include -Ilib -c iptunnel.c
      In file included from /usr/include/linux/if_tunnel.h:6:0,
                       from iptunnel.c:34:
      /usr/include/linux/ip.h:85:8: error: redefinition of 'struct iphdr'
       struct iphdr {
              ^
      In file included from iptunnel.c:29:0:
      /usr/include/netinet/ip.h:44:8: note: originally defined here
       struct iphdr
              ^
      
      Changing netinet/ip.h to linux/ip.h won't help because it doesn't
      provide IP_DF or anything else we care about.  Simply drop the header
      to avoid the build failure.
      Reported-by: default avatarRandy MacLeod <randy.macleod@windriver.com>
      45d573a8
  6. 10 Jul, 2016 1 commit
  7. 15 Feb, 2016 5 commits
  8. 13 Feb, 2016 2 commits
  9. 27 Jan, 2016 1 commit
  10. 12 Jan, 2016 1 commit
  11. 24 Nov, 2015 5 commits
    • Mike Frysinger's avatar
      hostname: -s: do not look up details via dns · 452f8e2e
      Mike Frysinger authored
      This changes the hostname behavior to match other systems and its own
      documentation.  Namely, that -s just parses the result of the active
      gethostname() and does not attempt any network/DNS traffic.  Other
      distros like Fedora/RedHat and Debian/Ubuntu have also changed their
      behavior in this regard.
      
      URL: https://bugzilla.redhat.com/319981
      URL: https://bugzilla.redhat.com/531702
      URL: https://bugs.debian.org/552482
      URL: https://bugs.gentoo.org/515836
      452f8e2e
    • Mike Frysinger's avatar
      po: delete duplicate translations · 8e9db22b
      Mike Frysinger authored
      After the typo fixes, some of the translations were duplicated leading
      to errors during message generation.
      8e9db22b
    • Felix Kaiser's avatar
      statistics: fix multiple typos in strings · 614e15d6
      Felix Kaiser authored
      614e15d6
    • Mike Frysinger's avatar
      use sockaddr_storage everywhere · 5c9e1e76
      Mike Frysinger authored
      Not all sockaddr structs have the same alignment.  Instead, it depends
      on the fields contained in it.  The way net-tools has written things
      though, it accepts sockaddr* everywhere which has 16bit alignment, even
      though it will cast it to other sockaddr types that have higher alignment.
      For example, `route` can crash on alpha because it declares sockaddr on
      the stack, but then casts it up to sockaddr_in6 (which has 32bits).
      
      It's also bad storage wise as we might try to cast the sockaddr to a type
      that is larger than sockaddr which means clobbering the stack.
      
      Instead, lets rewrite all the APIs to take a sockaddr_storage.  This is
      guaranteed to have both the maximum alignment and size requirements for
      all other sockaddr types.  Now we can safely cast that pointer to any
      other sockaddr type and not worry about it.  It also has the nice effect
      of deleting a lot of casts in a lot of places when we only need the type
      of family.
      
      The vast majority of changes here are mechanical.  There are a few places
      where we have to memcpy between a dedicated sockaddr_storage and a smaller
      struct because we're using an external embedded type (like arpreq).
      
      URL: https://bugs.gentoo.org/558436
      5c9e1e76
    • Mike Frysinger's avatar
      netstat: convert to sockaddr_storage · 27e4308d
      Mike Frysinger authored
      Rather than use different sockaddr base types for storage, always
      start with sockaddr_storage on the stack and set up pointers to
      more limited versions to that.  This way we always get the correct
      alignment and storage when we pass it down to lower layers.
      
      This is really just a set up for a follow up change to convert the
      codebase entirely to sockaddr_storage.  This is just a fairly self
      contained change.
      27e4308d
  12. 24 Oct, 2015 1 commit
  13. 29 Aug, 2015 10 commits
  14. 26 Aug, 2015 6 commits