Skip to content

Commit 936b8f9

Browse files
Beginner-Gomsvamp
andauthored
ppp: use modprobe in place of insmod (coolsnowwolf#10191)
This will prevent `module is already loaded` lines from appearing in the logs when a PPP connection is reconnecting Signed-off-by: Manas Sambhus <[email protected]> Signed-off-by: Manas Sambhus <[email protected]> Co-authored-by: Manas Sambhus <[email protected]>
1 parent 5463662 commit 936b8f9

File tree

1 file changed

+4
-14
lines changed
  • package/network/services/ppp/files

1 file changed

+4
-14
lines changed

package/network/services/ppp/files/ppp.sh

+4-14
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ proto_pppoe_setup() {
220220
local config="$1"
221221
local iface="$2"
222222

223-
for module in slhc ppp_generic pppox pppoe; do
224-
/sbin/insmod $module 2>&- >&-
225-
done
223+
/sbin/modprobe -qa slhc ppp_generic pppox pppoe
226224

227225
json_get_var mtu mtu
228226
mtu="${mtu:-1492}"
@@ -271,9 +269,7 @@ proto_pppoa_setup() {
271269
local config="$1"
272270
local iface="$2"
273271

274-
for module in slhc ppp_generic pppox pppoatm; do
275-
/sbin/insmod $module 2>&- >&-
276-
done
272+
/sbin/modprobe -qa slhc ppp_generic pppox pppoatm
277273

278274
json_get_vars atmdev vci vpi encaps
279275

@@ -320,13 +316,8 @@ proto_pptp_setup() {
320316
exit 1
321317
}
322318

323-
local load
324-
for module in slhc ppp_generic ppp_async ppp_mppe ip_gre gre pptp; do
325-
grep -q "^$module " /proc/modules && continue
326-
/sbin/insmod $module 2>&- >&-
327-
load=1
328-
done
329-
[ "$load" = "1" ] && sleep 1
319+
/sbin/modprobe -qa slhc ppp_generic ppp_async ppp_mppe ip_gre gre pptp
320+
sleep 1
330321

331322
ppp_generic_setup "$config" \
332323
plugin pptp.so \
@@ -344,4 +335,3 @@ proto_pptp_teardown() {
344335
[ -f /usr/lib/pppd/*/pppoatm.so ] && add_protocol pppoa
345336
[ -f /usr/lib/pppd/*/pptp.so ] && add_protocol pptp
346337
}
347-

0 commit comments

Comments
 (0)