Changeset 13527
- Timestamp:
- 12/28/09 14:29:10 (3 years ago)
- Location:
- src/router/netconf
- Files:
-
- 2 edited
-
Makefile (modified) (1 diff)
-
netconf_linux.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/netconf/Makefile
r11331 r13527 15 15 16 16 ifeq ($(CONFIG_MSSID),y) 17 ifeq ($(CONFIG_BCMMODERN),y) 18 CFLAGS = -I. -I$(TOP)/shared -I$(TOP)/iptables/include -I$(SRCBASE)/include.v24 -I$(LINUXDIR)/include -Wall 19 CFLAGS += -DLINUX26 20 else 17 21 CFLAGS = -I. -I$(TOP)/shared -I$(TOP)/iptables.linksys/include -I$(SRCBASE)/include.v24 -I$(LINUXDIR)/include -Wall 22 endif 18 23 else 19 24 CFLAGS = -I. -I$(TOP)/shared -I$(TOP)/iptables.linksys/include -I$(SRCBASE)/include.v23 -I$(LINUXDIR)/include -Wall 20 25 endif 21 26 #CFLAGS += -g -DDEBUG 22 CFLAGS += -s -O2 27 CFLAGS += -s $(COPTS) 28 29 ifeq ($(CONFIG_BCMMODERN),y) 30 LDFLAGS = -L. -L$(TOP)/iptables/libiptc/ 31 else 23 32 LDFLAGS = -L. -L$(TOP)/iptables.linksys/libiptc/ 33 endif 24 34 25 35 ifeq ($(CONFIG_MAGICBOX),y) -
src/router/netconf/netconf_linux.c
r1 r13527 713 713 */ 714 714 static int 715 #ifdef LINUX26 716 insert_entry(const char *chain, const char *target_name, struct ipt_entry *entry, iptc_handle_t *handle) 717 #else /* LINUX26 */ 715 718 insert_entry(const char *chain, struct ipt_entry *entry, iptc_handle_t *handle) 719 #endif /* LINUX26 */ 716 720 { 717 721 int i; … … 729 733 730 734 /* If dropping insert at the beginning of the chain */ 735 #ifdef LINUX26 736 if (!strcmp(target_name, "DROP") || 737 !strcmp(target_name, "logdrop")) 738 return iptc_insert_entry(chain, entry, 0, handle); 739 /* If accepting insert after the last drop but before the first default policy */ 740 else if (!strcmp(target_name, "ACCEPT") || 741 !strcmp(target_name, "DNAT") || // by honor, let UPnP Forwarding is prior to DMZ 742 !strcmp(target_name, "logaccept")) { 743 #else /* LINUX26 */ 731 744 if (!strcmp(iptc_get_target(entry, handle), "DROP") || 732 745 !strcmp(iptc_get_target(entry, handle), "logdrop")) 733 746 return iptc_insert_entry(chain, entry, 0, handle); 734 735 747 /* If accepting insert after the last drop but before the first default policy */ 736 748 else if (!strcmp(iptc_get_target(entry, handle), "ACCEPT") || 737 749 !strcmp(iptc_get_target(entry, handle), "DNAT") || // by honor, let UPnP Forwarding is prior to DMZ 738 750 !strcmp(iptc_get_target(entry, handle), "logaccept")) { 751 #endif /* LINUX26 */ 739 752 for (i = 0, rule = iptc_first_rule(chain, handle); rule; i++, rule = iptc_next_rule(rule, handle)) { 740 753 if ((strcmp(iptc_get_target(rule, handle), "DROP") && … … 947 960 } 948 961 962 #ifdef LINUX26 963 if (!insert_entry(ipt_filter_chain_name[filter->dir], ipt_target_name[fw->target], entry, &handle)) { 964 #else /* LINUX26 */ 949 965 if (!insert_entry(ipt_filter_chain_name[filter->dir], entry, &handle)) { 966 #endif /* LINUX26 */ 950 967 fprintf(stderr, "%s\n", iptc_strerror(errno)); 951 968 goto err; … … 980 997 } 981 998 999 #ifdef LINUX26 1000 if (!insert_entry(ipt_nat_chain_name[fw->target], ipt_target_name[fw->target], entry, &handle)) { 1001 #else /* LINUX26 */ 982 1002 if (!insert_entry(ipt_nat_chain_name[fw->target], entry, &handle)) { 1003 #endif /* LINUX26 */ 983 1004 fprintf(stderr, "%s\n", iptc_strerror(errno)); 984 1005 goto err; … … 995 1016 info->to[1] = app->to[1]; 996 1017 1018 #ifdef LINUX26 1019 if (!insert_entry("PREROUTING", ipt_target_name[fw->target], entry, &handle)) { 1020 #else /* LINUX26 */ 997 1021 if (!insert_entry("PREROUTING", entry, &handle)) { 1022 #endif /* LINUX26 */ 998 1023 fprintf(stderr, "%s\n", iptc_strerror(errno)); 999 1024 goto err;
Note: See TracChangeset
for help on using the changeset viewer.
