libiproute: handle table ids larger than 255
[oweals/busybox.git] / networking / libiproute / ipneigh.c
index 179505c2de41f328090826761fe149a69aefe235..2a1c20e20b3c3109df4219026d5bda15191c26ec 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "ip_common.h"  /* #include "libbb.h" is inside */
+#include "common_bufsiz.h"
 #include "rt_names.h"
 #include "utils.h"
 #include <linux/neighbour.h>
@@ -40,7 +41,8 @@ struct filter_t {
 } FIX_ALIASING;
 typedef struct filter_t filter_t;
 
-#define G_filter (*(filter_t*)&bb_common_bufsiz1)
+#define G_filter (*(filter_t*)bb_common_bufsiz1)
+#define INIT_G() do { setup_common_bufsiz(); } while (0)
 
 static int flush_update(void)
 {
@@ -60,7 +62,7 @@ static unsigned nud_state_a2n(char *arg)
                "stale\0"     "incomplete\0"  "delay\0"  "probe\0"
                "failed\0"
                ;
-       static uint8_t nuds[] = {
+       static uint8_t nuds[] ALIGN1 = {
                NUD_PERMANENT,NUD_REACHABLE, NUD_NOARP,NUD_NONE,
                NUD_STALE,    NUD_INCOMPLETE,NUD_DELAY,NUD_PROBE,
                NUD_FAILED
@@ -338,6 +340,8 @@ int FAST_FUNC do_ipneigh(char **argv)
                /*0-1*/ "show\0"  "flush\0";
        int command_num;
 
+       INIT_G();
+
        if (!*argv)
                return ipneigh_list_or_flush(argv, 0);