Skip to content

Commit fe35434

Browse files
committed
Merge Netgear's R6300v2-V1.0.4.8_10.0.77_src, as well as their latest
build instructions as README
2 parents 41ff91e + 98cbde2 commit fe35434

File tree

217 files changed

+2462
-1215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+2462
-1215
lines changed

README

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
R6300 Firmware Build Instructions
33

44
Version: 1.0
5-
Date : 2015/12/08
5+
Date : 2017/03/06
66
========================================
77

88
Note:
@@ -27,16 +27,16 @@ Note:
2727
Build code
2828
===================
2929

30-
1. Put the file "R6300v2-V1.0.4.2_10.0.74_src.tar.zip" into a directory of your choice.
30+
1. Put the file "R6300v2-V1.0.4.8_10.0.77_src.tar.zip" into a directory of your choice.
3131
Unzip and untar it with the following command:
32-
unzip R6300v2-V1.0.4.2_10.0.74_src.tar.zip
33-
tar xvf R6300v2-V1.0.4.2_10.0.74_src.tar
32+
unzip R6300v2-V1.0.4.8_10.0.77_src.tar.zip
33+
tar xvf R6300v2-V1.0.4.8_10.0.77_src.tar
3434

3535
2. Run the following commands to build image
36-
cd R6300v2-V1.0.4.2_10.0.74_src/src/router/
36+
cd R6300v2-V1.0.4.8_10.0.77_src/src/router/
3737
make PROFILE=R6300v2 FW_TYPE=WW ARCH=arm PLT=arm LINUX_VERSION=2_6_36
3838
make PROFILE=R6300v2 FW_TYPE=WW ARCH=arm PLT=arm LINUX_VERSION=2_6_36 install
3939

40-
3. The final image is "R6300v2-V1.0.4.2_10.0.74_src/src/router/arm-uclibc/kernel_image.chk".
40+
3. The final image is "R6300v2-V1.0.4.8_10.0.77_src/src/router/arm-uclibc/kernel_image.chk".
4141
User may upgrade to this image using the R6300v2 GUI "Router Upgrade" page.
4242

ap/gpl/bftpd-1.6.6/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ OBJS=bftpdutmp.o commands.o commands_admin.o cwd.o dirlist.o list.o login.o logg
1414
SRCS=bftpdutmp.c commands.c commands_admin.c cwd.c dirlist.c list.c login.c logging.c main.c mystring.c options.c
1515

1616
CFLAGS += -I. -I$(TOP)/shared -I$(SRCBASE)/include -Wall
17+
CFLAGS += -I../../acos/include
1718
LDFLAGS=-Wl,-allow-shlib-undefined
19+
1820
LDFLAGS += -L$(ROUTERDIR)/nvram -L$(INSTALLDIR)/nvram/usr/lib -lnvram
21+
#Foxconn add start, Ken Chen, 02/07/2017, no plain text in /etc/passwd
22+
CFLAGS += -I/$(GPLTOPDIR)/openssl/include
23+
LDFLAGS += -L$(INSTALL_DIR)/lib -lcrypto
24+
#Foxconn add end, Ken Chen, 02/07/2017, no plain text in /etc/passwd
1925

2026
bftpd: $(OBJS)
2127
./mksources $(DIRPAX)

ap/gpl/bftpd-1.6.6/commands.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void fifo_write(char *buf)
298298
* ,end by cliff wang @ checking remote access for log
299299
* **/
300300

