diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-01-23 10:45:11 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-01-23 21:43:01 +0100 |
commit | dd357236f156b3be8cc8e4de2787e4ba08f3c68c (patch) | |
tree | ec6ef6458910064d4d9ddfae553d14cc084afd2d /pkg/tcpip/link | |
parent | 9acc1a73ccb686afeaf02dec521311235745ad26 (diff) |
fix indent
Diffstat (limited to 'pkg/tcpip/link')
-rw-r--r-- | pkg/tcpip/link/channel/channel.go | 2 | ||||
-rw-r--r-- | pkg/tcpip/link/gre/gre.go | 34 |
2 files changed, 18 insertions, 18 deletions
diff --git a/pkg/tcpip/link/channel/channel.go b/pkg/tcpip/link/channel/channel.go index caf20e718..3f9d41887 100644 --- a/pkg/tcpip/link/channel/channel.go +++ b/pkg/tcpip/link/channel/channel.go @@ -131,7 +131,7 @@ type Endpoint struct { mtu uint32 linkAddr tcpip.LinkAddress LinkEPCapabilities stack.LinkEndpointCapabilities - NMaxHeaderLength uint16 + NMaxHeaderLength uint16 // Outbound packet queue. q *queue diff --git a/pkg/tcpip/link/gre/gre.go b/pkg/tcpip/link/gre/gre.go index 04f8f8da7..d177c3648 100644 --- a/pkg/tcpip/link/gre/gre.go +++ b/pkg/tcpip/link/gre/gre.go @@ -1,10 +1,10 @@ package gre import ( - "math" - "net" + "math" + "net" "log" - "os" + "os" "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/header" @@ -33,11 +33,11 @@ func New(mtu uint32) *Endpoint{ } func (e *Endpoint) GetChannel() *channel.Endpoint { - return &e.Endpoint + return &e.Endpoint } func (e *Endpoint) Bind(s *stack.Stack, laddr tcpip.FullAddress) { - log.Println("Bind begin") + log.Println("Bind begin") // Create TCP endpoint. var wq waiter.Queue @@ -45,19 +45,19 @@ func (e *Endpoint) Bind(s *stack.Stack, laddr tcpip.FullAddress) { if err != nil { log.Fatal(err) } - log.Println("EP: %s", ep) + log.Println("EP: %s", ep) - raddr := tcpip.FullAddress{NIC: 1, Addr: tcpip.Address(net.ParseIP("10.0.0.1"))} - log.Println("Remote:", raddr.Addr, raddr) + raddr := tcpip.FullAddress{NIC: 1, Addr: tcpip.Address(net.ParseIP("10.0.0.1"))} + log.Println("Remote:", raddr.Addr, raddr) - if err := ep.Bind(tcpip.FullAddress{1, "", 0}); err != nil { - log.Fatal("Bind failed: ", err) - } + if err := ep.Bind(tcpip.FullAddress{1, "", 0}); err != nil { + log.Fatal("Bind failed: ", err) + } + + // if err := ep.Connect(raddr); err != nil { + // log.Fatal("Connect failed: ", err) + // } - // if err := ep.Connect(raddr); err != nil { - // log.Fatal("Connect failed: ", err) - // } - // Issue connect request and wait for it to complete. waitEntry, notifyCh := waiter.NewChannelEntry(nil) @@ -80,13 +80,13 @@ func (e *Endpoint) Bind(s *stack.Stack, laddr tcpip.FullAddress) { } } wq.EventUnregister(&waitEntry) - log.Println("Bind end") + log.Println("Bind end") } // Attach saves the stack network-layer dispatcher for use later when packets // are injected. func (e *Endpoint) Attach(dispatcher stack.NetworkDispatcher) { - log.Println("GRE: Attach") + log.Println("GRE: Attach") e.Endpoint.Attach(dispatcher) } |