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

Binding to an interface which is not up yet causes many log entries #84

Open
pmelange opened this issue Oct 22, 2018 · 3 comments
Open

Comments

@pmelange
Copy link
Contributor

I am using the tunneldigger client in openWrt (freifunk-berlin firmware). We expect situations where people install the firmware while meshing islands through a tunnel. It is therefore important that tunnels are not made over the mesh network and only though the wan interface. Thus we want to bind to the interface.

An issue arrises when router is not connected to a wan and only meshes. The wan is not connected to anything, yet tunneldigger tries to make a connection anyhow. There were 80 log entries in 10 seconds, which repeat five seconds later.

Mon Oct 22 01:04:52 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:52 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:52 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:52 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:52 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:52 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:52 2018 daemon.info td-client: Performing broker selection...
Mon Oct 22 01:04:53 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:53 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:53 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:53 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:53 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:53 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:53 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:53 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:53 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:53 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:53 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:53 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:53 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:53 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:53 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:53 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:53 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:53 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:56 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:56 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:56 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:56 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:56 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:56 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:56 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:56 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:56 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:56 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:56 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:56 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:56 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:56 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:56 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:56 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:56 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:56 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:58 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:58 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:58 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:58 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:58 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:58 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:58 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:58 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:58 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:58 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:58 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:58 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:58 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:58 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:58 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:04:59 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:04:59 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:04:59 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:05:01 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:05:01 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:05:01 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:05:01 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:05:01 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:05:01 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:05:01 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:05:01 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:05:01 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:05:01 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:05:01 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:05:01 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:05:01 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:05:01 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:05:01 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:05:02 2018 daemon.info td-client: Reinitializing tunnel context.
Mon Oct 22 01:05:02 2018 daemon.err td-client: Failed to bind to device!
Mon Oct 22 01:05:02 2018 daemon.err td-client: Unable to reinitialize the context!
Mon Oct 22 01:05:02 2018 daemon.err td-client: No suitable brokers found. Retrying in 5 seconds

I see two possible solutions.

  1. Change l2tp_client.c at line 434 to wait for a timeout when the bind fails and try again. And without it being an error.
  2. Change the init to only start those which do not bind. Create a hotplug script to handle those which do bind.

I am willing to make the changes, but I want to know what the development group thinks before I go making changes.

@pmelange
Copy link
Contributor Author

pmelange commented Nov 4, 2018

I have gone ahead with option 2. You can see how we are doing this at freifunk-berlin freifunk-berlin/firmware-packages@405a582

@RalfJung
Copy link
Member

RalfJung commented Dec 2, 2018

Change l2tp_client.c at line 434 to wait for a timeout when the bind fails and try again. And without it being an error.

I think it should be an error, because if someone expects the interface to be present, or if they have a typo, it'd be rather odd to not treat this as an error. I could however imagine an option to make an interface "hotplugging" like you suggested.

You seem to now have solved this via shell wrappers, so do you still think having such an option in tunneldigger itself would be useful?

@pmelange
Copy link
Contributor Author

pmelange commented Dec 2, 2018

I meant changing it from an error to a warning. But if you think error is better, than keep it that way.

It seems to be working fine with the hotplug scripts. There are a few people using the new test firmware and so far no problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants