From 6f1ec9a4d68d596d090f84e5c825e538ee569b8c Mon Sep 17 00:00:00 2001 From: mzz2017 <2017@duck.com> Date: Tue, 7 Feb 2023 00:17:55 +0800 Subject: [PATCH] chore: replace route 0.0.0.0/0 with default --- component/control/control_plane_core.go | 4 ++-- component/control/kern/tproxy.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/component/control/control_plane_core.go b/component/control/control_plane_core.go index 0186dcb..a3e2586 100644 --- a/component/control/control_plane_core.go +++ b/component/control/control_plane_core.go @@ -121,7 +121,7 @@ func (c *ControlPlaneCore) BindLan(ifname string) error { var output []byte if output, err = exec.Command("sh", "-c", ` ip rule add fwmark 0x80000000/0x80000000 table 2023 - ip route add local 0.0.0.0/0 dev lo table 2023 + ip route add local default dev lo table 2023 ip -6 rule add fwmark 0x80000000/0x80000000 table 2023 ip -6 route add local ::/0 dev lo table 2023 `).CombinedOutput(); err != nil { @@ -130,7 +130,7 @@ func (c *ControlPlaneCore) BindLan(ifname string) error { c.deferFuncs = append(c.deferFuncs, func() error { return exec.Command("sh", "-c", ` ip rule del fwmark 0x80000000/0x80000000 table 2023 - ip route del local 0.0.0.0/0 dev lo table 2023 + ip route del local default dev lo table 2023 ip -6 rule del fwmark 0x80000000/0x80000000 table 2023 ip -6 route del local ::/0 dev lo table 2023 `).Run() diff --git a/component/control/kern/tproxy.c b/component/control/kern/tproxy.c index c586c3a..458541a 100644 --- a/component/control/kern/tproxy.c +++ b/component/control/kern/tproxy.c @@ -1179,12 +1179,12 @@ int tproxy_lan_ingress(struct __sk_buff *skb) { /** ip rule add fwmark 0x80000000/0x80000000 table 2023 - ip route add local 0.0.0.0/0 dev lo table 2023 + ip route add local default dev lo table 2023 ip -6 rule add fwmark 0x80000000/0x80000000 table 2023 ip -6 route add local ::/0 dev lo table 2023 ip rule del fwmark 0x80000000/0x80000000 table 2023 - ip route del local 0.0.0.0/0 dev lo table 2023 + ip route del local default dev lo table 2023 ip -6 rule del fwmark 0x80000000/0x80000000 table 2023 ip -6 route del local ::/0 dev lo table 2023 */