USE_FEATURE_HTTPD_BASIC_AUTH(const char *g_realm;)
USE_FEATURE_HTTPD_BASIC_AUTH(char *remoteuser;)
USE_FEATURE_HTTPD_CGI(char *referer;)
+ USE_FEATURE_HTTPD_CGI(char *user_agent;)
#if ENABLE_FEATURE_HTTPD_CGI || DEBUG
char *rmt_ip_str; /* for set env REMOTE_ADDR */
#define g_realm (G.g_realm )
#define remoteuser (G.remoteuser )
#define referer (G.referer )
+#define user_agent (G.user_agent )
#if ENABLE_FEATURE_HTTPD_CGI || DEBUG
#define rmt_ip_str (G.rmt_ip_str )
#endif
setenv1("REMOTE_ADDR", p);
if (cp) *cp = ':';
}
+ setenv1("HTTP_USER_AGENT", user_agent);
#if ENABLE_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
setenv_long("REMOTE_PORT", tcp_port);
#endif
if (test[0] || errno || length > INT_MAX)
goto bail_out;
}
- } else if ((STRNCASECMP(buf, "Cookie:") == 0)) {
+ } else if (STRNCASECMP(buf, "Cookie:") == 0) {
cookie = strdup(skip_whitespace(buf + sizeof("Cookie:")-1));
- } else if ((STRNCASECMP(buf, "Content-Type:") == 0)) {
+ } else if (STRNCASECMP(buf, "Content-Type:") == 0)) {
content_type = strdup(skip_whitespace(buf + sizeof("Content-Type:")-1));
- } else if ((STRNCASECMP(buf, "Referer:") == 0)) {
+ } else if (STRNCASECMP(buf, "Referer:") == 0) {
referer = strdup(skip_whitespace(buf + sizeof("Referer:")-1));
+ } else if (STRNCASECMP(buf, "User-Agent:") == 0) {
+ user_agent = strdup(skip_whitespace(buf + sizeof("User-Agent:")-1));
}
#endif
static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
- int i ;
+#if ENABLE_FEATURE_IFUPDOWN_IP
+ /* ip doesn't up iface when it configures it (unlike ifconfig) */
+ if (!execute("ip link set %iface% up", ifd, exec))
+ return 0;
+#endif
+ int i;
for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
if (exists_execable(ext_dhcp_clients[i].name))
return execute(ext_dhcp_clients[i].startcmd, ifd, exec);
bb_error_msg("no dhcp clients found");
return 0;
#elif ENABLE_APP_UDHCPC
+#if ENABLE_FEATURE_IFUPDOWN_IP
+ /* ip doesn't up iface when it configures it (unlike ifconfig) */
+ if (!execute("ip link set %iface% up", ifd, exec))
+ return 0;
+#endif
return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
"-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
ifd, exec);
static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
- int i ;
+ int i;
for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
if (exists_execable(ext_dhcp_clients[i].name))
return execute(ext_dhcp_clients[i].stopcmd, ifd, exec);