1. 24 Jan, 2012 1 commit
  2. 21 Jan, 2012 2 commits
  3. 16 Jan, 2012 2 commits
  4. 13 Jan, 2012 6 commits
  5. 12 Jan, 2012 2 commits
  6. 06 Jan, 2012 1 commit
  7. 05 Jan, 2012 15 commits
    • Jiri Popelka's avatar
      mii-tool: don't rely on eth0 being default network device name. · 9dc3a205
      Jiri Popelka authored
      With this patch mii-tool requires interface name
      to be specified as argument.
      9dc3a205
    • Jiri Popelka's avatar
      mii-tool: use <linux/mii.h> instead of "mii.h" and fix RHBZ #491358 · faf31f80
      Jiri Popelka authored
      Using mii-tool with e1000e driver results in:
      SIOCGMIIREG on eth0 failed: Input/output error
      
      Problem is in show_basic_mii() where the loop
          for (i = 0; i < ((verbose > 1) ? 32 : MII_BASIC_MAX); i++)
              mii_val[i] = mdio_read(sock, i);
      checks all MII registers from 0x00 to 0x07 (or to 0x1F in verbose mode).
      But there's no register with 0x07 value.
      
      For more details see:
      https://bugzilla.redhat.com/show_bug.cgi?id=491358#c1
      
      Solution is to check only defined MII registers.
      
      Also the "mii.h" is actually a duplicate of <linux/mii.h>.
      faf31f80
    • Jiri Popelka's avatar
      Possible problems found by static analysis of code. · 6ccabd57
      Jiri Popelka authored
      We analyzed the net-tools-1.60 code with Coverity.
      Coverity is commercial enterprise level tool for
      static analysis (analysis based only on compiling
      of sources, not based on running of binary) of the code.
      
      This change should fix some possible problems like resource (memory,
      file descriptors) leaks.
      
      Follow respective parts of the scan log. The line
      numbers could be quite different as we analyzed Red Hat's
      heavily patched version of net-tools-1.60.
      
      Error: RESOURCE_LEAK
      ipmaddr.c:191: alloc_fn: Calling allocation function "malloc".
      ipmaddr.c:191: var_assign: Assigning: "ma" =  storage returned from "malloc(sizeof (m) /*64*/)".
      ipmaddr.c:203: overwrite_var: Overwriting "ma" in call "ma = malloc(sizeof (m) /*64*/)" leaks the storage that "ma" points to.
      
      Error: RESOURCE_LEAK
      iptunnel.c:473: alloc_fn: Calling allocation function "fopen".
      iptunnel.c:473: var_assign: Assigning: "fp" =  storage returned from "fopen("/proc/net/dev", "r")".
      iptunnel.c:488: leaked_storage: Variable "fp" going out of scope leaks the storage it points to.
      iptunnel.c:524: leaked_storage: Variable "fp" going out of scope leaks the storage it points to.
      
      Error: FORWARD_NULL
      lib/inet.c:408: var_compare_op: Comparing "item" to null implies that "item" might be null.
      lib/inet.c:410: var_deref_op: Dereferencing null variable "item".
      
      Error: RESOURCE_LEAK
      lib/masq_info.c:174: alloc_fn: Calling allocation function "malloc".
      lib/masq_info.c:174: var_assign: Assigning: "mslist" =  storage returned from "malloc(1152UL)".
      lib/masq_info.c:215: leaked_storage: Variable "mslist" going out of scope leaks the storage it points to.
      
      Error: RESOURCE_LEAK
      lib/netrom_gr.c:35: alloc_fn: Calling allocation function "fopen".
      lib/netrom_gr.c:35: var_assign: Assigning: "f1" =  storage returned from "fopen("/proc/net/nr_nodes", "r")".
      lib/netrom_gr.c:42: overwrite_var: Overwriting "f1" in call "f1 = fopen("/proc/net/nr_nodes", "r")" leaks the storage that "f1" points to.
      
      Error: RESOURCE_LEAK
      lib/netrom_gr.c:36: alloc_fn: Calling allocation function "fopen".
      lib/netrom_gr.c:36: var_assign: Assigning: "f2" =  storage returned from "fopen("/proc/net/nr_neigh", "r")".
      lib/netrom_gr.c:44: overwrite_var: Overwriting "f2" in call "f2 = fopen("/proc/net/nr_neigh", "r")" leaks the storage that "f2" points to
      
      Error: FORWARD_NULL
      lib/x25.c:101: var_compare_op: Comparing "p" to null implies that "p" might be null.
      lib/x25.c:109: var_deref_op: Dereferencing null variable "p".
      
      Error: RESOURCE_LEAK
      nameif.c:166: alloc_fn: Calling allocation function "xmalloc".
      nameif.c:166: var_assign: Assigning: "ch" =  storage returned from "xmalloc(sizeof (struct change) /*40*/)".
      nameif.c:177: leaked_storage: Variable "ch" going out of scope leaks the storage it points to.
      
      Error: NEGATIVE_RETURNS
      netstat.c:463: negative_return_fn: Function "readlink(line, lname, 29UL)" returns a negative number.
      netstat.c:463: var_assign: Assigning: signed variable "lnamelen" = "readlink".
      netstat.c:464: negative_returns: Using variable "lnamelen" as an index to array "lname".
      
      Error: RESOURCE_LEAK
      netstat.c:894: alloc_fn: Calling allocation function "fopen".
      netstat.c:894: var_assign: Assigning: "f" =  storage returned from "fopen("/proc/net/x25", "r")".
      netstat.c:905: overwrite_var: Overwriting "f" in call "f = fopen("/proc/net/x25", "r")" leaks the storage that "f" points to.
      
      Error: RESOURCE_LEAK
      netstat.c:1916: alloc_fn: Calling allocation function "fopen".
      netstat.c:1916: var_assign: Assigning: "f" =  storage returned from "fopen("/proc/net/ipx", "r")".
      netstat.c:1934: leaked_storage: Variable "f" going out of scope leaks the storage it points to.
      netstat.c:1947: leaked_storage: Variable "f" going out of scope leaks the storage it points to.
      netstat.c:1957: leaked_storage: Variable "f" going out of scope leaks the storage it points to.
      6ccabd57
    • Jiri Popelka's avatar
      plipconfig man page and usage output fixes · 0dcd1d1b
      Jiri Popelka authored
      0dcd1d1b
    • Jiri Popelka's avatar
    • Jiri Popelka's avatar
    • Jiri Popelka's avatar
      7b576887
    • Jiri Popelka's avatar
      nameif crash for long interface names (RHBZ #209120) · 1f2c75dc
      Jiri Popelka authored
      I'm not sure how to reproduce that, but the patch
      is quite straightforward.
      1f2c75dc
    • Jiri Popelka's avatar
    • Jiri Popelka's avatar
      buffer overflow in arp (RHBZ #164695) · 96b25f18
      Jiri Popelka authored
      Steps to Reproduce:
      1. arp -s 172.16.1.3 00:80:c8:04:05:06 -D eth0
      96b25f18
    • Jiri Popelka's avatar
      netstat -s reports negative octet counts · f1f89328
      Jiri Popelka authored
      (RHBZ #579854, Debian #561161)
      
      original patch from Sami Farin
      f1f89328
    • Jiri Popelka's avatar
      The return value of nameif was wrong · c8d4f437
      Jiri Popelka authored
      Steps to Reproduce:
      /sbin/nameif eth1 00:00:10:10:11:11; echo $?
      
      Actual Results:
      interface 'eth1' not found
      0
      
      Expected Results:
      interface 'eth1' not found
      1
      c8d4f437
    • Jiri Popelka's avatar
      Fix Content-Type in po files to avoid msgfmt warning. · 81d60e09
      Jiri Popelka authored
      de.po: warning: Charset "iso8859-1" is not a portable encoding name.
                      Message conversion to user's charset might not work.
      81d60e09
    • Jiri Popelka's avatar
      ca5633dd
    • Jiri Popelka's avatar
  8. 04 Jan, 2012 1 commit
  9. 31 Dec, 2011 3 commits
  10. 15 Dec, 2011 2 commits
  11. 10 Dec, 2011 3 commits
  12. 21 Nov, 2011 2 commits
    • Mike Frysinger's avatar
      netstat: unify duplicate addr pretty printing · 9cd07a6f
      Mike Frysinger authored
      The tcp/udp/raw protocols duplicate the logic for looking up addresses and
      their ports, and then formatting them nicely.  They also duplicate this for
      local and remote addresses.  They also encode a few assumptions about the
      length of the strings they get back which can cause buffer over and under
      flows.
      
      Add a new helper called addr_do_one that unifies all of this duplicate
      logic in one place, and handles any string size correctly.
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      9cd07a6f
    • Mike Frysinger's avatar
      fix integer/pointer cast warnings · 9eba3973
      Mike Frysinger authored
      On 64bit systems where sizeof(void *) != sizeof(int), we get a warning
      when trying to assign the return of atoi().  So insert a cast to avoid.
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      9eba3973