Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qfix: Prevent potential leaks of loopback ifaces on request error #556

Merged

Conversation

denis-tingaikin
Copy link
Member

Signed-off-by: denis-tingaikin [email protected]

@@ -56,7 +56,7 @@ func (l *loopbackClient) Request(ctx context.Context, request *networkservice.Ne
if err := createLoopback(ctx, l.vppConn, networkService, l.loopbacks, metadata.IsClient(l)); err != nil {
return nil, err
}
postponeCtxFunc := postpone.Context(ctx)
postponeCtxFunc := postpone.ContextWithValues(ctx)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loopback depends on metadata. So we should use context with values.

@@ -53,9 +54,13 @@ func (l *loopbackServer) Request(ctx context.Context, request *networkservice.Ne
if err := createLoopback(ctx, l.vppConn, networkService, l.loopbacks, metadata.IsClient(l)); err != nil {
return nil, err
}
postponeCtxFunc := postpone.ContextWithValues(ctx)

Copy link
Member Author

@denis-tingaikin denis-tingaikin Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server side doesn't care about context expiration on getting error => added postponeCtxFunc.

@edwarnicke edwarnicke merged commit 8ecddc7 into networkservicemesh:main Apr 12, 2022
nsmbot pushed a commit to networkservicemesh/cmd-nse-vlan-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-forwarder-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-firewall-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vl3-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-icmp-responder-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-forwarder-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-firewall-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-icmp-responder-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vlan-vpp that referenced this pull request Apr 12, 2022
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#556

Commit: 8ecddc7
Author: Denis Tingaikin
Date: 2022-04-13 00:09:01 +0300
Message:
  - fix potential leaks of loopback chain element (#556)
Signed-off-by: NSMBot <[email protected]>
nsmbot pushed a commit that referenced this pull request Jan 23, 2023
…k-kernel@main

PR link: networkservicemesh/sdk-kernel#556

Commit: d38c463
Author: Denis Tingaikin
Date: 2023-01-23 11:32:16 +0300
Message:
  - Merge pull request #556 from wazsone/ci/fix-depricated
Signed-off-by: NSMBot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants