Changeset 27669


Ignore:
Timestamp:
2011-07-18T00:42:29+02:00 (7 years ago)
Author:
jow
Message:

[package] pptp: properly support symbolic VPN host names, tear down created host routes (#4876)

Location:
trunk/package/pptp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/pptp/Makefile

    r23253 r27669  
    11# 
    2 # Copyright (C) 2006-2008 OpenWrt.org 
     2# Copyright (C) 2006-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=pptp 
    1111PKG_VERSION:=1.7.1 
    12 PKG_RELEASE:=3 
     12PKG_RELEASE:=4 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     
    2424  MAINTAINER:=Jo-Philipp Wich <xm@subsignal.org> 
    2525  URL:=http://pptpclient.sourceforge.net/ 
    26   DEPENDS:=+ppp +kmod-gre 
     26  DEPENDS:=+ppp +kmod-gre +resolveip 
    2727endef 
    2828 
  • trunk/package/pptp/files/pptp.sh

    r21590 r27669  
    99stop_interface_pptp() { 
    1010        stop_interface_ppp "$1" 
     11        for ip in $(uci_get_state network "$1" serv_addrs); do 
     12                route del -host "$ip" 2>/dev/null 
     13        done 
    1114} 
    1215 
     
    4043        local gw="$(find_gw)" 
    4144        [ -n "$gw" ] && { 
    42                 [ "$gw" != 0.0.0.0 ] && route delete "$server" 2>/dev/null >/dev/null 
    43                 route add "$server" gw "$gw" 
     45                local serv_addrs="" 
     46                for ip in $(resolveip -4 -t 3 "$server"); do 
     47                        append serv_addrs "$ip" 
     48                        route delete -host "$ip" 2>/dev/null 
     49                        route add -host "$ip" gw "$gw" 
     50                done 
     51                uci_toggle_state network "$config" serv_addrs "$serv_addrs" 
    4452        } 
    4553 
Note: See TracChangeset for help on using the changeset viewer.