diff --git a/release/src-rt-6.x.4708/router/httpd/devlist.c b/release/src-rt-6.x.4708/router/httpd/devlist.c index 4f44690111..ba41e10ece 100644 --- a/release/src-rt-6.x.4708/router/httpd/devlist.c +++ b/release/src-rt-6.x.4708/router/httpd/devlist.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -39,7 +40,9 @@ void asp_arplist(int argc, char **argv) char ip[16]; char mac[18]; char dev[17]; + char host[NI_MAXHOST]; char comma; + char *c; unsigned int flags; /* @@ -61,8 +64,14 @@ void asp_arplist(int argc, char **argv) if (flags == 0) continue; + if ((resolve_addr(ip, host) != 0) || (strcmp(ip, host) == 0)) + strcpy(host, ""); + + if ((c = strchr(host, '.')) != NULL) + *c = 0; + strupr(mac); - web_printf("%c['%s','%s','%s']", comma, ip, mac, dev); + web_printf("%c['%s','%s','%s','%s']", comma, ip, mac, dev, host); comma = ','; } fclose(f); @@ -82,9 +91,7 @@ static int get_wds_ifname(const struct ether_addr *ea, char *ifname) /* wds doesn't show up under SIOCGIFCONF; seems to start at 17 (?) */ for (i = 1; i < 32; ++i) { ifr.ifr_ifindex = i; - if ((ioctl(sd, SIOCGIFNAME, &ifr) == 0) && - (strncmp(ifr.ifr_name, "wds", 3) == 0) && - (wl_ioctl(ifr.ifr_name, WLC_WDS_GET_REMOTE_HWADDR, &e.octet, sizeof(e.octet)) == 0)) { + if ((ioctl(sd, SIOCGIFNAME, &ifr) == 0) && (strncmp(ifr.ifr_name, "wds", 3) == 0) && (wl_ioctl(ifr.ifr_name, WLC_WDS_GET_REMOTE_HWADDR, &e.octet, sizeof(e.octet)) == 0)) { if (memcmp(ea->octet, e.octet, sizeof(e.octet)) == 0) { close(sd); strlcpy(ifname, ifr.ifr_name, 16); diff --git a/release/src-rt-6.x.4708/router/www/basic-static.asp b/release/src-rt-6.x.4708/router/www/basic-static.asp index 9ef8a907b0..25eb5b5231 100644 --- a/release/src-rt-6.x.4708/router/www/basic-static.asp +++ b/release/src-rt-6.x.4708/router/www/basic-static.asp @@ -230,8 +230,8 @@ REMOVE-END */ s = f[5].value.trim().replace(/\s+/g, ' '); if (s.length > 0) { - if (s.search(/^[.a-zA-Z0-9_\- ]+$/) == -1) { - ferror.set(f[5], 'Invalid hostname. Only characters "A-Z 0-9 . - _" are allowed', quiet); + if (s.search(/^[a-zA-Z0-9_\- ]+$/) == -1) { + ferror.set(f[5], 'Invalid hostname. Only characters "A-Z 0-9 - _" are allowed', quiet); return 0; } if (this.existName(s)) { diff --git a/release/src-rt-6.x.4708/router/www/status-devices.asp b/release/src-rt-6.x.4708/router/www/status-devices.asp index 99b1e43ee2..e26c315691 100644 --- a/release/src-rt-6.x.4708/router/www/status-devices.asp +++ b/release/src-rt-6.x.4708/router/www/status-devices.asp @@ -307,7 +307,7 @@ dg.populate = function() { e.name = a[0]; } - /* [ "IP", "MAC", "wwan0/br0/1" ] */ + /* [ "IP", "MAC", "br0/wwan0", "name" ] */ for (i = arplist.length - 1; i >= 0; --i) { a = arplist[i]; if ((e = get(a[1], a[0])) != null) { @@ -315,6 +315,8 @@ dg.populate = function() { e.ifname = a[2]; e.bridge = a[2]; + if (e.name == '') + e.name = a[3]; } }