Index: /src/router/netconf/Makefile
===================================================================
--- /src/router/netconf/Makefile	(revision 13526)
+++ /src/router/netconf/Makefile	(revision 13527)
@@ -15,11 +15,21 @@
 
 ifeq ($(CONFIG_MSSID),y)
+ifeq ($(CONFIG_BCMMODERN),y)
+CFLAGS	= -I. -I$(TOP)/shared -I$(TOP)/iptables/include -I$(SRCBASE)/include.v24 -I$(LINUXDIR)/include -Wall
+CFLAGS += -DLINUX26
+else
 CFLAGS	= -I. -I$(TOP)/shared -I$(TOP)/iptables.linksys/include -I$(SRCBASE)/include.v24 -I$(LINUXDIR)/include -Wall
+endif
 else
 CFLAGS	= -I. -I$(TOP)/shared -I$(TOP)/iptables.linksys/include -I$(SRCBASE)/include.v23 -I$(LINUXDIR)/include -Wall
 endif
 #CFLAGS	+= -g -DDEBUG
-CFLAGS	+= -s -O2
+CFLAGS	+= -s $(COPTS)
+
+ifeq ($(CONFIG_BCMMODERN),y)
+LDFLAGS = -L. -L$(TOP)/iptables/libiptc/
+else
 LDFLAGS = -L. -L$(TOP)/iptables.linksys/libiptc/
+endif
 
 ifeq ($(CONFIG_MAGICBOX),y)
Index: /src/router/netconf/netconf_linux.c
===================================================================
--- /src/router/netconf/netconf_linux.c	(revision 13526)
+++ /src/router/netconf/netconf_linux.c	(revision 13527)
@@ -713,5 +713,9 @@
  */
 static int
+#ifdef LINUX26
+insert_entry(const char *chain, const char *target_name, struct ipt_entry *entry, iptc_handle_t *handle)
+#else /* LINUX26 */
 insert_entry(const char *chain, struct ipt_entry *entry, iptc_handle_t *handle)
+#endif /* LINUX26 */
 {
 	int i;
@@ -729,12 +733,21 @@
 
 	/* If dropping insert at the beginning of the chain */
+#ifdef LINUX26
+	if (!strcmp(target_name, "DROP") ||
+	    !strcmp(target_name, "logdrop"))
+		return iptc_insert_entry(chain, entry, 0, handle);
+	/* If accepting insert after the last drop but before the first default policy */
+	else if (!strcmp(target_name, "ACCEPT") ||
+		 !strcmp(target_name, "DNAT") ||	// by honor, let UPnP Forwarding is prior to DMZ
+		 !strcmp(target_name, "logaccept")) {
+#else /* LINUX26 */
 	if (!strcmp(iptc_get_target(entry, handle), "DROP") ||
 	    !strcmp(iptc_get_target(entry, handle), "logdrop"))
 		return iptc_insert_entry(chain, entry, 0, handle);
-
 	/* If accepting insert after the last drop but before the first default policy */
 	else if (!strcmp(iptc_get_target(entry, handle), "ACCEPT") ||
 		 !strcmp(iptc_get_target(entry, handle), "DNAT") ||	// by honor, let UPnP Forwarding is prior to DMZ
 		 !strcmp(iptc_get_target(entry, handle), "logaccept")) {
+#endif /* LINUX26 */
 		for (i = 0, rule = iptc_first_rule(chain, handle); rule; i++, rule = iptc_next_rule(rule, handle)) {
 			if ((strcmp(iptc_get_target(rule, handle), "DROP") &&
@@ -947,5 +960,9 @@
 		}
 
+#ifdef LINUX26
+		if (!insert_entry(ipt_filter_chain_name[filter->dir], ipt_target_name[fw->target], entry, &handle)) {
+#else /* LINUX26 */
 		if (!insert_entry(ipt_filter_chain_name[filter->dir], entry, &handle)) {
+#endif /* LINUX26 */
 			fprintf(stderr, "%s\n", iptc_strerror(errno));
 			goto err;
@@ -980,5 +997,9 @@
 		}
 
+#ifdef LINUX26
+		if (!insert_entry(ipt_nat_chain_name[fw->target], ipt_target_name[fw->target], entry, &handle)) {
+#else /* LINUX26 */
 		if (!insert_entry(ipt_nat_chain_name[fw->target], entry, &handle)) {
+#endif /* LINUX26 */
 			fprintf(stderr, "%s\n", iptc_strerror(errno));
 			goto err;
@@ -995,5 +1016,9 @@
 		info->to[1] = app->to[1];
 
+#ifdef LINUX26
+		if (!insert_entry("PREROUTING", ipt_target_name[fw->target], entry, &handle)) {
+#else /* LINUX26 */
 		if (!insert_entry("PREROUTING", entry, &handle)) {
+#endif /* LINUX26 */
 			fprintf(stderr, "%s\n", iptc_strerror(errno));
 			goto err;