301-
void command_user(char *username)
301+
void command_user(char *login_username)
302302
{
303303
char *alias;
304304

@@ -308,19 +308,31 @@ void command_user(char *username)
308308
* Also, take care of duplicate login.
309309
*/
310310
extern int all_no_password;
311-
311+
char username[256];
312+
int welcome_message=0;
312313
char modified_user[] = "guest";
314+
315+
if(strcmp(login_username,"no_pass")==0)
316+
{
317+
strcpy(username,"guest");
318+
welcome_message=1;
319+
}
320+
else
321+
strcpy(username,login_username);
322+
313323

314324
//if ( strlen(username) != 0 && strcmp(username, "admin") != 0 ) {
315-
if (all_no_password) {
325+
if (all_no_password && (strcasecmp(config_getoption("ADMIN_PROTECT"), "yes")))
326+
{
316327
if (strcmp(user, "guest") ) {
317328
/* first time */
318-
username = modified_user;
329+
strcpy(username,modified_user);
319330
} else {
320331
/* duplicate login */
321-
control_printf (SL_SUCCESS, "230 User logged in.");
322332
write_usb_access_log();
333+
control_printf (SL_SUCCESS, "230 User logged in.");
323334
return;
335+
324336
}
325337
}
326338
/* , cliff wang, remove for 2nd login browser using anonymous user first */
@@ -352,11 +364,14 @@ void command_user(char *username)
352364
bftpd_log("Trying to log in as %s.\n", user);
353365
#endif
354366
expand_groups();
355-
if (!strcasecmp(config_getoption("ANONYMOUS_USER"), "yes"))
367+
if (!strcasecmp(config_getoption("ANONYMOUS_USER"), "yes") && (strcasecmp(config_getoption("ADMIN_PROTECT"), "yes")))
356368
bftpd_login("");
357369
else {
358370
state = STATE_USER;
359-
control_printf(SL_SUCCESS, "331 Password please.");
371+
if(welcome_message)
372+
control_printf(SL_SUCCESS, "220 Welcome.");
373+
else
374+
control_printf(SL_SUCCESS, "331 Password please.");
360375
}
361376
}
362377

ap/gpl/bftpd-1.6.6/login.c

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
#include "bftpdutmp.h"
4949
#include "main.h"
5050

51+
/* Foxconn add start, Ken Chen, 02/07/2017, no plain text in /etc/passwd */
52+
#include <openssl/sha.h>
53+
/* Foxconn add end, Ken Chen, 02/07/2017, no plain text in /etc/passwd */
54+
5155
#ifdef WANT_PAM
5256
char usepam = 0;
5357
pam_handle_t *pamh = NULL;
@@ -68,8 +72,8 @@ char userinfo_set = 0;
6872
#define P1MSG(args...) fprintf(stderr, "%s-%04d: ", __FILE__, __LINE__) ; fprintf(stderr, ## args)
6973
#endif // NDEBUG
7074

71-
/* added start by Jenny Zhao, 06/10/2011 @USB log */
72-
#include "bcmnvram.h"
75+
/* Foxconn added start by Jenny Zhao, 06/10/2011 @USB log */
76+
#include <acosNvramConfig.h>
7377
#include <errno.h>
7478
extern int g_isLanIp;
7579
extern char client_ip[32];
@@ -80,8 +84,8 @@ extern char client_ip[32];
8084
int isLanSubnet(char *ipAddr)
8185
{
8286
long netAddr, netMask, netIp;
83-
netAddr = inet_addr(nvram_safe_get("lan_ipaddr"));
84-
netMask = inet_addr(nvram_safe_get("lan_netmask"));
87+
netAddr = inet_addr(acosNvramConfig_get("lan_ipaddr"));
88+
netMask = inet_addr(acosNvramConfig_get("lan_netmask"));
8589
netIp = inet_addr(ipAddr);
8690
if ((netAddr & netMask) != (netIp & netMask))
8791
{
@@ -704,7 +708,32 @@ int checkpass_pwd (char *password)
704708
P1MSG("%s(%d)userinfo.pw_passwd=%s , password=%s \r\n", __FUNCTION__,
705709
__LINE__, userinfo.pw_passwd, password);
706710

707-
if (strcmp (userinfo.pw_passwd, password))
711+
/* Foxconn add start, Ken Chen, 02/07/2017, no plain text in /etc/passwd */
712+
int i;
713+
char * pData = NULL;
714+
#ifdef SHA256_DIGEST_LENGTH
715+
//using SHA256
716+
char password_hash[SHA256_DIGEST_LENGTH] = "";
717+
char password_hash_str[2*SHA256_DIGEST_LENGTH+1] = "";
718+
pData = password_hash_str;
719+
SHA256(password, strlen(password), password_hash);
720+
for (i=0; i<SHA256_DIGEST_LENGTH; i++) {
721+
sprintf(pData,"%02x",(unsigned char)password_hash[i]);
722+
pData += 2;
723+
}
724+
#else
725+
//using SHA1
726+
char password_hash[SHA_DIGEST_LENGTH] = "";
727+
char password_hash_str[2*SHA_DIGEST_LENGTH+1] = "";
728+
pData = password_hash_str;
729+
SHA1(password, strlen(password), password_hash);
730+
for (i=0; i<SHA_DIGEST_LENGTH; i++) {
731+
sprintf(pData,"%02x",(unsigned char)password_hash[i]);
732+
pData += 2;
733+
}
734+
#endif
735+
//if (strcmp (userinfo.pw_passwd, password))
736+
if (strcmp (userinfo.pw_passwd, password_hash_str))
708737
{
709738
/* add end, Jasmine Yang, 09/12/2007 */
710739
#ifdef HAVE_SHADOW_H

ap/gpl/bftpd-1.6.6/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ int main (int argc, char **argv)
895895
if (fp != NULL)
896896
{
897897
fclose(fp);
898-
command_user("guest");
898+
command_user("no_pass");
899899
all_no_password = 1;
900900
}
901901
else

ap/gpl/dnsmasq-2.15/src/forward.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,11 @@ void reply_query(struct serverfd *sfd, struct daemon *daemon, time_t now)
903903
struct server *server = forward->sentto;
904904
/* add start, Tony W.Y. Wang, 07/09/2010 */
905905
#ifdef OPENDNS_PARENTAL_CONTROL
906-
if ((header->rcode == SERVFAIL || header->rcode == REFUSED) && forward->forwardall == 0 && (flag != '1'))
906+
/* R6300v2 #246: forward DNS packet to 2nd server if first server reply
907+
* error of "no such domain".
908+
*/
909+
//if ((header->rcode == SERVFAIL || header->rcode == REFUSED) && forward->forwardall == 0 && (flag != '1'))
910+
if ((header->rcode == SERVFAIL || header->rcode == REFUSED || header->rcode == NXDOMAIN) && forward->forwardall == 0 && (flag != '1'))
907911
#else
908912
if ((header->rcode == SERVFAIL || header->rcode == REFUSED) && forward->forwardall == 0)
909913
#endif

ap/gpl/minidlna/minidlna.03.14/getifaddr.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ getsysaddrs(void)
125125
for (i=0; i < n; i++)
126126
{
127127
ifr = &ifc.ifc_req[i];
128+
if(strcmp(ifr->ifr_name,"br0")!=0)
129+
continue;
130+
128131
if( ioctl(s, SIOCGIFFLAGS, ifr) < 0 ||
129132
ifr->ifr_ifru.ifru_flags & IFF_LOOPBACK)
130133
continue;
@@ -172,6 +175,9 @@ getsyshwaddr(char * buf, int len)
172175

173176
for(if_idx = ifaces; if_idx->if_index; if_idx++)
174177
{
178+
/* DLNA should only work on br0 interface...*/
179+
if (strcmp(if_idx->if_name, "br0") != 0)
180+
continue;
175181
strncpy(ifr.ifr_name, if_idx->if_name, IFNAMSIZ);
176182
if(ioctl(fd, SIOCGIFFLAGS, &ifr) < 0)
177183
continue;

project/acos/include/ambitCfg_WW_R6300v2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747

4848
/*formal version control*/
4949
#define AMBIT_HARDWARE_VERSION "U12H240T00"
50-
#define AMBIT_SOFTWARE_VERSION "V1.0.4.2"
51-
#define AMBIT_UI_VERSION "10.0.74"
52-
#define STRING_TBL_VERSION "1.0.4.2_2.1.33.8"
50+
#define AMBIT_SOFTWARE_VERSION "V1.0.4.8"
51+
#define AMBIT_UI_VERSION "10.0.77"
52+
#define STRING_TBL_VERSION "1.0.4.8_2.1.33.8"
5353

5454
#define AMBIT_PRODUCT_NAME "R6300v2"
5555
#define AMBIT_PRODUCT_DESCRIPTION "N1800 Wireless Dual Band Gigabit Router R6300v2"

src/prebuilt/WW/bin/busybox

0 Bytes
Binary file not shown.

src/prebuilt/WW/bin/wget

184 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)