All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] Address ID assignment in netlink PM
@ 2020-11-25 21:48 Othman, Ossama
  0 siblings, 0 replies; only message in thread
From: Othman, Ossama @ 2020-11-25 21:48 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

Hi Paolo,

While debugging a netlink PM "get addr" issue I was having in mptcpd I found that the address ID assigned by mptcpd was being overridden by the kernel.  Based on the code in pm_nl_ctl.c in the MPTCP self tests, and the code in pm_netlink.c in the kernel, the MPTCP_PM_CMD_ADD_ADDR command accepts an optional address ID attribute.  When that attribute is available the ID is stored in the corresponding mptcp_pm_addr_entry instance by mptcp_pm_parse_addr():

	if (tb[MPTCP_PM_ADDR_ATTR_ID])
		entry->addr.id = nla_get_u8(tb[MPTCP_PM_ADDR_ATTR_ID]);

However, that value is later overridden in mptcp_pm_nl_append_new_local_addr():

	entry->addr.id = pernet->next_id++;

That causes the userspace to lose track of an address it added with a specific ID, at which point the only way to find out the new ID is to dump the addrs to find the new ID corresponding to local address in question.  Is this the intended behavior?  It seems like userspace- and kernel-based address ID assignment should be mutually exclusive.  Otherwise we run into this sort of scenario.  Is there a need for the kernel to assign IDs in the netlink PM case?

Please let me know if I'm misunderstanding how ID assignment is expected to work when using the netlink PM.

Thanks for your help!
-Ossama

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-25 21:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 21:48 [MPTCP] Address ID assignment in netlink PM Othman, Ossama

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.