summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMilan Lenco <milan.lenco@pantheon.tech>2021-01-21 13:53:33 +0100
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2021-02-13 18:54:31 +0900
commit3339f97722e35d5ff351ef500de1e61344cbd33d (patch)
tree600f85f5a0cd1440670c62c3fd881a3a6efb0645
parentc89a32ea7bbed1780b93431e2f94482df462206e (diff)
feat: add option to bind listener to a (VRF) device
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
-rw-r--r--api/gobgp.pb.go219
-rw-r--r--api/gobgp.proto1
-rw-r--r--pkg/server/server.go52
-rw-r--r--pkg/server/sockopt.go9
-rw-r--r--pkg/server/sockopt_bsd.go9
-rw-r--r--pkg/server/sockopt_darwin.go9
-rw-r--r--pkg/server/sockopt_linux.go16
-rw-r--r--pkg/server/sockopt_openbsd.go13
-rw-r--r--pkg/server/util.go8
9 files changed, 164 insertions, 172 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go
index df97552b..7201ad7f 100644
--- a/api/gobgp.pb.go
+++ b/api/gobgp.pb.go
@@ -5314,6 +5314,7 @@ type Global struct {
Confederation *Confederation `protobuf:"bytes,9,opt,name=confederation" json:"confederation,omitempty"`
GracefulRestart *GracefulRestart `protobuf:"bytes,10,opt,name=graceful_restart,json=gracefulRestart" json:"graceful_restart,omitempty"`
ApplyPolicy *ApplyPolicy `protobuf:"bytes,11,opt,name=apply_policy,json=applyPolicy" json:"apply_policy,omitempty"`
+ BindToDevice string `protobuf:"bytes,12,opt,name=bind_to_device,json=bindToDevice" json:"bind_to_device,omitempty"`
}
func (m *Global) Reset() { *m = Global{} }
@@ -5398,6 +5399,13 @@ func (m *Global) GetApplyPolicy() *ApplyPolicy {
return nil
}
+func (m *Global) GetBindToDevice() string {
+ if m != nil {
+ return m.BindToDevice
+ }
+ return ""
+}
+
type Confederation struct {
Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"`
Identifier uint32 `protobuf:"varint,2,opt,name=identifier" json:"identifier,omitempty"`
@@ -7897,14 +7905,14 @@ var _GobgpApi_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("gobgp.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
- // 8106 bytes of a gzipped FileDescriptorProto
+ // 8126 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x4b, 0x6c, 0x23, 0x49,
0x96, 0x58, 0xf3, 0x23, 0x8a, 0x7c, 0x24, 0xc5, 0x54, 0x48, 0x25, 0xa9, 0x54, 0x5d, 0x9f, 0xce,
0xe9, 0xee, 0xaa, 0xae, 0xae, 0xae, 0xae, 0xaa, 0xee, 0xa9, 0xee, 0xa9, 0xde, 0xfe, 0xb0, 0x24,
0x96, 0x8a, 0x53, 0x14, 0xc9, 0x0e, 0x52, 0xd5, 0xd5, 0x63, 0x8f, 0x73, 0x53, 0xcc, 0x20, 0x95,
0xee, 0x64, 0x66, 0x4e, 0x66, 0x52, 0x25, 0xed, 0xc5, 0xb3, 0xb3, 0xeb, 0x31, 0x0c, 0xc3, 0x80,
- 0x61, 0x1f, 0xf6, 0xe0, 0x31, 0x6c, 0xd8, 0x17, 0xc3, 0xb0, 0x7d, 0xb2, 0x0f, 0x86, 0x0f, 0x36,
- 0x0c, 0x1f, 0x0c, 0x2f, 0xe0, 0x93, 0xcf, 0x36, 0x60, 0xf8, 0x6c, 0xc0, 0x17, 0x9f, 0x8d, 0xf8,
+ 0x61, 0x1f, 0xf6, 0xe0, 0x31, 0x6c, 0xd8, 0x17, 0xc3, 0xb0, 0x7d, 0xb2, 0x0f, 0x86, 0x2f, 0x86,
+ 0xe1, 0x83, 0xe1, 0x05, 0x7c, 0xf2, 0xd9, 0x06, 0x0c, 0xfb, 0x6a, 0xc0, 0x17, 0x9f, 0x8d, 0xf8,
0x64, 0x66, 0x64, 0x26, 0x29, 0xa9, 0xaa, 0x7b, 0x66, 0x77, 0x81, 0x3d, 0x89, 0xf1, 0xde, 0x8b,
0x17, 0xbf, 0x17, 0xef, 0xbd, 0x78, 0x11, 0xf9, 0x04, 0xd5, 0x89, 0x73, 0x38, 0x71, 0xef, 0xba,
0x9e, 0x13, 0x38, 0xa8, 0xcc, 0x0a, 0xba, 0x6b, 0x6e, 0x5f, 0x9e, 0x38, 0xce, 0xc4, 0x22, 0x1f,
@@ -7923,7 +7931,7 @@ var fileDescriptor2 = []byte{
0x22, 0xa3, 0xfb, 0x7d, 0x58, 0x3d, 0x70, 0x0d, 0x3d, 0x39, 0xba, 0x0b, 0x54, 0x44, 0x37, 0x41,
0x31, 0x1c, 0xcd, 0x77, 0xc6, 0x81, 0xe6, 0x11, 0x9f, 0x04, 0x9a, 0x69, 0x8b, 0xce, 0xd5, 0x0d,
0x67, 0xe0, 0x8c, 0x03, 0x4c, 0xa1, 0x6d, 0x5b, 0xdd, 0x01, 0x24, 0xb7, 0x20, 0xfa, 0xf6, 0x01,
- 0xac, 0xd9, 0x84, 0x18, 0x7e, 0x8a, 0x43, 0x8e, 0x0f, 0x8f, 0xa1, 0x64, 0x26, 0xff, 0x3b, 0x07,
+ 0xac, 0xd9, 0x84, 0x18, 0x7e, 0x8a, 0x43, 0x8e, 0x0f, 0x8f, 0xa1, 0x64, 0x26, 0xff, 0x2b, 0x07,
0x0a, 0xfb, 0x7d, 0xb1, 0x99, 0x7b, 0x1b, 0xea, 0x23, 0x67, 0x3a, 0x9d, 0xd9, 0xe6, 0x48, 0x0f,
0x4c, 0xc7, 0x16, 0x0b, 0x91, 0x04, 0x22, 0x04, 0x45, 0xda, 0xfa, 0x56, 0x81, 0x35, 0xca, 0x7e,
0xa3, 0x67, 0x50, 0x31, 0x4c, 0x8f, 0x8c, 0x58, 0xad, 0xe2, 0x8d, 0xdc, 0xad, 0x95, 0x07, 0x1f,
@@ -7944,7 +7952,7 @@ var fileDescriptor2 = []byte{
0x33, 0xa4, 0xb8, 0xe1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08, 0xbc, 0xf0, 0xc8, 0x39, 0x9f, 0x56, 0xd0, 0xa0, 0x3b,
0x50, 0xd0, 0x27, 0x44, 0x04, 0x6b, 0xb6, 0x33, 0xa4, 0xc3, 0xf0, 0xba, 0x15, 0x53, 0x32, 0xaa,
@@ -8092,7 +8100,7 @@ var fileDescriptor2 = []byte{
0x84, 0x9c, 0x6c, 0xce, 0xb9, 0xaf, 0xfd, 0x73, 0x24, 0x2c, 0x77, 0xa0, 0x68, 0xda, 0x63, 0x47,
0xc8, 0xca, 0xd6, 0x9c, 0xce, 0x72, 0x81, 0x61, 0x54, 0x7f, 0x29, 0x2f, 0xb2, 0xbc, 0x3c, 0x85,
0x46, 0xea, 0xde, 0x7a, 0xa1, 0xfe, 0xba, 0x9a, 0xb8, 0xc8, 0x17, 0x4f, 0x7f, 0xe2, 0xf7, 0x02,
- 0xff, 0x25, 0x07, 0x55, 0x49, 0x9c, 0xd0, 0x27, 0x50, 0x31, 0xed, 0xa4, 0xe0, 0x9d, 0x15, 0xe4,
+ 0xff, 0x39, 0x07, 0x55, 0x49, 0x9c, 0xd0, 0x27, 0x50, 0x31, 0xed, 0xa4, 0xe0, 0x9d, 0x15, 0xe4,
0x29, 0x9b, 0xb6, 0xa8, 0xf8, 0x25, 0xd4, 0xc9, 0x09, 0x9d, 0xcc, 0xb0, 0x72, 0xfe, 0xdc, 0xca,
0x35, 0x5e, 0x21, 0x66, 0x60, 0x4e, 0x65, 0x06, 0x85, 0xf3, 0x19, 0xf0, 0x0a, 0xe2, 0xbe, 0xe7,
0xef, 0xe5, 0xa0, 0xca, 0x95, 0x79, 0xc7, 0x9c, 0x9a, 0xaf, 0x10, 0x67, 0x40, 0x6f, 0x41, 0x6d,
@@ -8166,7 +8174,7 @@ var fileDescriptor2 = []byte{
0x35, 0x6d, 0x73, 0x3a, 0x9b, 0x6a, 0x7a, 0xf8, 0xf5, 0x08, 0x3d, 0xe1, 0xa5, 0xaf, 0x08, 0xdf,
0x14, 0x54, 0x4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x95, 0xae, 0x4a, 0xce, 0x9e, 0xf4, 0x68, 0x69, 0x3f, 0x4f, 0x2e, 0xed, 0xcd, 0xf3, 0x19,
@@ -8257,7 +8265,7 @@ var fileDescriptor2 = []byte{
0xb7, 0x07, 0x00, 0xec, 0xf1, 0xf6, 0x82, 0x6f, 0xd6, 0x19, 0x1d, 0xff, 0x66, 0x7d, 0x1a, 0xfe,
0x9c, 0xfb, 0x81, 0xe8, 0x08, 0x6a, 0xa9, 0xe3, 0x4e, 0x55, 0xcc, 0x92, 0xc4, 0x58, 0xda, 0xdf,
0x32, 0x31, 0xe3, 0x0f, 0x56, 0xf4, 0x1b, 0x6d, 0x40, 0x49, 0x3a, 0x4f, 0xd5, 0xb1, 0x28, 0xa9,
- 0xff, 0x75, 0x09, 0x60, 0xc7, 0xb1, 0x0d, 0x93, 0xab, 0x92, 0xfb, 0x00, 0x42, 0x01, 0xc4, 0x5f,
+ 0xff, 0x65, 0x09, 0x60, 0xc7, 0xb1, 0x0d, 0x93, 0xab, 0x92, 0xfb, 0x00, 0x42, 0x01, 0xc4, 0x5f,
0x9e, 0xa2, 0x54, 0xdf, 0x07, 0x24, 0xc0, 0x15, 0x4e, 0x45, 0x87, 0xfb, 0x63, 0xa8, 0x45, 0xd7,
0x9c, 0xb4, 0x52, 0x7e, 0x61, 0xa5, 0xe8, 0x15, 0x31, 0xad, 0xf6, 0x7b, 0xb0, 0x92, 0x3a, 0xe8,
0x65, 0xd5, 0xaf, 0x34, 0x20, 0x5c, 0xd3, 0xe5, 0xb9, 0x78, 0x00, 0xd5, 0xb0, 0x36, 0x6d, 0xb3,
@@ -8281,7 +8289,7 @@ var fileDescriptor2 = []byte{
0x3c, 0x5e, 0x42, 0x2a, 0xd4, 0xa9, 0x5f, 0x60, 0x91, 0x71, 0xa0, 0x4d, 0x1d, 0x3f, 0xfc, 0x58,
0xb2, 0x3a, 0xf3, 0x49, 0x87, 0x8c, 0x83, 0x7d, 0xc7, 0x0f, 0xd4, 0xcf, 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xcf, 0x77, 0x36, 0x59, 0xfd, 0x8c, 0xf9, 0xba, 0x08, 0x0b,
+ 0x61, 0xbe, 0x18, 0x83, 0x94, 0x16, 0x94, 0xab, 0x6f, 0xcf, 0x43, 0x45, 0x33, 0x13, 0xf9, 0x66,
+ 0xe9, 0x7e, 0x64, 0x52, 0xa3, 0x5e, 0xc0, 0x37, 0x63, 0x3c, 0xb2, 0xbe, 0xd9, 0x45, 0x98, 0x84,
+ 0xbe, 0x2a, 0x63, 0x91, 0xf6, 0x55, 0x2f, 0xc2, 0x40, 0xec, 0xa7, 0x28, 0x5d, 0x69, 0x7a, 0x3f,
+ 0xa5, 0x33, 0xa1, 0xa6, 0xf7, 0x53, 0x26, 0xcf, 0x29, 0xd7, 0xb5, 0x52, 0x1e, 0x53, 0x79, 0x64,
+ 0xd9, 0xf4, 0xa6, 0x67, 0x8d, 0x2c, 0x4a, 0xf3, 0x29, 0x8f, 0x2c, 0x9d, 0xfb, 0xf3, 0x4c, 0x51,
+ 0x89, 0x12, 0x71, 0x26, 0x44, 0x25, 0x9d, 0x9e, 0x73, 0x21, 0x0b, 0x6e, 0xc5, 0x1f, 0x4f, 0xdd,
+ 0x94, 0x15, 0x8f, 0x53, 0x53, 0x9e, 0x6f, 0xc5, 0x69, 0xed, 0x8c, 0x15, 0xbf, 0x00, 0x03, 0x6e,
+ 0xb0, 0xc2, 0x78, 0x49, 0xca, 0x60, 0xa5, 0xc2, 0x28, 0x8b, 0x98, 0x1c, 0x96, 0x58, 0xf9, 0xa3,
+ 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x12, 0xa5, 0x7c, 0xf0, 0xbc, 0x6c, 0x00, 0x00,
}
diff --git a/api/gobgp.proto b/api/gobgp.proto
index 655fdf8f..3b9f18e9 100644
--- a/api/gobgp.proto
+++ b/api/gobgp.proto
@@ -1006,6 +1006,7 @@ message Global {
Confederation confederation = 9;
GracefulRestart graceful_restart = 10;
ApplyPolicy apply_policy = 11;
+ string bind_to_device = 12;
}
message Confederation {
diff --git a/pkg/server/server.go b/pkg/server/server.go
index d9a65c0f..c5b2b0ff 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -23,6 +23,7 @@ import (
"reflect"
"strconv"
"sync"
+ "syscall"
"time"
"github.com/eapache/channels"
@@ -52,35 +53,56 @@ func (l *tcpListener) Close() error {
}
// avoid mapped IPv6 address
-func newTCPListener(address string, port uint32, ch chan *net.TCPConn) (*tcpListener, error) {
+func newTCPListener(address string, port uint32, bindToDev string, ch chan *net.TCPConn) (*tcpListener, error) {
proto := "tcp4"
+ family := syscall.AF_INET
if ip := net.ParseIP(address); ip == nil {
return nil, fmt.Errorf("can't listen on %s", address)
} else if ip.To4() == nil {
proto = "tcp6"
+ family = syscall.AF_INET6
}
- addr, err := net.ResolveTCPAddr(proto, net.JoinHostPort(address, strconv.Itoa(int(port))))
- if err != nil {
- return nil, err
+ addr := net.JoinHostPort(address, strconv.Itoa(int(port)))
+
+ var lc net.ListenConfig
+ lc.Control = func(network, address string, c syscall.RawConn) error {
+ if bindToDev != "" {
+ err := setBindToDevSockopt(c, bindToDev)
+ if err != nil {
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": addr,
+ "BindToDev": bindToDev,
+ }).Warnf("failed to bind Listener to device (%s): %s", bindToDev, err)
+ return err
+ }
+ }
+ // Note: Set TTL=255 for incoming connection listener in order to accept
+ // connection in case for the neighbor has TTL Security settings.
+ err := setsockoptIpTtl(c, family, 255)
+ if err != nil {
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": addr,
+ }).Warnf("cannot set TTL(=%d) for TCPListener: %s", 255, err)
+ }
+ return nil
}
- l, err := net.ListenTCP(proto, addr)
+ l, err := lc.Listen(context.Background(), proto, addr)
if err != nil {
return nil, err
}
- // Note: Set TTL=255 for incoming connection listener in order to accept
- // connection in case for the neighbor has TTL Security settings.
- if err := setListenTCPTTLSockopt(l, 255); err != nil {
- log.WithFields(log.Fields{
- "Topic": "Peer",
- "Key": addr,
- }).Warnf("cannot set TTL(=%d) for TCPListener: %s", 255, err)
+ listener, ok := l.(*net.TCPListener)
+ if !ok {
+ err = fmt.Errorf("unexpected connection listener (not for TCP)")
+ return nil, err
}
closeCh := make(chan struct{})
go func() error {
for {
- conn, err := l.AcceptTCP()
+ conn, err := listener.AcceptTCP()
if err != nil {
close(closeCh)
log.WithFields(log.Fields{
@@ -93,7 +115,7 @@ func newTCPListener(address string, port uint32, ch chan *net.TCPConn) (*tcpList
}
}()
return &tcpListener{
- l: l,
+ l: listener,
ch: closeCh,
}, nil
}
@@ -2101,7 +2123,7 @@ func (s *BgpServer) StartBgp(ctx context.Context, r *api.StartBgpRequest) error
if c.Config.Port > 0 {
acceptCh := make(chan *net.TCPConn, 4096)
for _, addr := range c.Config.LocalAddressList {
- l, err := newTCPListener(addr, uint32(c.Config.Port), acceptCh)
+ l, err := newTCPListener(addr, uint32(c.Config.Port), g.BindToDevice, acceptCh)
if err != nil {
return err
}
diff --git a/pkg/server/sockopt.go b/pkg/server/sockopt.go
index 0aab0ba9..235bbbb9 100644
--- a/pkg/server/sockopt.go
+++ b/pkg/server/sockopt.go
@@ -17,6 +17,7 @@
package server
import (
+ "fmt"
"net"
"syscall"
@@ -27,10 +28,6 @@ func setTCPMD5SigSockopt(l *net.TCPListener, address string, key string) error {
return setTcpMD5SigSockopt(l, address, key)
}
-func setListenTCPTTLSockopt(l *net.TCPListener, ttl int) error {
- return setListenTcpTTLSockopt(l, ttl)
-}
-
func setTCPTTLSockopt(conn *net.TCPConn, ttl int) error {
return setTcpTTLSockopt(conn, ttl)
}
@@ -39,6 +36,10 @@ func setTCPMinTTLSockopt(conn *net.TCPConn, ttl int) error {
return setTcpMinTTLSockopt(conn, ttl)
}
+func setBindToDevSockopt(sc syscall.RawConn, device string) error {
+ return fmt.Errorf("binding connection to a device is not supported")
+}
+
func dialerControl(network, address string, c syscall.RawConn, ttl, ttlMin uint8, password string, bindInterface string) error {
if password != "" {
log.WithFields(log.Fields{
diff --git a/pkg/server/sockopt_bsd.go b/pkg/server/sockopt_bsd.go
index fe7a6134..942e1289 100644
--- a/pkg/server/sockopt_bsd.go
+++ b/pkg/server/sockopt_bsd.go
@@ -35,15 +35,6 @@ func setTcpMD5SigSockopt(l *net.TCPListener, address string, key string) error {
return setsockOptInt(sc, syscall.IPPROTO_TCP, tcpMD5SIG, 1)
}
-func setListenTcpTTLSockopt(l *net.TCPListener, ttl int) error {
- family := extractFamilyFromTCPListener(l)
- sc, err := l.SyscallConn()
- if err != nil {
- return err
- }
- return setsockoptIpTtl(sc, family, ttl)
-}
-
func setTcpTTLSockopt(conn *net.TCPConn, ttl int) error {
family := extractFamilyFromTCPConn(conn)
sc, err := conn.SyscallConn()
diff --git a/pkg/server/sockopt_darwin.go b/pkg/server/sockopt_darwin.go
index abb69d35..30220952 100644
--- a/pkg/server/sockopt_darwin.go
+++ b/pkg/server/sockopt_darwin.go
@@ -27,15 +27,6 @@ func setTcpMD5SigSockopt(l *net.TCPListener, address string, key string) error {
return fmt.Errorf("setting md5 is not supported")
}
-func setListenTcpTTLSockopt(l *net.TCPListener, ttl int) error {
- family := extractFamilyFromTCPListener(l)
- sc, err := l.SyscallConn()
- if err != nil {
- return err
- }
- return setsockoptIpTtl(sc, family, ttl)
-}
-
func setTcpTTLSockopt(conn *net.TCPConn, ttl int) error {
family := syscall.AF_INET
if strings.Contains(conn.RemoteAddr().String(), "[") {
diff --git a/pkg/server/sockopt_linux.go b/pkg/server/sockopt_linux.go
index 203087ab..55d27bd4 100644
--- a/pkg/server/sockopt_linux.go
+++ b/pkg/server/sockopt_linux.go
@@ -70,13 +70,8 @@ func setTCPMD5SigSockopt(l *net.TCPListener, address string, key string) error {
return setsockOptString(sc, syscall.IPPROTO_TCP, tcpMD5SIG, string(b[:]))
}
-func setListenTCPTTLSockopt(l *net.TCPListener, ttl int) error {
- family := extractFamilyFromTCPListener(l)
- sc, err := l.SyscallConn()
- if err != nil {
- return err
- }
- return setsockoptIpTtl(sc, family, ttl)
+func setBindToDevSockopt(sc syscall.RawConn, device string) error {
+ return setsockOptString(sc, syscall.SOL_SOCKET, syscall.SO_BINDTODEVICE, device)
}
func setTCPTTLSockopt(conn *net.TCPConn, ttl int) error {
@@ -162,14 +157,9 @@ func dialerControl(network, address string, c syscall.RawConn, ttl, minTtl uint8
}
}
if bindInterface != "" {
- if err := c.Control(func(fd uintptr) {
- sockerr = os.NewSyscallError("setsockopt", syscall.SetsockoptString(int(fd), syscall.SOL_SOCKET, syscall.SO_BINDTODEVICE, bindInterface))
- }); err != nil {
+ if err := setBindToDevSockopt(c, bindInterface); err != nil {
return err
}
- if sockerr != nil {
- return sockerr
- }
}
return nil
}
diff --git a/pkg/server/sockopt_openbsd.go b/pkg/server/sockopt_openbsd.go
index 3d6825e2..612047ca 100644
--- a/pkg/server/sockopt_openbsd.go
+++ b/pkg/server/sockopt_openbsd.go
@@ -370,15 +370,6 @@ func setTCPMD5SigSockopt(l *net.TCPListener, address string, key string) error {
return setsockoptTcpMD5Sig(sc, address, key)
}
-func setListenTCPTTLSockopt(l *net.TCPListener, ttl int) error {
- family := extractFamilyFromTCPListener(l)
- sc, err := l.SyscallConn()
- if err != nil {
- return err
- }
- return setsockoptIpTtl(sc, family, ttl)
-}
-
func setTCPTTLSockopt(conn *net.TCPConn, ttl int) error {
family := extractFamilyFromTCPConn(conn)
sc, err := conn.SyscallConn()
@@ -403,6 +394,10 @@ func setTCPMinTTLSockopt(conn *net.TCPConn, ttl int) error {
return setsockOptInt(sc, level, name, ttl)
}
+func setBindToDevSockopt(sc syscall.RawConn, device string) error {
+ return fmt.Errorf("binding connection to a device is not supported")
+}
+
func dialerControl(network, address string, c syscall.RawConn, ttl, minTtl uint8, password string, bindInterface string) error {
if password != "" {
log.WithFields(log.Fields{
diff --git a/pkg/server/util.go b/pkg/server/util.go
index c774c6dd..e4abbed0 100644
--- a/pkg/server/util.go
+++ b/pkg/server/util.go
@@ -65,14 +65,6 @@ func decodeAdministrativeCommunication(data []byte) (string, []byte) {
return string(data[1 : communicationLen+1]), data[communicationLen+1:]
}
-func extractFamilyFromTCPListener(l *net.TCPListener) int {
- family := syscall.AF_INET
- if strings.Contains(l.Addr().String(), "[") {
- family = syscall.AF_INET6
- }
- return family
-}
-
func extractFamilyFromTCPConn(conn *net.TCPConn) int {
family := syscall.AF_INET
if strings.Contains(conn.RemoteAddr().String(), "[") {