make /etc/network parsing configurable. -200 bytes when off.
This commit is contained in:
@@ -26,6 +26,14 @@ config MD5_SIZE_VS_SPEED
|
|||||||
2 3.0 5088
|
2 3.0 5088
|
||||||
3 (smallest) 5.1 4912
|
3 (smallest) 5.1 4912
|
||||||
|
|
||||||
|
config FEATURE_ETC_NETWORKS
|
||||||
|
bool "Support for /etc/networks"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enable support for network names in /etc/networks. This is
|
||||||
|
a rarely used feature which allows you to use names
|
||||||
|
instead of IP/mask pairs in route command.
|
||||||
|
|
||||||
config FEATURE_EDITING
|
config FEATURE_EDITING
|
||||||
bool "Command line editing"
|
bool "Command line editing"
|
||||||
default n
|
default n
|
||||||
|
@@ -14,7 +14,9 @@
|
|||||||
int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
|
int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
|
||||||
{
|
{
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
|
#if ENABLE_FEATURE_ETC_NETWORKS
|
||||||
struct netent *np;
|
struct netent *np;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Grmpf. -FvK */
|
/* Grmpf. -FvK */
|
||||||
s_in->sin_family = AF_INET;
|
s_in->sin_family = AF_INET;
|
||||||
@@ -43,6 +45,7 @@ int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if ENABLE_FEATURE_ETC_NETWORKS
|
||||||
/* Try the NETWORKS database to see if this is a known network. */
|
/* Try the NETWORKS database to see if this is a known network. */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
bb_error_msg("getnetbyname(%s)", name);
|
bb_error_msg("getnetbyname(%s)", name);
|
||||||
@@ -52,6 +55,7 @@ int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
|
|||||||
s_in->sin_addr.s_addr = htonl(np->n_net);
|
s_in->sin_addr.s_addr = htonl(np->n_net);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (hostfirst) {
|
if (hostfirst) {
|
||||||
/* Don't try again */
|
/* Don't try again */
|
||||||
return -1;
|
return -1;
|
||||||
@@ -140,10 +144,7 @@ char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask)
|
|||||||
ent = gethostbyaddr((char *) &ad, 4, AF_INET);
|
ent = gethostbyaddr((char *) &ad, 4, AF_INET);
|
||||||
if (ent)
|
if (ent)
|
||||||
name = xstrdup(ent->h_name);
|
name = xstrdup(ent->h_name);
|
||||||
} else {
|
} else if (ENABLE_FEATURE_ETC_NETWORKS) {
|
||||||
/* Hmmm... this is very rare to have named nets,
|
|
||||||
* and this getnetbyaddr() call is the only one in bbox.
|
|
||||||
* Maybe get rid of or make configurable? */
|
|
||||||
struct netent *np;
|
struct netent *np;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
bb_error_msg("getnetbyaddr (%08x)", (unsigned)host_ad);
|
bb_error_msg("getnetbyaddr (%08x)", (unsigned)host_ad);
|
||||||
|
Reference in New Issue
Block a user