parent
983b3caf40
commit
2e21cd99ef
1 changed files with 0 additions and 16 deletions
16
tun_linux.go
16
tun_linux.go
|
|
@ -254,10 +254,6 @@ func (t *NativeTun) Name() (string, error) {
|
|||
}
|
||||
|
||||
func (t *NativeTun) Start() error {
|
||||
err := t.disableReversePathFilter()
|
||||
if err != nil && t.options.Logger != nil && t.options.FileDescriptor == 0 {
|
||||
t.options.Logger.Warn(E.Cause(err, "disable reverse path filter"))
|
||||
}
|
||||
if t.options.FileDescriptor != 0 {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -1087,15 +1083,3 @@ func (t *NativeTun) setSearchDomainForSystemdResolved() {
|
|||
_ = shell.Exec(ctlPath, append([]string{"dns", t.options.Name}, common.Map(dnsServer, netip.Addr.String)...)...).Run()
|
||||
}()
|
||||
}
|
||||
|
||||
func (t *NativeTun) disableReversePathFilter() error {
|
||||
err := os.WriteFile("/proc/sys/net/ipv4/conf/all/rp_filter", []byte{'0'}, 0o644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.WriteFile("/proc/sys/net/ipv4/conf/"+t.options.Name+"/rp_filter", []byte{'0'}, 0o644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue