mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +02:00
Satisfying staticcheck linter
This commit is contained in:
committed by
Cuong Manh Le
parent
5dd6336953
commit
d292e03d1b
@@ -98,11 +98,9 @@ func (m *mdns) probeLoop(conns []*net.UDPConn, remoteAddr net.Addr, quitCh chan
|
||||
if err != nil {
|
||||
ctrld.ProxyLogger.Load().Warn().Err(err).Msg("error while probing mdns")
|
||||
bo.BackOff(context.Background(), errors.New("mdns probe backoff"))
|
||||
continue
|
||||
}
|
||||
select {
|
||||
case <-quitCh:
|
||||
break
|
||||
}
|
||||
break
|
||||
}
|
||||
<-quitCh
|
||||
for _, conn := range conns {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//lint:file-ignore U1000 satisfy CI.
|
||||
//lint:file-ignore U1000 Ignore, this file is forked from upstream code.
|
||||
//lint:file-ignore ST1005 Ignore, this file is forked from upstream code.
|
||||
|
||||
package dns
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//lint:file-ignore U1000 Ignore this file, it's a copy.
|
||||
|
||||
package dns
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
@@ -116,6 +117,11 @@ func (or *osRouter) Cleanup() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func isPfsense() bool {
|
||||
b, err := os.ReadFile("/etc/platform")
|
||||
return err == nil && bytes.HasPrefix(b, []byte("pfSense"))
|
||||
}
|
||||
|
||||
const bsdInitScript = `#!/bin/sh
|
||||
|
||||
# PROVIDE: {{.Name}}
|
||||
|
||||
@@ -93,8 +93,7 @@ func IsOldOpenwrt() bool {
|
||||
var routerPlatform atomic.Pointer[router]
|
||||
|
||||
type router struct {
|
||||
name string
|
||||
sendClientInfo bool
|
||||
name string
|
||||
}
|
||||
|
||||
// Name returns name of the router platform.
|
||||
@@ -241,8 +240,3 @@ func unameU() []byte {
|
||||
out, _ := exec.Command("uname", "-u").Output()
|
||||
return out
|
||||
}
|
||||
|
||||
func isPfsense() bool {
|
||||
b, err := os.ReadFile("/etc/platform")
|
||||
return err == nil && bytes.HasPrefix(b, []byte("pfSense"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user