SHA256
1
0
forked from pool/rp-pppoe
rp-pppoe/rp-pppoe-3.14-nonrfc-modems.patch
Илья Индиго 5da48bef51 Accepting request 809720 from home:13ilya:branches:network
- Refresh spec-file via spec-cleaner and manual optimisations.
  * Add make_build and autopatch macros.
  * Remove group tag and obsoleted conditions.
- Refresh and rename patches:
  * docdir.diff to rp-pppoe-3.14-docdir.patch
  * nonrfc-modems.diff to rp-pppoe-3.14-nonrfc-modems.patch
  * release-buildsystem.diff to rp-pppoe-3.14-release-buildsystem.patch
  * resolve-conf.diff to rp-pppoe-3.14-resolve-conf.patch
  * rp-pppoe-3.10-config.patch to rp-pppoe-3.14-config.patch
  * rp-pppoe-3.10-init.patch to rp-pppoe-3.14-init.patch
  * rp-pppoe-pie.patch to rp-pppoe-3.14-pie.patch
  * strip.diff to rp-pppoe-3.14-strip.patch
- Update to 3.14
  * Add -H and -M options for sending HURL and MOTM packets respectively.
  * Change VERSION macro to RP_VERSION to avoid conflict with pppd macro.

OBS-URL: https://build.opensuse.org/request/show/809720
OBS-URL: https://build.opensuse.org/package/show/network/rp-pppoe?expand=0&rev=28
2020-05-28 01:34:41 +00:00

65 lines
2.5 KiB
Diff

diff -Pdpru rp-pppoe-3.14.orig/scripts/pppoe-setup.in rp-pppoe-3.14/scripts/pppoe-setup.in
--- rp-pppoe-3.14.orig/scripts/pppoe-setup.in 2020-05-27 03:29:37.000000000 +0300
+++ rp-pppoe-3.14/scripts/pppoe-setup.in 2020-05-28 02:55:29.251934958 +0300
@@ -109,6 +109,42 @@ while [ true ] ; do
fi
echo ""
+ echo "MODEM TYPE"
+ echo ""
+ echo "We will try to detect if your modem is compliant with RFC 2516"
+ echo "or not. 3COM's 3CP4130 is *NOT* compliant, for instance."
+ echo ""
+ echo "Searching for a modem at interface $E..."
+ $PPPOE -A -I $E > /dev/null 2>&1
+ if [ $? -eq 1 ]; then
+ # not found
+ # try 3COM's
+ echo ""
+ echo "Not found, trying with 3COM's code..."
+ result=`$PPPOE -A -I $E -f 3c12:3c13 2>/dev/null`
+ if [ $? -eq 0 ]; then
+ echo "Non-RFC2516 compliant modem found! Probably 3CP4130..."
+ echo "Probing for service name..."
+ service=`echo "$result" | grep Service-Name | grep -v "3Com DL Manager" | cut -d : -f 2`
+ if [ -n "$service" ]; then
+ echo "Found service name = $service"
+ PPPOE_EXTRA="-f 3c12:3c13 -S $service"
+ else
+ echo "Couldn't find a service name, proceeding without one..."
+ PPPOE_EXTRA="-f 3c12:3c13"
+ fi
+ else
+ echo ""
+ echo "Didn't find a modem at interface $E, you can continue but"
+ echo "things might not work as you expect... :("
+ echo "You might want to re-run this script and try a different interface."
+ fi
+ else
+ echo "Found a RFC 2516 compliant modem, congratulations! :)"
+ PPPOE_EXTRA=""
+ fi
+
+ echo ""
echo "Do you want the link to come up on demand, or stay up continuously?"
echo "If you want it to come up on demand, enter the idle time in seconds"
echo "after which the link should be dropped. If you want the link to"
@@ -220,6 +256,9 @@ while [ true ] ; do
echo "** Summary of what you entered **"
echo ""
echo "Ethernet Interface: $E"
+ if [ -n "$PPPOE_EXTRA" ]; then
+ echo "Extra parameters for modem (autodetected): \"$PPPOE_EXTRA\""
+ fi
echo "User name: $U"
if [ "$D" = "no" ] ; then
echo "Activate-on-demand: No"
@@ -296,6 +335,7 @@ sed -e "s&^USER=.*&USER='$U'&" \
-e "s/^DNS1=.*/DNS1=$DNS1/" \
-e "s/^DNS2=.*/DNS2=$DNS2/" \
-e "s/^PEERDNS=.*/PEERDNS=$PEERDNS/" \
+ -e "s/^PPPOE_EXTRA=.*/PPPOE_EXTRA=\"$PPPOE_EXTRA\"/" \
< $CONFIG-bak > $CONFIG
if [ $? != 0 ] ; then