patch-src_osdep_openbsd_c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. $OpenBSD: patch-src_osdep_openbsd_c,v 1.5 2016/09/10 13:03:43 ajacoutot Exp $
  2. --- src/osdep/openbsd.c.orig Tue Feb 26 19:12:19 2008
  3. +++ src/osdep/openbsd.c Sat Sep 10 12:18:30 2016
  4. @@ -19,26 +19,26 @@
  5. */
  6. #include <sys/types.h>
  7. #include <sys/endian.h>
  8. -#include <errno.h>
  9. -#include <fcntl.h>
  10. -#include <sys/param.h>
  11. #include <sys/sysctl.h>
  12. -#include <net/bpf.h>
  13. +#include <sys/select.h> /* fd_set */
  14. #include <sys/socket.h>
  15. +#include <sys/timeout.h>
  16. +#include <sys/ioctl.h>
  17. +#include <net/bpf.h>
  18. #include <net/if.h>
  19. #include <net/if_media.h>
  20. -#include <sys/ioctl.h>
  21. #include <net/if_dl.h>
  22. +#include <net/if_var.h>
  23. #include <net80211/ieee80211.h>
  24. -#include <net80211/ieee80211_crypto.h>
  25. #include <net80211/ieee80211_ioctl.h>
  26. #include <net80211/ieee80211_radiotap.h>
  27. -#include <net80211/ieee80211_proto.h>
  28. +
  29. +#include <errno.h>
  30. +#include <fcntl.h>
  31. #include <stdio.h>
  32. #include <stdlib.h>
  33. #include <unistd.h>
  34. #include <string.h>
  35. -#include <sys/uio.h>
  36. #include <assert.h>
  37. #include <ifaddrs.h>
  38. @@ -273,7 +273,7 @@ static int obsd_write(struct wif *wi, unsigned char *h
  39. if (rc == -1)
  40. return rc;
  41. - return 0;
  42. + return rc;
  43. }
  44. static void do_free(struct wif *wi)
  45. @@ -303,7 +303,7 @@ static int do_obsd_open(struct wif *wi, char *iface)
  46. int s;
  47. unsigned int flags;
  48. struct ifmediareq ifmr;
  49. - int *mwords;
  50. + uint64_t *mwords;
  51. struct priv_obsd *po = wi_priv(wi);
  52. unsigned int size=sizeof(po->po_buf);
  53. @@ -339,7 +339,7 @@ static int do_obsd_open(struct wif *wi, char *iface)
  54. assert(ifmr.ifm_count != 0);
  55. - mwords = (int *)malloc(ifmr.ifm_count * sizeof(int));
  56. + mwords = (uint64_t *)malloc(ifmr.ifm_count * sizeof(uint64_t));
  57. if (!mwords)
  58. goto close_sock;
  59. ifmr.ifm_ulist = mwords;