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

Fix ntrack for latest libnl release #1319

Merged
merged 1 commit into from
Dec 7, 2013
Merged

Conversation

wkennington
Copy link
Contributor

ntrack compilation was broken with libnl 3.2.21 and later. This patch fixes the build to work with the new versions of libnl.

@7c6f434c
Copy link
Member

7c6f434c commented Dec 2, 2013

Doesn't a comment on ntrack bugtracker say this patch is not enough?

@wkennington
Copy link
Contributor Author

The comment was questioning whether it was enough due to the pointer type mismatch. The correction to the posted patch is incorporated in this change, which also uses OBJ_CAST to cast from nl_object_ops to an nl_object. Supposedly this is perfectly valid.

@7c6f434c
Copy link
Member

7c6f434c commented Dec 2, 2013

The comment was questioning whether it was enough due to the pointer type mismatch. The correction to the posted patch is incorporated in this change, which also uses OBJ_CAST to cast from nl_object_ops to an nl_object. Supposedly this is perfectly valid.

Such a cast looks risky…

Do you know any application to test this (I added an override to use
older libnl before seeing your patch, so these options could be
compared)?

@wkennington
Copy link
Contributor Author

No one seems to have an idea how to test the code path. Why is this package even required for the build? It seems like a very uncommon package.

@wkennington
Copy link
Contributor Author

Just fixed this with a proper patch. Notice that the route_obj_ops are used to create all of the rtnl_route such as the topmost_route. Therefore, by using a valid cast from rtnl_route to nl_object is a allowed if you view the libnl sources for creating the objects. By doing this, we can call the nl_object_get_id_attrs on the rtnl_route which is equivalent to the previous statement using route_obj_ops.

Unfortunately I still have no idea how to test this but at least I've constructed this patch by manually inspecting the sources to libnl and ntrack.

7c6f434c added a commit that referenced this pull request Dec 7, 2013
Fix ntrack for latest libnl release
@7c6f434c 7c6f434c merged commit 14a0050 into NixOS:master Dec 7, 2013
@wkennington wkennington deleted the ntrack branch December 28, 2013 05:50
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