arprefresh: use the ARRAYSIZE macro
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 18 Apr 2013 07:22:43 +0000 (09:22 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 18 Apr 2013 07:31:55 +0000 (09:31 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/arprefresh/src/olsrd_arprefresh.c

index cdcad72..939ffef 100644 (file)
@@ -191,7 +191,7 @@ olsrd_plugin_init(void)
 /* ignore */ {BPF_RET | BPF_K              , 0,        0,         0x00000000}              //                                                 : accept 0 bytes
 
     };
 /* ignore */ {BPF_RET | BPF_K              , 0,        0,         0x00000000}              //                                                 : accept 0 bytes
 
     };
-    filter.len = sizeof(BPF_code) / sizeof(BPF_code[0]);
+    filter.len = ARRAYSIZE(BPF_code);
     filter.filter = BPF_code;
     if (0 <= (arprefresh_sockfd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)))
         && 0 <= (flags = fcntl(arprefresh_sockfd, F_GETFL))
     filter.filter = BPF_code;
     if (0 <= (arprefresh_sockfd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)))
         && 0 <= (flags = fcntl(arprefresh_sockfd, F_GETFL))