patch-src_tcptable_c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- iptraf-3.0.0.orig/src/tcptable.c 2005-09-13 08:42:54.000000000 +0200
  3. +++ iptraf-3.0.0/src/tcptable.c 2009-05-21 23:07:02.000000000 +0200
  4. @@ -17,6 +17,7 @@ details.
  5. ***/
  6. +#include <stdlib.h>
  7. #include <winops.h>
  8. #include "options.h"
  9. #include "tcptable.h"
  10. @@ -143,7 +144,7 @@ int add_tcp_hash_entry(struct tcptable *
  11. entry->daddr.s_addr, entry->dport, entry->ifname);
  12. ptmp = malloc(sizeof(struct tcp_hashentry));
  13. - bzero(ptmp, sizeof(struct tcp_hashentry));
  14. + memset(ptmp, 0, sizeof(struct tcp_hashentry));
  15. if (ptmp == NULL)
  16. return 1;
  17. @@ -337,8 +338,8 @@ struct tcptableent *addentry(struct tcpt
  18. * Zero out MAC address fields
  19. */
  20. - bzero(new_entry->smacaddr, 15);
  21. - bzero(new_entry->oth_connection->smacaddr, 15);
  22. + memset(new_entry->smacaddr, 0, 15);
  23. + memset(new_entry->oth_connection->smacaddr, 0, 15);
  24. /*
  25. * Set raw port numbers
  26. @@ -596,12 +597,10 @@ void updateentry(struct tcptable *table,
  27. tableentry->spanbr += bcount;
  28. if (opts->mac) {
  29. - bzero(newmacaddr, 15);
  30. + memset(newmacaddr, 0, 15);
  31. if ((linkproto == LINK_ETHERNET) || (linkproto == LINK_PLIP)) {
  32. convmacaddr(((struct ethhdr *) packet)->h_source, newmacaddr);
  33. - } else if (linkproto == LINK_FDDI) {
  34. - convmacaddr(((struct fddihdr *) packet)->saddr, newmacaddr);
  35. } else if (linkproto == LINK_TR) {
  36. convmacaddr(((struct trh_hdr *) packet)->saddr, newmacaddr);
  37. }