-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Wrong type for field ifindex in struct iface #109
Comments
Nota: I haven't tried to change the type and recompile... |
The most obvious fix, as mentioned in #71, is to simply change from |
I've looked into this a bit further now and I don't see any other code, than the I'm pushing a fix for that now, which will cause GitHub to automatically close this issue. Please, if you can @rene-d, test the fix. If it doesn't work we'll reopen this issue again. Thanks! |
Ok thanks! I will test tomorrow. |
Yes! the fix (type changed from u_short to int) solves the problem of interface indices greater than 2^16. The test passes with ifindex below and above 65536. Without this fix, it passes with ifindex<65536 and fails otherwise. |
@rene-d Awesome, thank you for getting back on this! 🎉 😃 |
Thank you for having dealt with my issue so fast ;-) I have look for ifindex in the Linux kernel: sometimes it's typed u32, sometimes int. In net/core/dev.c line ~8034 in function dev_new_index(), ifindex is a strictly positive int (aka between 1 and 2^31-1). |
In Linux kernel, the ifindex is stored into a int variable (aka. 4 bytes). And can take values greater than 65535 (I don't know since which version...).
The ifindex field in the structure iface (ifvc.h) is a u_short, and big indices cannot fit. It occurs especially on servers running tests that create/destroy bridges and virtual interfaces.
smcroute exits with "Failed adding VIF for iface ..." message : it tries to set an option on a inexistant interface (2000 instead of 67536 for example).
The text was updated successfully, but these errors were encountered: