Changeset 12386

Show
Ignore:
Timestamp:
06/26/09 17:08:33 (5 months ago)
Author:
BrainSlayer
Message:

fixes pptp snat issue

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/router/services/networking/firewall.c

    r12384 r12386  
    774774                if (strlen(wanface) > 0) 
    775775                        save2file("-A POSTROUTING -o %s -j SNAT --to-source %s\n",wanface,nvram_safe_get("wan_ipaddr")); 
     776                if (nvram_match("wan_proto", "pptp") && nvram_match("pptp_use_dhcp", "1")) 
     777                { 
     778                    save2file("-A POSTROUTING -o %s -j SNAT --to-source %s\n",nvram_safe_get("pptp_ifname"),nvram_safe_get("pptp_wan_ipaddr")); 
     779                }else 
    776780                if (nvram_match("wan_proto", "pptp")) { 
    777                         save2file("-A POSTROUTING -o %s -j SNAT --to-source %s\n",nvram_safe_get("pptp_ifname"),nvram_safe_get("wan_ipaddr")); 
     781                        struct in_addr ifaddr; 
     782                        osl_ifaddr(nvram_safe_get("pptp_ifname"),&ifaddr); 
     783                        save2file("-A POSTROUTING -o %s -j SNAT --to-source %s\n",nvram_safe_get("pptp_ifname"),inet_ntoa(ifaddr)); 
    778784                } 
    779785                char *method = "MASQUERADE"; 
  • src/router/services/networking/udhcpc.c

    r12380 r12386  
    234234        if (nvram_match("wan_proto", "pptp") 
    235235            && nvram_match("pptp_use_dhcp", "1")) 
    236                 eval("ifconfig", wan_ifname, temp_wan_ipaddr, "netmask", 
    237                      temp_wan_netmask, "up"); 
     236                { 
     237                eval("ifconfig", wan_ifname, temp_wan_ipaddr, "netmask",temp_wan_netmask, "up"); 
     238                nvram_set("pptp_wan_ipaddr",temp_wan_ipaddr); 
     239                } 
    238240        else 
    239241                eval("ifconfig", wan_ifname, nvram_safe_get("wan_ipaddr"), 
  • src/router/services/sysinit/defaults.c

    r12269 r12386  
    253253        {"wan_proto", "pptp", 0},       /* [static|dhcp|pppoe|disabled] */ 
    254254#elif defined(HAVE_GGEW) && defined(HAVE_EOC2610) 
     255        {"wan_proto", "pptp", 0},       /* [static|dhcp|pppoe|disabled] */ 
     256#elif defined(HAVE_GGEW) 
    255257        {"wan_proto", "pptp", 0},       /* [static|dhcp|pppoe|disabled] */ 
    256258#elif HAVE_X86