patch-src_nfprobe_plugin_netflow9_c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --- pmacct-0.12.2.orig/src/nfprobe_plugin/netflow9.c 2010-04-21 16:53:36.000000000 +0200
  2. +++ pmacct-0.12.2/src/nfprobe_plugin/netflow9.c 2010-07-15 15:11:23.575859230 +0200
  3. @@ -396,8 +396,8 @@ nf9_init_template(void)
  4. */
  5. rcount = 0;
  6. - bzero(&v4_template, sizeof(v4_template));
  7. - bzero(&v4_int_template, sizeof(v4_int_template));
  8. + memset(&v4_template, 0, sizeof(v4_template));
  9. + memset(&v4_int_template, 0, sizeof(v4_int_template));
  10. v4_template.r[rcount].type = htons(NF9_LAST_SWITCHED);
  11. v4_template.r[rcount].length = htons(4);
  12. @@ -588,8 +588,8 @@ nf9_init_template(void)
  13. v4_int_template.tot_rec_len += v4_int_template.r[idx].length;
  14. rcount = 0;
  15. - bzero(&v6_template, sizeof(v6_template));
  16. - bzero(&v6_int_template, sizeof(v6_int_template));
  17. + memset(&v6_template, 0, sizeof(v6_template));
  18. + memset(&v6_int_template, 0, sizeof(v6_int_template));
  19. v6_template.r[rcount].type = htons(NF9_LAST_SWITCHED);
  20. v6_template.r[rcount].length = htons(4);
  21. @@ -786,8 +786,8 @@ nf9_init_options_template(void)
  22. int rcount, idx;
  23. rcount = 0;
  24. - bzero(&options_template, sizeof(options_template));
  25. - bzero(&options_int_template, sizeof(options_int_template));
  26. + memset(&options_template, 0, sizeof(options_template));
  27. + memset(&options_int_template, 0, sizeof(options_int_template));
  28. options_template.r[rcount].type = htons(NF9_OPT_SCOPE_SYSTEM);
  29. options_template.r[rcount].length = htons(0);
  30. @@ -826,8 +826,8 @@ nf_flow_to_flowset(const struct FLOW *fl
  31. char *ftoft_ptr_0 = ftoft_buf_0;
  32. char *ftoft_ptr_1 = ftoft_buf_1;
  33. - bzero(ftoft_buf_0, sizeof(ftoft_buf_0));
  34. - bzero(ftoft_buf_1, sizeof(ftoft_buf_1));
  35. + memset(ftoft_buf_0, 0, sizeof(ftoft_buf_0));
  36. + memset(ftoft_buf_1, 0, sizeof(ftoft_buf_1));
  37. *len_used = nflows = ret_len = 0;
  38. rec32 = htonl(timeval_sub_ms(&flow->flow_last, system_boot_time));
  39. @@ -916,7 +916,7 @@ nf_options_to_flowset(u_char *packet, u_
  40. u_int8_t rec8;
  41. char *ftoft_ptr_0 = ftoft_buf_0;
  42. - bzero(ftoft_buf_0, sizeof(ftoft_buf_0));
  43. + memset(ftoft_buf_0, 0, sizeof(ftoft_buf_0));
  44. *len_used = nflows = ret_len = 0;
  45. rec8 = 1; /* NF9_FLOW_SAMPLER_ID */
  46. @@ -975,7 +975,7 @@ send_netflow_v9(struct FLOW **flows, int
  47. last_valid = num_packets = 0;
  48. for (j = 0; j < num_flows;) {
  49. - bzero(packet, sizeof(packet));
  50. + memset(packet, 0, sizeof(packet));
  51. nf9 = (struct NF9_HEADER *)packet;
  52. nf9->version = htons(9);