]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/ntop.c
Merge pull request #10816 from anlancs/fix-bgdp-local-es-rt
[mirror_frr.git] / lib / ntop.c
index d47a0b697aa699dde6e3e080c6889cc35126a003..1b2dd7a6d12da7be9afbc9e79cb494ea3ab1cdee 100644 (file)
@@ -40,14 +40,18 @@ static inline void putbyte(uint8_t bytex, char **posx)
        bool zero = false;
        int byte = bytex, tmp, a, b;
 
-       if ((tmp = byte - 200) >= 0) {
+       tmp = byte - 200;
+       if (tmp >= 0) {
                *pos++ = '2';
                zero = true;
                byte = tmp;
-       } else if ((tmp = byte - 100) >= 0) {
-               *pos++ = '1';
-               zero = true;
-               byte = tmp;
+       } else {
+               tmp = byte - 100;
+               if (tmp >= 0) {
+                       *pos++ = '1';
+                       zero = true;
+                       byte = tmp;
+               }
        }
 
        /* make sure the compiler knows the value range of "byte" */
@@ -81,7 +85,7 @@ static inline void puthex(uint16_t word, char **posx)
 
 const char *frr_inet_ntop(int af, const void * restrict src,
                          char * restrict dst, socklen_t size)
-       __attribute__((flatten)) DSO_SELF OPTIMIZE;
+       __attribute__((flatten)) OPTIMIZE;
 
 const char *frr_inet_ntop(int af, const void * restrict src,
                          char * restrict dst, socklen_t size)
@@ -165,10 +169,10 @@ inet4:
        return dst;
 }
 
-#ifndef INET_NTOP_NO_OVERRIDE
+#if !defined(INET_NTOP_NO_OVERRIDE) && !defined(__APPLE__)
 /* we want to override libc inet_ntop, but make sure it shows up in backtraces
  * as frr_inet_ntop (to avoid confusion while debugging)
  */
 const char *inet_ntop(int af, const void *src, char *dst, socklen_t size)
-       __attribute__((alias ("frr_inet_ntop"))) DSO_SELF;
+       __attribute__((alias ("frr_inet_ntop")));
 #endif