From 2e7780471af8efd13345692c11dac0cdb9cd8d35 Mon Sep 17 00:00:00 2001 From: Iurii Egorov Date: Fri, 24 May 2024 18:18:23 +0300 Subject: [PATCH] Remove GetOffloadInfo() (#32) * Remove GetOffloadInfo() * Remove GetOffloadInfo() from bind_windows as well * Allow lightweight tags to be used in the version --- Makefile | 2 +- conn/bind_std.go | 5 ----- conn/bind_windows.go | 4 ---- conn/bindtest/bindtest.go | 2 -- conn/conn.go | 2 -- device/device.go | 1 - 6 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 4087cbae5..7a88647bf 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ MAKEFLAGS += --no-print-directory generate-version-and-build: @export GIT_CEILING_DIRECTORIES="$(realpath $(CURDIR)/..)" && \ - tag="$$(git describe --dirty 2>/dev/null)" && \ + tag="$$(git describe --tags --dirty 2>/dev/null)" && \ ver="$$(printf 'package main\n\nconst Version = "%s"\n' "$$tag")" && \ [ "$$(cat version.go 2>/dev/null)" != "$$ver" ] && \ echo "$$ver" > version.go && \ diff --git a/conn/bind_std.go b/conn/bind_std.go index ea06cd57e..312a5383d 100644 --- a/conn/bind_std.go +++ b/conn/bind_std.go @@ -298,11 +298,6 @@ func (s *StdNetBind) BatchSize() int { return 1 } -func (s *StdNetBind) GetOffloadInfo() string { - return fmt.Sprintf("ipv4TxOffload: %v, ipv4RxOffload: %v\nipv6TxOffload: %v, ipv6RxOffload: %v", - s.ipv4TxOffload, s.ipv4RxOffload, s.ipv6TxOffload, s.ipv6RxOffload) -} - func (s *StdNetBind) Close() error { s.mu.Lock() defer s.mu.Unlock() diff --git a/conn/bind_windows.go b/conn/bind_windows.go index 3481f0042..6cfa09968 100644 --- a/conn/bind_windows.go +++ b/conn/bind_windows.go @@ -328,10 +328,6 @@ func (bind *WinRingBind) BatchSize() int { return 1 } -func (bind *WinRingBind) GetOffloadInfo() string { - return "" -} - func (bind *WinRingBind) SetMark(mark uint32) error { return nil } diff --git a/conn/bindtest/bindtest.go b/conn/bindtest/bindtest.go index 0df1420af..42b0bb704 100644 --- a/conn/bindtest/bindtest.go +++ b/conn/bindtest/bindtest.go @@ -91,8 +91,6 @@ func (c *ChannelBind) Close() error { func (c *ChannelBind) BatchSize() int { return 1 } -func (c *ChannelBind) GetOffloadInfo() string { return "" } - func (c *ChannelBind) SetMark(mark uint32) error { return nil } func (c *ChannelBind) makeReceiveFunc(ch chan []byte) conn.ReceiveFunc { diff --git a/conn/conn.go b/conn/conn.go index 489cb3520..a1f57d2b1 100644 --- a/conn/conn.go +++ b/conn/conn.go @@ -55,8 +55,6 @@ type Bind interface { // BatchSize is the number of buffers expected to be passed to // the ReceiveFuncs, and the maximum expected to be passed to SendBatch. BatchSize() int - - GetOffloadInfo() string } // BindSocketToInterface is implemented by Bind objects that support being diff --git a/device/device.go b/device/device.go index a8a9e2f42..80e379322 100644 --- a/device/device.go +++ b/device/device.go @@ -547,7 +547,6 @@ func (device *Device) BindUpdate() error { } device.log.Verbosef("UDP bind has been updated") - device.log.Verbosef(netc.bind.GetOffloadInfo()) return nil }