mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-25 02:16:11 +07:00
fix: sysctl net.ipv4.conf.dae0peer.accept_local=1 (#512)
Co-authored-by: Sumire (菫) <151038614+sumire88@users.noreply.github.com>
This commit is contained in:
parent
19cacf5900
commit
3764df2af3
@ -289,13 +289,20 @@ func (ns *DaeNetns) setupSysctl() (err error) {
|
||||
return fmt.Errorf("failed to set forwarding for dae0: %v", err)
|
||||
}
|
||||
|
||||
// *_early_demux is not mandatory, but it's recommended to enable it for better performance
|
||||
if err = netns.Set(ns.daeNs); err != nil {
|
||||
return fmt.Errorf("failed to switch to daens: %v", err)
|
||||
}
|
||||
defer netns.Set(ns.hostNs)
|
||||
|
||||
// *_early_demux is not mandatory, but it's recommended to enable it for better performance
|
||||
sysctl.Set("net.ipv4.tcp_early_demux", "1", false)
|
||||
sysctl.Set("net.ipv4.ip_early_demux", "1", false)
|
||||
|
||||
// (ip net e daens) sysctl net.ipv4.conf.dae0peer.accept_local=1
|
||||
// This is to prevent kernel from dropping skb due to "martian source" check: https://elixir.bootlin.com/linux/v6.6/source/net/ipv4/fib_frontend.c#L381
|
||||
if err = sysctl.Set(fmt.Sprintf("net.ipv4.conf.%s.accept_local", NsVethName), "1", false); err != nil {
|
||||
return fmt.Errorf("failed to set accept_local for dae0peer: %v", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user