Get IP info from a FreeBSD machine
main() doesn't need to be indented out as such, same with the global arrays.
main() should have a void parameter since it's not taking command-line arguments.
You're using "Yoda conditions" in some places:


if (0 != getifaddrs(&amp;ifaddrp))






NULL != ifap



and rest elsewhere in most places. Stay consistent with one of these types.
It looks like netip could be const since it's not being modified and is only used as a const parameter in strlcpy().
You can simplify this:


if (g_szPublicIP[0] != '0')
{
    return true;
}
else
{
    return false;
}



to this:

return g_szPublicIP[0] != '0';


It'll automatically return the outcome of the function call.

However, if you still prefer to see true and false, you can use a ternary:

return (g_szPublicIP[0] != '0') ? true : false;