Commit Graph

89 Commits

Author SHA1 Message Date
Yousong Zhou 85b634f0b4 shadowsocks-libev: add remote server ips to dst bypass ipset
To align with old iptables-based ss-rules implementation.

Supersedes openwrt/packages#20239

Link: https://github.com/openwrt/packages/pull/20239
Signed-off-by: Luis Liou <liouluis@gmail.com>
[minor fixup on commit title, version bump, etc.]
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2024-03-12 16:03:27 +00:00
Fabrice Fontaine 5afe5c9031 treewide: assign PKG_CPE_ID
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2024-02-04 16:16:10 -08:00
Christian Marangi db305165c9 shadowsocks-libev: convert to PCRE2
Convert package to PCRE2 by porting a pending patch from a closed PR.

The PR is old but the code never changed and is simple enough to check
the changes. The patch apply directly with no changes (aside from
commenting out the travis CI file)

The PR was never merged as PCRE2 at times was too new and they were
trying to find a better regex lib.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-10-22 13:23:58 +02:00
Kirill Fertikov d1ad585ca9 shadowsocks-libev: ACL support
Link: https://github.com/openwrt/packages/pull/20647
Signed-off-by: Kirill Fertikov <kirill.fertikov@gmail.com>
[indentation fix]
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2023-04-23 13:54:08 +08:00
Andre Heider e7d9c86503 treewide: refactor to use PKG_BUILD_FLAGS:=lto
See commit 07730ff3 "treewide: add support for "lto" in PKG_BUILD_FLAGS"
on the main repository.

Note: Some packages only added `-flto` to CFLAGS and not LDFLAGS. This
fixes it and properly enables LTO.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-04-08 08:38:54 +02:00
Andre Heider 565866a472 treewide: refactor to use PKG_BUILD_FLAGS:=no-mips16
See commit 5c545bdb "treewide: replace PKG_USE_MIPS16:=0 with
PKG_BUILD_FLAGS:=no-mips16" on the main repository.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-04-08 08:38:54 +02:00
Li Xin 8966f49f9a shadowsocks-libev: ss-rules: Add 'auto-merge' flag to avoid conflicts
Link: https://github.com/openwrt/packages/pull/19872
Signed-off-by: Li Xin <i@crzidea.com>
(squash commits)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2023-01-28 16:47:44 +08:00
Yousong Zhou 04ee032699 shadowsocks-libev: ss-rules: nft rule cleanup on reload
Remove nft rules file generated by ss-rules if ss-rules was or should be
turned off for by configuration.  Use "fw4 restart" instead of "fw4
reload" to force the runtime rule reloading

Ref: https://github.com/openwrt/packages/pull/17937#issuecomment-1207357037
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-08-11 10:44:10 +08:00
Yousong Zhou 58aa859d06 shadowsocks-libev: ss-rules: setup policy rules for udp/ip6
Supersedes: https://github.com/openwrt/packages/pull/18852
Fixes: https://github.com/openwrt/packages/issues/18850
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-08-11 09:54:18 +08:00
Yousong Zhou 512eda2c3b shadowsocks-libev: Revert "dbg"
This reverts commit 0d18bd49f1.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-04-28 03:12:42 +00:00
Yousong Zhou 93162b35c8 shadowsocks-libev: fix compat issue with newer version of ucode
Link: https://github.com/openwrt/packages/issues/18393
Reported-by: Huangbin Zhan <zhanhb88@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-04-28 03:11:06 +00:00
Yousong Zhou 0d18bd49f1 dbg 2022-04-28 02:20:10 +00:00
Yousong Zhou 3623e50e1e shadowsocks-libev: remove now unused file firewall.ss-rules
It was leftover from the previous rewrite of ss-rules.  The built
package has no ref to it so no need to update PKG_RELEASE

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-03-08 15:23:55 +08:00
Yousong Zhou d86ca89e49 shadowsocks-libev: add note on nftables set restriction
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-03-07 10:18:19 +08:00
Zhong Jianxin 2de9035bda shadowsocks-libev: add nft_tcp_extra/nft_udp_extra options
To add extra statement to tcp/udp forward rule, example:

```
config ss_rules 'ss_rules'
    ...
    option nft_tcp_extra 'tcp dport { 80, 443 }' # tcp only forward connections with dport 80 or 443
    option nft_udp_extra 'udp dport { 53 }' # udp only forward connections with dport 53
```

This somewhat restores the old ipt_args functionality.

