Changeset 13527


Ignore:
Timestamp:
12/28/09 14:29:10 (3 years ago)
Author:
eko
Message:

fix for K26 upnp - works good now (need review; why we are using iptables.linksys at all?? )

Location:
src/router/netconf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/router/netconf/Makefile

    r11331 r13527  
    1515 
    1616ifeq ($(CONFIG_MSSID),y) 
     17ifeq ($(CONFIG_BCMMODERN),y) 
     18CFLAGS  = -I. -I$(TOP)/shared -I$(TOP)/iptables/include -I$(SRCBASE)/include.v24 -I$(LINUXDIR)/include -Wall 
     19CFLAGS += -DLINUX26 
     20else 
    1721CFLAGS  = -I. -I$(TOP)/shared -I$(TOP)/iptables.linksys/include -I$(SRCBASE)/include.v24 -I$(LINUXDIR)/include -Wall 
     22endif 
    1823else 
    1924CFLAGS  = -I. -I$(TOP)/shared -I$(TOP)/iptables.linksys/include -I$(SRCBASE)/include.v23 -I$(LINUXDIR)/include -Wall 
    2025endif 
    2126#CFLAGS += -g -DDEBUG 
    22 CFLAGS  += -s -O2 
     27CFLAGS  += -s $(COPTS) 
     28 
     29ifeq ($(CONFIG_BCMMODERN),y) 
     30LDFLAGS = -L. -L$(TOP)/iptables/libiptc/ 
     31else 
    2332LDFLAGS = -L. -L$(TOP)/iptables.linksys/libiptc/ 
     33endif 
    2434 
    2535ifeq ($(CONFIG_MAGICBOX),y) 
  • src/router/netconf/netconf_linux.c

    r1 r13527  
    713713 */ 
    714714static int 
     715#ifdef LINUX26 
     716insert_entry(const char *chain, const char *target_name, struct ipt_entry *entry, iptc_handle_t *handle) 
     717#else /* LINUX26 */ 
    715718insert_entry(const char *chain, struct ipt_entry *entry, iptc_handle_t *handle) 
     719#endif /* LINUX26 */ 
    716720{ 
    717721        int i; 
     
    729733 
    730734        /* 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 */ 
    731744        if (!strcmp(iptc_get_target(entry, handle), "DROP") || 
    732745            !strcmp(iptc_get_target(entry, handle), "logdrop")) 
    733746                return iptc_insert_entry(chain, entry, 0, handle); 
    734  
    735747        /* If accepting insert after the last drop but before the first default policy */ 
    736748        else if (!strcmp(iptc_get_target(entry, handle), "ACCEPT") || 
    737749                 !strcmp(iptc_get_target(entry, handle), "DNAT") ||     // by honor, let UPnP Forwarding is prior to DMZ 
    738750                 !strcmp(iptc_get_target(entry, handle), "logaccept")) { 
     751#endif /* LINUX26 */ 
    739752                for (i = 0, rule = iptc_first_rule(chain, handle); rule; i++, rule = iptc_next_rule(rule, handle)) { 
    740753                        if ((strcmp(iptc_get_target(rule, handle), "DROP") && 
     
    947960                } 
    948961 
     962#ifdef LINUX26 
     963                if (!insert_entry(ipt_filter_chain_name[filter->dir], ipt_target_name[fw->target], entry, &handle)) { 
     964#else /* LINUX26 */ 
    949965                if (!insert_entry(ipt_filter_chain_name[filter->dir], entry, &handle)) { 
     966#endif /* LINUX26 */ 
    950967                        fprintf(stderr, "%s\n", iptc_strerror(errno)); 
    951968                        goto err; 
     
    980997                } 
    981998 
     999#ifdef LINUX26 
     1000                if (!insert_entry(ipt_nat_chain_name[fw->target], ipt_target_name[fw->target], entry, &handle)) { 
     1001#else /* LINUX26 */ 
    9821002                if (!insert_entry(ipt_nat_chain_name[fw->target], entry, &handle)) { 
     1003#endif /* LINUX26 */ 
    9831004                        fprintf(stderr, "%s\n", iptc_strerror(errno)); 
    9841005                        goto err; 
     
    9951016                info->to[1] = app->to[1]; 
    9961017 
     1018#ifdef LINUX26 
     1019                if (!insert_entry("PREROUTING", ipt_target_name[fw->target], entry, &handle)) { 
     1020#else /* LINUX26 */ 
    9971021                if (!insert_entry("PREROUTING", entry, &handle)) { 
     1022#endif /* LINUX26 */ 
    9981023                        fprintf(stderr, "%s\n", iptc_strerror(errno)); 
    9991024                        goto err; 
Note: See TracChangeset for help on using the changeset viewer.