You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
5.8 KiB

  1. --- a/freelist.c
  2. +++ b/freelist.c
  3. @@ -46,7 +46,7 @@ freelist_init(struct freelist *fl, size_
  4. {
  5. size_t sizeof_fl = sizeof(fl);
  6. FLOGIT((LOG_DEBUG, "%s: %s(%p, %zu)", __func__, __func__, fl, allocsz));
  7. - bzero(fl, sizeof_fl);
  8. + memset(fl, 0, sizeof_fl);
  9. fl->allocsz = roundup(allocsz, FREELIST_ALLOC_ALIGN);
  10. fl->free_entries = NULL;
  11. }
  12. --- a/ipfix.c
  13. +++ b/ipfix.c
  14. @@ -388,7 +388,7 @@ ipfix_init_template_unity (struct FLOWTR
  15. u_int8_t icmp_flag, u_int8_t bi_flag,
  16. u_int16_t version) {
  17. u_int index = 0, bi_index = 0, length = 0;
  18. - bzero (template, sizeof (*template));
  19. + memset (template, 0, sizeof (*template));
  20. template->h.c.set_id = htons (version == 10 ?
  21. IPFIX_TEMPLATE_SET_ID :
  22. NFLOW9_TEMPLATE_SET_ID);
  23. @@ -510,7 +510,7 @@ nflow9_init_option (u_int16_t ifidx, str
  24. NFLOW9_SOFTFLOWD_OPTION_TEMPLATE_NRECORDS *
  25. sizeof (struct IPFIX_FIELD_SPECIFIER);
  26. - bzero (&option_template, sizeof (option_template));
  27. + memset (&option_template, 0, sizeof (option_template));
  28. option_template.h.c.set_id = htons (NFLOW9_OPTION_TEMPLATE_SET_ID);
  29. option_template.h.c.length =
  30. htons (sizeof (option_template.h) + scope_len + opt_len);
  31. @@ -524,7 +524,7 @@ nflow9_init_option (u_int16_t ifidx, str
  32. ipfix_init_fields (option_template.r, &option_index,
  33. field_nf9option,
  34. NFLOW9_SOFTFLOWD_OPTION_TEMPLATE_NRECORDS);
  35. - bzero (&nf9opt_data, sizeof (nf9opt_data));
  36. + memset (&nf9opt_data, 0, sizeof (nf9opt_data));
  37. nf9opt_data.c.set_id = htons (IPFIX_SOFTFLOWD_OPTION_TEMPLATE_ID);
  38. nf9opt_data.c.length = htons (sizeof (nf9opt_data));
  39. nf9opt_data.scope_ifidx = htonl (ifidx);
  40. @@ -536,7 +536,7 @@ nflow9_init_option (u_int16_t ifidx, str
  41. static void
  42. ipfix_init_option (struct timeval *system_boot_time, struct OPTION *option) {
  43. u_int scope_index = 0, option_index = 0;
  44. - bzero (&option_template, sizeof (option_template));
  45. + memset (&option_template, 0, sizeof (option_template));
  46. option_template.h.c.set_id = htons (IPFIX_OPTION_TEMPLATE_SET_ID);
  47. option_template.h.c.length = htons (sizeof (option_template));
  48. option_template.h.u.i.r.template_id =
  49. @@ -553,7 +553,7 @@ ipfix_init_option (struct timeval *syste
  50. ipfix_init_fields (option_template.r, &option_index, field_option,
  51. IPFIX_SOFTFLOWD_OPTION_TEMPLATE_NRECORDS);
  52. - bzero (&option_data, sizeof (option_data));
  53. + memset (&option_data, 0, sizeof (option_data));
  54. option_data.c.set_id = htons (IPFIX_SOFTFLOWD_OPTION_TEMPLATE_ID);
  55. option_data.c.length = htons (sizeof (option_data));
  56. option_data.scope_pid = htonl ((u_int32_t) option->meteringProcessId);
  57. @@ -809,7 +809,7 @@ send_ipfix_common (struct FLOW **flows,
  58. last_valid = num_packets = 0;
  59. for (j = 0; j < num_flows;) {
  60. - bzero (packet, sizeof (packet));
  61. + memset (packet, 0, sizeof (packet));
  62. if (version == 10) {
  63. ipfix = (struct IPFIX_HEADER *) packet;
  64. ipfix->version = htons (version);
  65. --- a/netflow9.c
  66. +++ b/netflow9.c
  67. @@ -145,7 +145,7 @@ static int nf9_pkts_until_template = -1;
  68. static void
  69. nf9_init_template (void) {
  70. - bzero (&v4_template, sizeof (v4_template));
  71. + memset (&v4_template, 0, sizeof (v4_template));
  72. v4_template.h.c.flowset_id = htons (NFLOW9_TEMPLATE_SET_ID);
  73. v4_template.h.c.length = htons (sizeof (v4_template));
  74. v4_template.h.template_id = htons (NF9_SOFTFLOWD_V4_TEMPLATE_ID);
  75. @@ -182,7 +182,7 @@ nf9_init_template (void) {
  76. v4_template.r[14].length = htons (2);
  77. v4_template.r[15].type = htons (NF9_SRC_VLAN);
  78. v4_template.r[15].length = htons (2);
  79. - bzero (&v6_template, sizeof (v6_template));
  80. + memset (&v6_template, 0, sizeof (v6_template));
  81. v6_template.h.c.flowset_id = htons (NFLOW9_TEMPLATE_SET_ID);
  82. v6_template.h.c.length = htons (sizeof (v6_template));
  83. v6_template.h.template_id = htons (NF9_SOFTFLOWD_V6_TEMPLATE_ID);
  84. @@ -223,7 +223,7 @@ nf9_init_template (void) {
  85. static void
  86. nf9_init_option (u_int16_t ifidx, struct OPTION *option) {
  87. - bzero (&option_template, sizeof (option_template));
  88. + memset (&option_template, 0, sizeof (option_template));
  89. option_template.h.c.flowset_id = htons (NFLOW9_OPTION_TEMPLATE_SET_ID);
  90. option_template.h.c.length = htons (sizeof (option_template));
  91. option_template.h.template_id = htons (NF9_SOFTFLOWD_OPTION_TEMPLATE_ID);
  92. @@ -238,7 +238,7 @@ nf9_init_option (u_int16_t ifidx, struct
  93. option_template.r[1].length =
  94. htons (sizeof (option_data.sampling_algorithm));
  95. - bzero (&option_data, sizeof (option_data));
  96. + memset (&option_data, 0, sizeof (option_data));
  97. option_data.c.flowset_id = htons (NF9_SOFTFLOWD_OPTION_TEMPLATE_ID);
  98. option_data.c.length = htons (sizeof (option_data));
  99. option_data.scope_ifidx = htonl (ifidx);
  100. @@ -257,7 +257,7 @@ nf_flow_to_flowset (const struct FLOW *f
  101. struct NF9_SOFTFLOWD_DATA_COMMON *dc[2];
  102. u_int freclen, ret_len, nflows;
  103. - bzero (d, sizeof (d));
  104. + memset (d, 0, sizeof (d));
  105. *len_used = nflows = ret_len = 0;
  106. switch (flow->af) {
  107. case AF_INET:
  108. @@ -363,7 +363,7 @@ send_netflow_v9 (struct SENDPARAMETER sp
  109. last_valid = num_packets = 0;
  110. for (j = 0; j < num_flows;) {
  111. - bzero (packet, sizeof (packet));
  112. + memset (packet, 0, sizeof (packet));
  113. nf9 = (struct NFLOW9_HEADER *) packet;
  114. nf9->version = htons (9);
  115. --- a/psamp.c
  116. +++ b/psamp.c
  117. @@ -51,7 +51,7 @@ static int psamp_pkts_until_template = -
  118. static void
  119. psamp_init_template (struct PSAMP_SOFTFLOWD_TEMPLATE *template_p) {
  120. u_int index = 0;
  121. - bzero (template_p, sizeof (*template_p));
  122. + memset (template_p, 0, sizeof (*template_p));
  123. template_p->h.c.set_id = htons (IPFIX_TEMPLATE_SET_ID);
  124. template_p->h.c.length = htons (sizeof (struct PSAMP_SOFTFLOWD_TEMPLATE));
  125. template_p->h.r.template_id = htons (PSAMP_SOFTFLOWD_TEMPLATE_ID);