Signed-off-by: Zhong Jianxin <azuwis@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(Amend README.md a bit)
2022-03-07 10:09:56 +08:00
Yousong Zhou c99cfc3ea3 shadowsocks-libev: update README.md
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-03-01 02:19:35 +00:00
Yousong Zhou fdaf2de2ae shadowsocks-libev: convert to using nft
It will be mostly implemented with ucode templates installed at
/usr/share/ss-rules and called from init script.  The generated nftables
rules will be stored at /etc/nftables.d/

Incompatible changes were introduced as described in the README.md file

 - Netfilter ipset was replaced with nftables sets
 - UCI options ipt_args and dst_forward_recentrst of section ss_rules
   are now deprecated.  The former does not apply to nftables.  The
   later not yet implemented with nftables.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-03-01 10:06:48 +08:00
Yousong Zhou e60310eb2e shadowsocks-libev: ss-rules: request presence of nat table
ss-rules with iptables needs presence of netfilter nat table to work.
ss-rules works before without explicitly requesting it as a dependency
because it's present by default on a pre-firewall4/nftables OpenWrt
install.  We request it explicitly now to make life easier in case
people would like to try ss-rules/iptables on firewall4/nftables enabled
OpenWrt system

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-03-01 10:06:48 +08:00
Yousong Zhou 04dea23c62 shadowsocks-libev: bump to version 3.3.5
Patch removed because the relevant code was removed upstream

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-09-21 17:19:59 +08:00
Yousong Zhou 4418d240a1 shadowsocks-libev: note the deprecation of ss_server.bind_address
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-08-04 11:40:45 +08:00
Yousong Zhou 7d7cbae75e shadowsocks-libev: support ss-server option local_{ipv4,ipv6}_address
At the moment ss-server seems to be the only component using these two
options.  It also accepts "local_address" of either ip4 or ip6 address,
but the meaning is different from that of ss-local, ss-tunnel etc.
where it is for listen bind

With this commit, we start deprecation process of uci option
"bind_address".  The name was replaced with "local_addr" in upstream
project commit 5fa98a66 ("Fix #1911") and available as json config
option "local_address".  This upstream change was released in 3.2.0

Link: 4a42da641b
Link: https://github.com/openwrt/packages/issues/12931
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-08-03 11:52:56 +08:00
Rosen Penev 3d9618c61b shadowsocks-libev: fix compilation with GCC10
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-07-03 11:24:52 +08:00
Huangbin Zhan 0ec746ccb6 treewide: add conffiles
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
2020-05-09 06:06:43 +08:00
Yousong Zhou 2f73c4853b shadowsocks-libev: ignore error from flushing route table
Linux kernel and iproute2 together now implement strict checking of the
existence of route tables.

Previously kernel does not support filtering by table id, now it does
and will error with nlmsgerr "ipv4: FIB table does not exist".

Previously iproute2 dump all routes and filter by table id in userspace,
now this has changed with iproute2 commit c7e6371bc4af ("ip route: Add
protocol, table id and device to dump request")

Error scene

	root@OpenWrt:/# ip route flush table 100
	Error: ipv4: FIB table does not exist.
	Flush terminated
	root@OpenWrt:/# echo $?
	2

Fixes: https://github.com/openwrt/packages/issues/12095
Ref: https://lists.openwall.net/netdev/2019/05/02/105
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-05-06 21:38:53 +08:00
Yousong Zhou b758d897a9 shadowsocks-libev: bump to version 3.3.4
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-01-13 10:14:50 +08:00
Yousong Zhou 0a2b3b3b82 shadowsocks-libev: README.md: more notes on the dns configuration
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-11-06 15:40:24 +00:00
Yousong Zhou 97bada594b shadowsocks-libev: bump to version 3.3.3
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-11-04 04:54:43 +00:00
Yousong Zhou 29991142e2 shadowsocks-libev: bump to version 3.3.2
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-10-14 08:23:07 +00:00
Sven Eckelmann bbb1ea7345 treewide: Change .*GPL.*+ licenses to SPDX compatible identifier
The CONTRIBUTING.md requests an (or multiple) SPDX identifier for GPL
licenses. But a lot of packages did use a different, non-SPDX style with a
"+" at the end instead of "-or-later".

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2019-09-10 07:45:15 +02:00
Yousong Zhou 5d7d44d605 shadowsocks-libev: bump to version 3.3.1
This should fix openwrt/packages#9346 ("shadowsocks-libev: undefined
behavior from unaligned access")

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-08-12 08:21:00 +00:00
Yousong Zhou 5d34dd284a shadowsocks-libev: bump to version 3.3.0
The most notable change was that socket data buffer has been increased
from 2KB to 16KB

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-06-11 17:21:03 +00:00
Deng Qingfang c54a826086 shadowsocks-libev: size optimizations
Use link-time optimization and --gc-sections --as-needed ldflags
Reduces ipk size by 20%

Remove unnecessary dependencies

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
2019-06-10 20:31:10 +08:00
Yousong Zhou 742ab4a928 shadowsocks-libev: README.md: add "incompatible changes" section
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-05-09 06:15:20 +00:00
Yousong Zhou afe7d34240 shadowsocks-libev: move plugin options to server section
Plugin options are properties of shadowsocks deployment as a whole,
including both server and each client components.  Multiple client
instances accessing the same server will need to share the same plugin
settings

With this change, plugin options will need to specified to "server" and
"ss-server" section, not to each component section.

Fixes: c19e949 ("shadowsocks-libev: add plugin options support")
Reference: https://github.com/openwrt/packages/issues/8903#issuecomment-489674137
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-05-09 06:13:44 +00:00
Yousong Zhou c19e949380 shadowsocks-libev: add plugin options support
Reference: https://github.com/openwrt/packages/issues/8903
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-05-06 15:11:09 +00:00
Yousong Zhou 77b71e3980 shadowsocks-libev: add a "forward all" recipe 2019-04-01 15:51:49 +00:00
Yousong Zhou d63fc1ccd7 shadowsocks-libev: bump to version 3.2.5
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-03-15 02:06:55 +00:00
Yousong Zhou 6c14eae757 shadowsocks-libev: bump to version 3.2.4
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-03-04 03:35:19 +00:00
Yousong Zhou b4452ce160 shadowsocks-libev: move --no-delay into json config file
It was introduced in 3.1.0 as a command line argument and was part of
the json config since 3.1.1

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-02-19 21:08:23 +08:00
Yousong Zhou 9cfa29b873 shadowsocks-libev: use jshn.sh for making json config
As suggested by Jeffery To in openwrt/packages#8233

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-02-19 21:08:23 +08:00
Yousong Zhou 40e7e241a3 shadowsocks-libev: flush ipv6 ss-rules on service stop
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-02-16 07:38:13 +00:00
Yousong Zhou b69810b8ec shadowsocks-libev: ss-rules: fix flushing ipv6 rules
"-6" has to be the first argument

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-02-12 11:53:16 +00:00
Yousong Zhou 8cba4a7f8b shadowsocks-libev: ss-rules: tweak for readability
- quash errors on detection of ipv6 nat
 - remove unnecessary rule args "--comment ..." and "-p ..."

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-02-12 11:49:40 +00:00
Yousong Zhou c84a66112c shadowsocks-libev: flush ss rules on entry
Fixes issue reported in openwrt/luci#2527

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-02-11 13:34:56 +00:00
Yousong Zhou c059c283fe shadowsocks-libev: ss-rules: simplify grep_af
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-01-22 07:52:42 +00:00
Yousong Zhou 5fd4687164 shadowsocks-libev: ss-rules: add ipv6 support
It will require support from ip6tables-mod-nat.  The added functionality
will be skipped otherwise.

For $o_dst_bypass6_, include only address blocks in link [1] whose
"Globally Reachable" field are explicitly "False"

Closes openwrt/packages#7508

 [1] IANA IPv6 Special-Purpose Address Registry,
     https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-01-21 15:19:32 +08:00
Yousong Zhou 823a446a94 shadowsocks-libev: bump to version 3.2.3
A short while after 3.2.2 was tagged, it was superseded by 3.2.3 with a
minor fix for aligned memory allocation for 32-bit arch

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-12-03 01:49:37 +00:00
Yousong Zhou 115ca32d01 shadowsocks-libev: bump to version 3.2.1
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-11-12 03:01:30 +00:00
Yousong Zhou 585e8e8572 shadowsocks-libev: README.md: reword text about REDIRECT
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-08-27 08:38:12 +00:00
Yousong Zhou 932cb25b41 shadowsocks-libev: bump to version 3.2.0
Changes summarized by upstream maintainer

  * Add MinGW support by @linusyang.
  * Refine c-ares integration by @xnoreq.
  * Fix building issues with GCC8 by @FlyingheartCN.
  * Minor bug fixes.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-06-04 11:47:17 +08:00