Skip to content

Commit

Permalink
shadowsocks-libev: ignore error from flushing route table
Browse files Browse the repository at this point in the history
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: openwrt#12095
Ref: https://lists.openwall.net/netdev/2019/05/02/105
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  • Loading branch information
yousong authored and jekkos committed May 22, 2020
1 parent 92a90e7 commit e976349
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions net/shadowsocks-libev/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2017-2019 Yousong Zhou <yszhou4tech@gmail.com>
# Copyright (C) 2017-2020 Yousong Zhou <yszhou4tech@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
Expand All @@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk
#
PKG_NAME:=shadowsocks-libev
PKG_VERSION:=3.3.4
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
Expand Down
2 changes: 1 addition & 1 deletion net/shadowsocks-libev/files/ss-rules
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ss_rules_flush() {

iptables-save --counters | grep -v ss_rules_ | iptables-restore --counters
while ip rule del fwmark 1 lookup 100 2>/dev/null; do true; done
ip route flush table 100
ip route flush table 100 2>/dev/null || true
for setname in $(ipset -n list | grep "ss_rules${o_af}_"); do
ipset destroy "$setname" 2>/dev/null || true
done
Expand Down

0 comments on commit e976349

Please sign in to comment.