util/linuxfw: update typos
Signed-off-by: KevinLiang10 <kevinliang@tailscale.com>kevinliang10/Iptables_and_nftables_code_refactoring
parent
80b912ace0
commit
2a47cc8e47
2
go.mod
2
go.mod
|
@ -70,6 +70,7 @@ require (
|
|||
github.com/toqueteos/webbrowser v1.2.0
|
||||
github.com/u-root/u-root v0.11.0
|
||||
github.com/vishvananda/netlink v1.2.1-beta.2
|
||||
github.com/vishvananda/netns v0.0.4
|
||||
go.uber.org/zap v1.24.0
|
||||
go4.org/mem v0.0.0-20220726221520-4f986261bf13
|
||||
go4.org/netipx v0.0.0-20230303233057-f1b76eb4bb35
|
||||
|
@ -322,7 +323,6 @@ require (
|
|||
github.com/ultraware/whitespace v0.0.5 // indirect
|
||||
github.com/uudashr/gocognit v1.0.6 // indirect
|
||||
github.com/vbatts/tar-split v0.11.2 // indirect
|
||||
github.com/vishvananda/netns v0.0.4 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/yagipy/maintidx v1.0.0 // indirect
|
||||
|
|
|
@ -799,7 +799,7 @@ func (n *nftablesRunner) AddBase(tunname string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// AddBase4 adds some basic IPv4 processing rules to be
|
||||
// addBase4 adds some basic IPv4 processing rules to be
|
||||
// supplemented by later calls to other helpers.
|
||||
func (n *nftablesRunner) addBase4(tunname string) error {
|
||||
conn := n.conn
|
||||
|
@ -843,7 +843,7 @@ func (n *nftablesRunner) addBase4(tunname string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// AddBase6 adds some basic IPv6 processing rules to be
|
||||
// addBase6 adds some basic IPv6 processing rules to be
|
||||
// supplemented by later calls to other helpers.
|
||||
func (n *nftablesRunner) addBase6(tunname string) error {
|
||||
conn := n.conn
|
||||
|
|
|
@ -379,7 +379,7 @@ func newFakeNftablesRunner(t *testing.T, conn *nftables.Conn) *nftablesRunner {
|
|||
|
||||
func TestAddAndDelNetfilterChains(t *testing.T) {
|
||||
if os.Geteuid() != 0 {
|
||||
t.Skip(t.Name(), " requires priviliges to create a namespace in order to run")
|
||||
t.Skip(t.Name(), " requires privileges to create a namespace in order to run")
|
||||
return
|
||||
}
|
||||
conn, ns := newSysConn(t)
|
||||
|
@ -514,7 +514,7 @@ func findCommonBaseRules(
|
|||
|
||||
func TestNFTAddAndDelNetfilterBase(t *testing.T) {
|
||||
if os.Geteuid() != 0 {
|
||||
t.Skip(t.Name(), " requires priviliges to create a namespace in order to run")
|
||||
t.Skip(t.Name(), " requires privileges to create a namespace in order to run")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -658,7 +658,7 @@ func findLoopBackRule(conn *nftables.Conn, proto nftables.TableFamily, table *nf
|
|||
|
||||
func TestNFTAddAndDelLoopbackRule(t *testing.T) {
|
||||
if os.Geteuid() != 0 {
|
||||
t.Skip(t.Name(), " requires priviliges to create a namespace in order to run")
|
||||
t.Skip(t.Name(), " requires privileges to create a namespace in order to run")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -453,18 +453,18 @@ func (n *fakeIPTablesRunner) AddLoopbackRule(addr netip.Addr) error {
|
|||
}
|
||||
|
||||
func (n *fakeIPTablesRunner) AddBase(tunname string) error {
|
||||
if err := n.AddBase4(tunname); err != nil {
|
||||
if err := n.addBase4(tunname); err != nil {
|
||||
return err
|
||||
}
|
||||
if n.HasIPV6() {
|
||||
if err := n.AddBase6(tunname); err != nil {
|
||||
if err := n.addBase6(tunname); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *fakeIPTablesRunner) AddBase4(tunname string) error {
|
||||
func (n *fakeIPTablesRunner) addBase4(tunname string) error {
|
||||
curIPT := n.ipt4
|
||||
newRules := []struct{ chain, rule string }{
|
||||
{"filter/ts-input", fmt.Sprintf("! -i %s -s %s -j RETURN", tunname, tsaddr.ChromeOSVMRange().String())},
|
||||
|
@ -482,7 +482,7 @@ func (n *fakeIPTablesRunner) AddBase4(tunname string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (n *fakeIPTablesRunner) AddBase6(tunname string) error {
|
||||
func (n *fakeIPTablesRunner) addBase6(tunname string) error {
|
||||
curIPT := n.ipt6
|
||||
newRules := []struct{ chain, rule string }{
|
||||
{"filter/ts-forward", fmt.Sprintf("-i %s -j MARK --set-mark %s/%s", tunname, linuxfw.TailscaleSubnetRouteMark, linuxfw.TailscaleFwmarkMask)},
|
||||
|
|
Loading…
Reference in New Issue