uip: build the IPv6 neighbour cache only for IPv6 builds

uip-neighbor.c is the IPv6 neighbour cache. Its only caller is the neighbour
solicitation handler in uip_process(), which sits inside #if UIP_CONF_IPV6,
so on an IPv4 build the module is linked without being reachable.

Guard it on the same macro as its caller.

Worth recording separately: the module does not currently compile with
UIP_CONF_IPV6 set. uip_ipaddr_cmpx() is defined only in the non-IPv6 half of
uip.h, and uip_neighbor_add() calls it, so an IPv6 build stops with an
implicit declaration. That is true before this change as well, and is left
alone here.

On SWTGW218AS, on top of the forwarding change, the stack gains a further 12
bytes to 172 available and BANK1 drops another 714 bytes to 46080.
This commit is contained in:
bloqaudio committed 2026-09-22 09:23:13 -05:00
1 parent 175ca9464a
commit 675faf0471
1 file changed
+4
+4
View File
@@ -43,6 +43,8 @@
#include "uip-neighbor.h" #include "uip-neighbor.h"
#include "../rtl837x_common.h" #include "../rtl837x_common.h"
#if UIP_CONF_IPV6
#pragma codeseg BANK1 #pragma codeseg BANK1
#pragma constseg BANK1 #pragma constseg BANK1
@@ -170,3 +172,5 @@ uip_neighbor_lookup(__xdata uip_ipaddr_t ipaddr)
return NULL; return NULL;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */