diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-10-10 14:58:12 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-10-10 14:58:12 +0000 |
commit | 5a8864448ad4a2b391848e034e9ebca834544dfd (patch) | |
tree | 97ce8a14c3bd30b958dcd8bae7f53d9bebf646de /package/network/services | |
parent | 08715f05efd98e0d09b8a96f2385936d86aff13d (diff) | |
download | upstream-5a8864448ad4a2b391848e034e9ebca834544dfd.tar.gz upstream-5a8864448ad4a2b391848e034e9ebca834544dfd.tar.bz2 upstream-5a8864448ad4a2b391848e034e9ebca834544dfd.zip |
ppp: correct module loaded check in proto_pptp_setup
proto_pptp_setup is responsible for loading the required modules to establish
a pptp connection to a foreign peer. The function checks whether all required
modules are already loaded, before actually loading them.
It seems that the filter being used to accomplish this, is not restrictive
enough in some cases. For instance when pptp nat helper modules are present on
a system, and already loaded before a pptp connection is enabled. Then the
search filter (possibly) returns the following for module=pptp, where actually
no matches are expected, resulting in the pptp.ko module not being loaded,
thereby failing to establish the pptp connection.
# module="pptp" ; grep "$module" /proc/modules
nf_nat_pptp 1312 0 - Live 0x86ce7000
nf_conntrack_pptp 3072 1 nf_nat_pptp, Live 0x86cb9000
nf_nat_proto_gre 784 1 nf_nat_pptp, Live 0x86cba000
nf_conntrack_proto_gre 2368 1 nf_conntrack_pptp, Live 0x86cbf000
nf_nat 9792 13 nf_nat_rtsp,nf_nat_tftp,nf_nat_sip,nf_nat_pptp,nf_nat_h323,nf_nat_proto_gre,nf_nat_amanda,nf_nat_irc,nf_nat_ftp,ipt_REDIRECT,ipt_NETMAP,ipt_MASQUERADE,iptable_nat, Live 0x86ca8000
nf_conntrack 37264 31 nf_nat_rtsp,nf_conntrack_rtsp,nf_nat_tftp,nf_conntrack_tftp,nf_nat_snmp_basic,nf_conntrack_snmp,nf_nat_sip,nf_conntrack_sip,nf_nat_pptp,nf_conntrack_pptp,nf_nat_h323,nf_conntrack_h323,nf_conntrack_proto_gre,nf_nat_amanda,nf_conntrack_amanda,nf_conntrack_broadcast,nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_conntrack_ftp,ipt_MASQUERADE,iptable_nat,nf_nat,xt_helper,xt_connmark,xt_connbytes,xt_conntrack,xt_CT,xt_NOTRACK,xt_state,nf_conntrack_ipv4, Live 0x86c90000
The search filter can be made more accurate/restrictive, by requiring the
occurance of the exact name of the module at the beginning of a line in
/proc/modules.
# module="pptp" ; grep "^$module " /proc/modules
pptp 13296 2 - Live 0x86e80000
Signed-off-by: Tijs Van Buggenhout <tvb@able.be>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38358 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services')
-rwxr-xr-x | package/network/services/ppp/files/ppp.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 43a7de9658..02b40558ca 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -190,7 +190,7 @@ proto_pptp_setup() { local load for module in slhc ppp_generic ppp_async ppp_mppe ip_gre gre pptp; do - grep -q "$module" /proc/modules && continue + grep -q "^$module " /proc/modules && continue /sbin/insmod $module 2>&- >&- load=1 done |