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
Add support for new upstream kernel PM commands. #199
Add support for new upstream kernel PM commands. #199
Conversation
Pull Request Test Coverage Report for Build 2806147104
💛 - Coveralls |
Support for |
@kmaloor, FYI. |
I need to fix the Update: This is done in PR #234. |
Latest user space PM patch set for upstream kernel is available here. |
031b616
to
22af7b4
Compare
Commit b3ffeba works around the symbol redefinition problem described by issue multipath-tcp/mptcp_net-next#276. |
22af7b4
to
19d1e32
Compare
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pushing the listener changes!
I have a few suggestions on the listener manager, but this definitely gives a solid basis for the ndiffports plugin work.
src/listener_manager.c
Outdated
return false; | ||
} | ||
|
||
if (!l_hashmap_insert(lm, L_UINT_TO_PTR(id), L_UINT_TO_PTR(fd))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should check for hash collision before creating the socket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "hash collision" isn't the right word. Better to say: check to see if the key is already used in the hashmap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The listener manager now does a lookup before creating a new hash map entry. If an entry exists, the ref count is incremented. Otherwise a new entry is created.
return l_test_run(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions for more coverage: Create multiple listeners. Test for collision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a few test cases were added to the test-listener-manager
unit test. Hopefully they are enough. :)
137d489
to
cc2e52c
Compare
04511ee
to
daa13d4
Compare
In some cases it is useful to copy the contents of a sockaddr based on the address family. Add a new mptcpd_sockaddr_copy() function that does so. Only AF_INET and AF_INET6 address families are supported.
The mptcpd_pm_add_addr() function now expects a pointer to a non-const struct sockaddr. Update the sspi plugin accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New batch of commits looks good to me
Thanks Mat! All I have left in my queue are the |
Overhaul the test-commands unit test with the following notable changes: * Use different addresses for user and kernel space address advertising related commands. This is needed to prevent listening on the same TCP address and port. * Use the same local and remote addresses for all user space subflow related commands. * Log addresses obtained from mptcpd_kpm_get_addr().
Split kernel and user space test cases to make it easier to determine causes of failure. The code is also cleaner with the split.
|
||
#include <ell/util.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks with a recent ELL - needs the wrapper pragmas for these ELL includes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit e80db71.
Propagate errors to callers by returning 0 on success, and -1 or errno on error. This allows for better error handling and diagnostics.
The EADDRNOTAVAIL error will generally occur during a call to mptcpd_pm_add_addr() if the test is run without sufficient capabilities (CAP_NET_ADMIN) to set up the test addresses by associating them with a network interface. Ignore the failure for now.
msg, | ||
mptcpd_family_send_callback, | ||
"remove_subflow", /* user data */ | ||
NULL /* destroy */) == 0; | ||
} | ||
|
||
static int upstream_set_backup(struct mptcpd_pm *pm, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upstream_set_backup()
implementation is missing. Rather than delay this pull request further, I'd like to create another pull request for the upstream_set_backup()
implementation. This is related to #237.
Implement support for the upcoming MPTCP netlink user space path commands commands in the upstream kernel. See multipath-tcp/mptcp_net-next#186 for the corresponding kernel-side GitHub issue.
Closes #129.
Closes #244.