default y
depends on IFUPDOWN
help
- If you want busybox to talk IPv4, leave this on.
+ If you want ifup/ifdown to talk IPv4, leave this on.
config FEATURE_IFUPDOWN_IPV6
bool "Enable support for IPv6"
help
If you need support for IPv6, turn this option on.
-config FEATURE_IFUPDOWN_IPX
- bool "Enable support for IPX"
- default n
- depends on IFUPDOWN
- help
- If this option is selected you can use busybox to work with IPX
- networks.
+### UNUSED
+### config FEATURE_IFUPDOWN_IPX
+### bool "Enable support for IPX"
+### default n
+### depends on IFUPDOWN
+### help
+### If this option is selected you can use busybox to work with IPX
+### networks.
config FEATURE_IFUPDOWN_MAPPING
bool "Enable mapping support"
This enables support for the "mapping" stanza, unless you have
a weird network setup you don't need it.
+config FEATURE_IFUPDOWN_EXTERNAL_DHCP
+ bool "Enable support for external dhcp clients"
+ default n
+ depends on IFUPDOWN
+ help
+ This enables support for the external dhcp clients. Clients are
+ tried in the following order: dhcpcd, dhclient, pump and udhcpc.
+ Otherwise, if udhcpc applet is enabled, it is used.
+ Otherwise, ifup/ifdown will have no support for DHCP.
+
config INETD
bool "inetd"
default n
return ((result == 2) ? 2 : 0);
}
-#if !ENABLE_APP_UDHCPC
+#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
struct dhcp_client_t
{
const char *name;
};
static const struct dhcp_client_t ext_dhcp_clients[] = {
- { "udhcpc",
- "udhcpc -R -n -p /var/run/udhcpc.%iface%.pid -i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
- "kill -TERM `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null",
- },
- { "pump",
- "pump -i %iface%[[ -h %hostname%]][[ -l %leasehours%]]",
- "pump -i %iface% -k",
+ { "dhcpcd",
+ "dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %clientid%]][[ -l %leasetime%]] %iface%",
+ "dhcpcd -k %iface%",
},
{ "dhclient",
"dhclient -pf /var/run/dhclient.%iface%.pid %iface%",
"kill -9 `cat /var/run/dhclient.%iface%.pid` 2>/dev/null",
},
- { "dhcpcd",
- "dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %clientid%]][[ -l %leasetime%]] %iface%",
- "dhcpcd -k %iface%",
+ { "pump",
+ "pump -i %iface%[[ -h %hostname%]][[ -l %leasehours%]]",
+ "pump -i %iface% -k",
+ },
+ { "udhcpc",
+ "udhcpc -R -n -p /var/run/udhcpc.%iface%.pid -i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
+ "kill -TERM `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null",
},
};
-#endif
+#endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */
static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
-#if ENABLE_APP_UDHCPC
- return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
- "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
- ifd, exec);
-#else
+#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
int i, nclients = sizeof(ext_dhcp_clients) / sizeof(ext_dhcp_clients[0]);
for (i = 0; i < nclients; i++) {
if (exists_execable(ext_dhcp_clients[i].name))
}
bb_error_msg("no dhcp clients found");
return 0;
-#endif
+#elif ENABLE_APP_UDHCPC
+ return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
+ "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
+ ifd, exec);
+#else
+ return 0; /* no dhcp support */
+#endif
}
static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
-#if ENABLE_APP_UDHCPC
- return execute("kill -TERM "
- "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
-#else
+#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
int i, nclients = sizeof(ext_dhcp_clients) / sizeof(ext_dhcp_clients[0]);
for (i = 0; i < nclients; i++) {
if (exists_execable(ext_dhcp_clients[i].name))
}
bb_error_msg("no dhcp clients found, using static interface shutdown");
return static_down(ifd, exec);
+#elif ENABLE_APP_UDHCPC
+ return execute("kill -TERM "
+ "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
+#else
+ return 0; /* no support for dhcp */
#endif
}
static const struct address_family_t addr_inet = {
"inet",
- sizeof(methods) / sizeof(struct method_t),
+ sizeof(methods) / sizeof(methods[0]),
methods
};
llist_t *search = state_list;
while (search) {
- if ((strncmp(search->data, iface, iface_len) == 0) &&
- (search->data[iface_len] == '=')) {
+ if ((strncmp(search->data, iface, iface_len) == 0)
+ && (search->data[iface_len] == '=')) {
return search;
}
search = search->link;