summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/sample/tun_tcp_echo
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-04-17 11:14:24 -0700
committerShentubot <shentubot@google.com>2019-04-17 11:16:35 -0700
commit9f8c89fc7fb7c4588713eb376fa56c4c3026d43c (patch)
treeafa9bea24c4c4685d16e6ef3cb432e9b3ac425ae /pkg/tcpip/sample/tun_tcp_echo
parente8156667179c52c40f54affc085009258ae11092 (diff)
Return error from fdbased.New
RELNOTES: n/a PiperOrigin-RevId: 244031742 Change-Id: Id0cdb73194018fb5979e67b58510ead19b5a2b81
Diffstat (limited to 'pkg/tcpip/sample/tun_tcp_echo')
-rw-r--r--pkg/tcpip/sample/tun_tcp_echo/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/tcpip/sample/tun_tcp_echo/main.go b/pkg/tcpip/sample/tun_tcp_echo/main.go
index b23dc13e7..da6202f97 100644
--- a/pkg/tcpip/sample/tun_tcp_echo/main.go
+++ b/pkg/tcpip/sample/tun_tcp_echo/main.go
@@ -128,12 +128,15 @@ func main() {
log.Fatal(err)
}
- linkID := fdbased.New(&fdbased.Options{
+ linkID, err := fdbased.New(&fdbased.Options{
FD: fd,
MTU: mtu,
EthernetHeader: *tap,
Address: tcpip.LinkAddress(maddr),
})
+ if err != nil {
+ log.Fatal(err)
+ }
if err := s.CreateNIC(1, linkID); err != nil {
log.Fatal(err)
}