garypang13 4 жил өмнө
parent
commit
44ddb79d8f

+ 0 - 2
devices/XY-C5/diy.sh

@@ -1,2 +0,0 @@
-rm -rf package/network/services/ppp
-svn co https://github.com/openwrt/openwrt/trunk/package/network/services/ppp package/network/services/ppp

+ 2 - 0
devices/common/diy.sh

@@ -11,6 +11,8 @@ rm -Rf tools/ucl && svn co https://github.com/coolsnowwolf/lede/trunk/tools/ucl
 sed -i 's?zstd$?zstd ucl upx\n$(curdir)/upx/compile := $(curdir)/ucl/compile?g' tools/Makefile
 echo -e "\q" | svn co https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/generic/hack-5.4 target/linux/generic/hack-5.4
 wget -O target/linux/generic/pending-5.4/601-add-kernel-imq-support.patch https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/target/linux/generic/pending-5.4/601-add-kernel-imq-support.patch
+rm -rf package/network/services/ppp
+svn co https://github.com/openwrt/openwrt/trunk/package/network/services/ppp package/network/services/ppp
 sed -i "s/'class': 'table'/'class': 'table memory'/g" package/*/*/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
 sed -i 's/+acme\( \|$\)/+acme +acme-dnsapi\1/g' package/*/*/luci-app-acme/Makefile
 sed -i '$a /etc/sysupgrade.conf' package/base-files/files/lib/upgrade/keep.d/base-files-essential

+ 26 - 24
devices/common/diy/package/network/services/ppp/patches/512-syncppp.patch

@@ -9,21 +9,22 @@
  #ifdef CHAPMS
  #include "chap_ms.h"
  #define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5)
-@@ -481,6 +483,18 @@ chap_respond(struct chap_client_state *cs, int id,
+@@ -492,6 +494,19 @@ chap_respond(struct chap_client_state *c
  	p[2] = len >> 8;
  	p[3] = len;
  
-+	if (npppd > 1) {
-+		if (syncppp(npppd) < 0) {
-+			error("syncppp sync fail");
-+			sem_unlink(SEM_COUNT_NAME);
-+			sem_unlink(SEM_BLOCK_NAME);
-+		} else {
-+			info("syncppp sync succeeded");
-+		}
-+	} else {
-+		info("syncppp not active");
-+	}
++    if (npppd > 1) {
++        if (syncppp(npppd) < 0) {
++            error("syncppp sync fail");
++            sem_unlink(SEM_COUNT_NAME);
++            sem_unlink(SEM_BLOCK_NAME);
++        } else {
++            info("syncppp sync succeeded");
++        }   
++    } else {
++        info("syncppp not active");
++    }
++
 +
  	output(0, response, PPP_HDRLEN + len);
  }
@@ -55,37 +56,38 @@
  #
  COPTS = -O2 -pipe -Wall -g
 -LIBS = -lrt
-+LIBS = -lpthread
++LIBS = -lrt -lpthread
  
  # Uncomment the next line to include support for Microsoft's
  # MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
 --- a/pppd/options.c
 +++ b/pppd/options.c
-@@ -123,6 +123,7 @@ bool	dump_options;		/* print out option values */
+@@ -128,6 +128,7 @@ bool	dump_options;		/* print out option
  bool	dryrun;			/* print out option values and exit */
  char	*domain;		/* domain name set by domain option */
  int	child_wait = 5;		/* # seconds to wait for children at exit */
-+int	npppd = 0;		/* synchronize between multiple pppd */
++int	npppd = 0;      /* synchronize between multiple pppd */
  struct userenv *userenv_list;	/* user environment variables */
  int	dfl_route_metric = -1;	/* metric of the default route to set over the PPP link */
  
-@@ -312,6 +313,9 @@ option_t general_options[] = {
-       "Unset user environment variable",
-       OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
+@@ -342,6 +343,10 @@ option_t general_options[] = {
+       "Set pathname of ipv6-down script",
+       OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
  
 +    { "syncppp", o_int, &npppd,
 +      "sync among multiple pppd when sending chap/pap respond", OPT_PRIO },
 +
-     { "defaultroute-metric", o_int, &dfl_route_metric,
-       "Metric to use for the default route (Linux only; -1 for default behavior)",
-       OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
++
+ #ifdef HAVE_MULTILINK
+     { "multilink", o_bool, &multilink,
+       "Enable multilink operation", OPT_PRIO | 1 },
 --- a/pppd/pppd.h
 +++ b/pppd/pppd.h
-@@ -341,6 +341,7 @@ extern char	*bundle_name;	/* bundle name for multilink */
+@@ -343,6 +343,7 @@ extern char	*bundle_name;	/* bundle name
  extern bool	dump_options;	/* print out option values */
  extern bool	dryrun;		/* check everything, print options, exit */
  extern int	child_wait;	/* # seconds to wait for children at end */
-+extern int	npppd;		/* synchronize between multiple pppd */
++extern int npppd;  /* synchronize between multiple pppd */
  
  #ifdef MAXOCTETS
  extern unsigned int maxoctets;	     /* Maximum octetes per session (in bytes) */
@@ -197,7 +199,7 @@
 +        }
 +    } else {
 +        info("syncppp not active");
-+    }
++    }   
 +
      output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN);
  

+ 1 - 1
devices/common/patches/syncdial.patch

@@ -25,6 +25,6 @@
 +
  	ppp_generic_setup "$config" \
 +		$syncppp_option \
- 		plugin rp-pppoe.so \
+ 		plugin pppoe.so \
  		${ac:+rp_pppoe_ac "$ac"} \
  		${service:+rp_pppoe_service "$service"} \

+ 0 - 3
devices/k2p-32m-usb/diy.sh

@@ -1,7 +1,4 @@
 
-rm -rf package/network/services/ppp
-svn co https://github.com/openwrt/openwrt/trunk/package/network/services/ppp package/network/services/ppp
-
 sed -i 's/PKG_VERSION:=1/PKG_VERSION:=2/' package/feeds/custom/luci-app-bypass/Makefile
 
 sed -i 's/ +lua-maxminddb//' package/feeds/custom/luci-app-bypass/Makefile

+ 0 - 2
devices/newifi-d2/diy.sh

@@ -1,2 +0,0 @@
-rm -rf package/network/services/ppp
-svn co https://github.com/openwrt/openwrt/trunk/package/network/services/ppp package/network/services/ppp

+ 0 - 2
devices/phicomm-k2p/diy.sh

@@ -1,5 +1,3 @@
-rm -rf package/network/services/ppp
-svn co https://github.com/openwrt/openwrt/trunk/package/network/services/ppp package/network/services/ppp
 
 rm -Rf files/etc/profile.d/sysinfo.sh
 

+ 0 - 2
devices/redmi-ac2100/diy.sh

@@ -1,2 +0,0 @@
-rm -rf package/network/services/ppp
-svn co https://github.com/openwrt/openwrt/trunk/package/network/services/ppp package/network/services/ppp

+ 0 - 2
devices/xiaomi-r3p/diy.sh

@@ -1,2 +0,0 @@
-rm -rf package/network/services/ppp
-svn co https://github.com/openwrt/openwrt/trunk/package/network/services/ppp package/network/services/ppp