1
0

patch-src_tcptable_c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- iptraf-3.0.1.orig/src/tcptable.c 2005-09-13 08:42:54.000000000 +0200
  3. +++ iptraf-3.0.1/src/tcptable.c 2013-03-04 11:38:22.000000000 +0100
  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,14 +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. }
  38. if (tableentry->smacaddr[0] != '\0') {