Fix/ebpf free (#1057)

* Fix ebpf free call

* Add debug logs
This commit is contained in:
Zoltan Papp 2023-08-07 11:43:32 +02:00 committed by GitHub
parent 973316d194
commit 8eca83f3cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 2 deletions

View File

@ -75,7 +75,7 @@ func (l *EBPF) Load(proxyPort, wgPort int) error {
return err
}
// Free free ebpf program
// Free ebpf program
func (l *EBPF) Free() error {
if l.link != nil {
return l.link.Close()

View File

@ -14,7 +14,7 @@ func (w *Factory) GetProxy() Proxy {
func (w *Factory) Free() error {
if w.ebpfProxy != nil {
return w.ebpfProxy.CloseConn()
return w.ebpfProxy.Free()
}
return nil
}

View File

@ -104,6 +104,7 @@ func (p *WGEBPFProxy) CloseConn() error {
// Free resources
func (p *WGEBPFProxy) Free() error {
log.Debugf("free up ebpf wg proxy")
var err1, err2, err3 error
if p.conn != nil {
err1 = p.conn.Close()

View File

@ -20,6 +20,7 @@ type WGUserSpaceProxy struct {
// NewWGUserSpaceProxy instantiate a user space WireGuard proxy
func NewWGUserSpaceProxy(wgPort int) *WGUserSpaceProxy {
log.Debugf("instantiate new userspace proxy")
p := &WGUserSpaceProxy{
localWGListenPort: wgPort,
}