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.

45 lines
1.5 KiB

  1. --- a/src/dcwsocket.c.linux
  2. +++ b/src/dcwsocket.c.linux
  3. @@ -100,10 +100,10 @@ dcwsock_open(const char * const ifname) {
  4. }
  5. /* sanitize our data structs... defensive */
  6. - bzero(rv, sizeof(*rv));
  7. - bzero(&ifr, sizeof(ifr));
  8. - bzero(&sall, sizeof(sall));
  9. - bzero(&sfp, sizeof(sfp));
  10. + memset(rv, 0, sizeof(*rv));
  11. + memset(&ifr, 0, sizeof(ifr));
  12. + memset(&sall, 0, sizeof(sall));
  13. + memset(&sfp, 0, sizeof(sfp));
  14. /* open a raw socket... "ETH_P_ALL" says take EVERYTHING
  15. (this means that it is IMPERATIVE to apply a filter)
  16. diff --git a/src/dcwsocket.c.osx b/src/dcwsocket.c.osx
  17. index abead10..75cda2f 100644
  18. --- a/src/dcwsocket.c.osx
  19. +++ b/src/dcwsocket.c.osx
  20. @@ -90,10 +90,10 @@ dcwsock_open(const char * const ifname) {
  21. }
  22. /* sanitize our data structs... defensive */
  23. - bzero(rv, sizeof(*rv));
  24. - bzero(&dmx_desc, sizeof(dmx_desc));
  25. - bzero(&proto_desc, sizeof(proto_desc));
  26. - bzero(&snd, sizeof(snd));
  27. + memset(rv, 0, sizeof(*rv));
  28. + memset(&dmx_desc, 0, sizeof(dmx_desc));
  29. + memset(&proto_desc, 0, sizeof(proto_desc));
  30. + memset(&snd, 0, sizeof(snd));
  31. /* open a "NDRV" socket... */
  32. rv->fd = socket(PF_NDRV, SOCK_RAW, 0);
  33. @@ -201,7 +201,7 @@ dcwsock_send( dcw_socket_t s, const void * const buf, const unsigned buf_size, c
  34. fill out a link-level sockaddr cause we can only
  35. use sendto() with PF_NDRV...
  36. */
  37. - bzero(&sdl, sizeof(sdl));
  38. + memset(&sdl, 0, sizeof(sdl));
  39. sdl.sdl_len = sizeof(sdl);
  40. sdl.sdl_index = 0;
  41. sdl.sdl_type = IFT_ETHER;