Skip to content

Instantly share code, notes, and snippets.

@itdaniher
Created January 22, 2018 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itdaniher/5308c0905ed76189381861964ac974aa to your computer and use it in GitHub Desktop.
Save itdaniher/5308c0905ed76189381861964ac974aa to your computer and use it in GitHub Desktop.
setns leaks FDs
import sys
import traceback
import pyroute2.netns
i = 0
while True:
try:
pyroute2.netns.setns('/proc/1/ns/net')
except:
traceback.print_exc(file=sys.stderr)
print(i)
break
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment