Page 1 of 1

Can't build with IPV4ONLY set

Posted: Sun Dec 13, 2020 1:00 pm
by jaypdx
I'm working on a MOD54415 project using 3.3.0 of the NNDK. If I comment out IPV6 and IPV6_COUNTERS and uncomment IPV4ONLY in predef.h the project won't build... I get the errors below. Should this work? Am I disabling IPV6 incorrectly?

Thanks



Doing this:

Code: Select all

//#define IPV6 (1)   // Dual stack IPv4/IPv6 mode

//#define IPV6_COUNTERS (1)   // add coutners to IPV6
#define IPV4ONLY (1)  // IPv4 only mode
Gives me these build errors:

Code: Select all

C:/nburn/nbrtos/source/nbiprintf.cpp: In function 'int NB_internal_iprintf(int (*)(void*, const char*, int), void*, const char*, va_list)':
C:/nburn/nbrtos/source/nbiprintf.cpp:427:25: error: 'IPADDR' was not declared in this scope
                         IPADDR ipv;
                         ^~~~~~
C:/nburn/nbrtos/source/nbiprintf.cpp:437:25: error: 'ipv' was not declared in this scope
                         ipv=va_arg(vl,IPADDR);
                         ^~~
In file included from C:/nburn/nbrtos/include/nbprintfinternal.h:30,
                 from C:/nburn/nbrtos/source/nbiprintf.cpp:36:
C:/nburn/nbrtos/source/nbiprintf.cpp:437:39: error: 'IPADDR' does not name a type
                         ipv=va_arg(vl,IPADDR);
                                       ^~~~~~
C:/nburn/nbrtos/source/nbiprintf.cpp:441:35: error: 'ipv' was not declared in this scope
                         pfs.len = ipv.GetPrintLen(!(pfs.flags & PRINTF_FLAG_FIRST_L));
                                   ^~~
"C:/nburn/gcc/bin/m68k-unknown-elf-g++" -c -MT nblibs/release/nbrtos/source/config_netobj.o -MMD -MP -MF nblibs/release/nbrtos/source/config_netobj.d    -std=gnu++14 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections  -DWOLFSSL_USER_SETTINGS -DMOD5441X  -DMCF5441X -mcpu=54415  -fno-omit-frame-pointer -DCOLDFIRE  -gdwarf-2 -DNBMINGW -Wall -falign-functions=4 -fasynchronous-unwind-tables -O2 -gdwarf-2 -D'PLATFORM_NAME="MOD5441X"' -I"../overload/include" -I"../overload/MOD5441X/include" -I"../overload/nbrtos/include" -I"../overload/platform/MOD5441X/include" -I"../overload/arch/coldfire/include" -I"../overload/arch/coldfire/cpu/MCF5441X/include" -I"../overload/libraries/include"  -I"C:/nburn/include" -I"C:/nburn/MOD5441X/include" -I"C:/nburn/nbrtos/include" -I"C:/nburn/platform/MOD5441X/include" -I"C:/nburn/arch/coldfire/include" -I"C:/nburn/arch/coldfire/cpu/MCF5441X/include" -I"C:/nburn/libraries/include"    C:/nburn/nbrtos/source/config_netobj.cpp -o nblibs/release/nbrtos/source/config_netobj.o
"C:/nburn/gcc/bin/m68k-unknown-elf-g++" -c -MT nblibs/release/nbrtos/source/web_client.o -MMD -MP -MF nblibs/release/nbrtos/source/web_client.d    -std=gnu++14 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections  -DWOLFSSL_USER_SETTINGS -DMOD5441X  -DMCF5441X -mcpu=54415  -fno-omit-frame-pointer -DCOLDFIRE  -gdwarf-2 -DNBMINGW -Wall -falign-functions=4 -fasynchronous-unwind-tables -O2 -gdwarf-2 -D'PLATFORM_NAME="MOD5441X"' -I"../overload/include" -I"../overload/MOD5441X/include" -I"../overload/nbrtos/include" -I"../overload/platform/MOD5441X/include" -I"../overload/arch/coldfire/include" -I"../overload/arch/coldfire/cpu/MCF5441X/include" -I"../overload/libraries/include"  -I"C:/nburn/include" -I"C:/nburn/MOD5441X/include" -I"C:/nburn/nbrtos/include" -I"C:/nburn/platform/MOD5441X/include" -I"C:/nburn/arch/coldfire/include" -I"C:/nburn/arch/coldfire/cpu/MCF5441X/include" -I"C:/nburn/libraries/include"    C:/nburn/nbrtos/source/web_client.cpp -o nblibs/release/nbrtos/source/web_client.o
make: *** [C:/nburn/make/boilerplate.mk:295: nblibs/release/nbrtos/source/nbiprintf.o] Error 1
make: *** Waiting for unfinished jobs....
C:/nburn/nbrtos/source/config_server.cpp: In member function 'void GetRequestBlock::ProcessWr(int)':
C:/nburn/nbrtos/source/config_server.cpp:723:60: error: invalid initialization of reference of type 'IPADDR&' {aka 'IPADDR4&'} from expression of type 'IPADDR6'
                         { WriteOneDiscoveryResult(pPrefix->m_IPAddress, ma, fdn, false, 0); }
                                                   ~~~~~~~~~^~~~~~~~~~~

Re: Can't build with IPV4ONLY set

Posted: Sun Dec 13, 2020 1:58 pm
by TomNB
Hello,

I am working on an answer for you, but if you don't mind, can you tell me why you would need v4 only, when v4/v6 has no additional overhead? Just trying to understand the use case, not making excuses for anything not working as expected.

Re: Can't build with IPV4ONLY set

Posted: Sun Dec 13, 2020 10:49 pm
by jaypdx
I was trying to debug something else and thought I'd try IPV4 only to see if it changed things.

Re: Can't build with IPV4ONLY set

Posted: Mon Dec 14, 2020 9:24 am
by pbreed
This is a bug that keeps coming back...
We don't officially support IPV4 only in 3,X, given that I've fixed the issues and it should build in future releases,
alas its not officially supported and won't be actively tested in the 3.X branch.