[PATCH] Fix declaration of struct rtentry and SIOCADDRT/DELRT ioctls on certain FreeBSD versions

Viktor Kutuzov vkutuzov at accesssoftek.com
Thu Aug 14 03:23:11 PDT 2014


================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.cc:36
@@ -25,1 +35,3 @@
 #include <net/if_arp.h>
+#if SANITIZER_FREEBSD_RTENTRY
+#define _WANT_RTENTRY // to declare 'rtentry' structure
----------------
It appears SANITIZER_FREEBSD_RTENTRY is not defined on MAC and Linux. I would expect it to expand to 0 on these platforms.

================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.cc:378
@@ -360,2 +377,3 @@
   unsigned struct_mtop_sz = sizeof(struct mtop);
+#if SANITIZER_FREEBSD && SANITIZER_FREEBSD_RTENTRY
   unsigned struct_rtentry_sz = sizeof(struct rtentry);
----------------
Looks like it should be:
  #if SANITIZER_LINUX || SANITIZER_FREEBSD_RTENTRY

================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.cc:661
@@ -641,2 +660,3 @@
   unsigned IOCTL_MTIOCTOP = MTIOCTOP;
+#if SANITIZER_FREEBSD_RTENTRY
   unsigned IOCTL_SIOCADDRT = SIOCADDRT;
----------------
  #if SANITIZER_LINUX || SANITIZER_FREEBSD_RTENTRY ?

http://reviews.llvm.org/D4853






More information about the llvm-commits mailing list