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

don't down interface #5

Open
alexshavelev opened this issue Aug 15, 2017 · 6 comments
Open

don't down interface #5

alexshavelev opened this issue Aug 15, 2017 · 6 comments

Comments

@alexshavelev
Copy link

alexshavelev commented Aug 15, 2017

for example we have two interfaces:
eth1 and tap2.
we connect to eth1 via ewpcap, work and than use ewpcap:close. after interface is still up.
after we restart application which works with tap2 via tunctl we need every type to up interface manually like 'ifup tap2'. it's not useful to make it via tunctl:up, because application works on different nodes and we need custom configs with ips for interfaces.

is there any possibility to keep interface up? if we delete call of '_ = tunctl:down(Dev),' or 'procket:close(FD)' interface is up, but we get 'ebusy' error

@alexshavelev
Copy link
Author

alexshavelev commented Aug 15, 2017

i've changed terminate function in tuncer to tunctl:persist(FD, true).
but it looks strange. after stop application 'ifconfig' don't show tap2 interface and:

tcpdump -i tap2
tcpdump: tap2: That device is not up
ifup tap2
ioctl(TUNSETIFF): Device or resource busy

@alexshavelev
Copy link
Author

hm, but when we start application tcpdump shows traffic but half the time

@msantos
Copy link
Owner

msantos commented Aug 17, 2017

@alexshavelev sorry I didn't see this issue!

Which OS are you using?

@alexshavelev
Copy link
Author

centos 7

@msantos
Copy link
Owner

msantos commented Aug 17, 2017

@alexshavelev commenting out down/1 and persist/2 should've worked. I'll run some tests and check out what is going on.

About the persist flag being reset on terminate, that is probably a bug. Will take a look.

@msantos
Copy link
Owner

msantos commented Aug 20, 2017 via email

msantos added a commit that referenced this issue Aug 21, 2017
If the caller has set the tuntap interface to persistent, do not destroy
or unconfigure the interface on shutdown as suggested by @alexshavelev
in #5
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

No branches or pull requests

2 participants