-
Notifications
You must be signed in to change notification settings - Fork 340
netlink path manager: Wrong interface id for created/established #350
Comments
The reported interface-ID comes from
@matttbe - should |
thanks. I am fine with that, just a bit surprised, my reasoning being it's best not to submit the interface id if it's wrong. I ponder about creating a wiki page about the netlink protocol.
From my pcaps, it seems the event is also triggered for the master subflow. |
Yes - probably, when the subflow is not bound to the interface it is ok to give 0, as the subflow could move if the routing changes.
A wiki-page about the netlink protocol would be awesome! :)
Hmmm... Looking at the code, it does not seem to me to be the case. |
Indeed: I made a new capture/check the code to be sure and that isn't the case. Which means I have to fetch the interface idx myself which is a bit annoying. |
Hi! Sorry for the delay!
👍
@cpaasch : I am sorry but what do you mean? Just to be sure here you are talking about the master sf not having an if_idx, right? (I guess you don't want to do a lookup in the routing table for non established SF, right? :) ) diff --git a/net/mptcp/mptcp_netlink.c b/net/mptcp/mptcp_netlink.c
index 85964e473ab7..28e3b6c72fc8 100644
--- a/net/mptcp/mptcp_netlink.c
+++ b/net/mptcp/mptcp_netlink.c
@@ -182,7 +182,8 @@ mptcp_nl_put_subsk(struct sk_buff *msg, struct sock *sk)
if (nla_put_u8(msg, MPTCP_ATTR_BACKUP, backup))
goto nla_put_failure;
- if (nla_put_s32(msg, MPTCP_ATTR_IF_IDX, sk->sk_bound_dev_if))
+ if (nla_put_s32(msg, MPTCP_ATTR_IF_IDX, isk->transparent ?
+ isk->rx_dst_ifindex : sk->sk_bound_dev_if))
goto nla_put_failure;
sk_err = sk->sk_err ? : tcp_sk(sk)->mptcp->sk_err; Does this patch help or do we need to retrieve the info from somewhere else for
For history reasons, that's likely possible that this interface is not consistent indeed: from the beginning, this path manager is using |
I just ran an iperf3 session, which doesn't seem to contain any IP_TRANSPARENT call: https://github.com/esnet/iperf/search?q=IP_TRANSPARENT&unscoped_q=IP_TRANSPARENT . |
wrt to deceiving interface id - the id you are getting is 0, right? It is confusing indeed, and I think that the nl-pm should not give an if-index when so_bindtodev is 0. It should simply omit that field IMO. |
yes it's 0. |
@cpaasch is it not possible to get the interface id when so_bindtodev is 0? Is it because it can changed? Except if so_bindtodev is set? |
When |
Here is an output of my wireshark fork to decode the mptcp netlink messages:

In the first created/established event (for the meta I guess), the interface id is always 0 (same for local/remote ids). When subflow events are created then the values are correct. Any reason not to set the correct values straightaway ? In my path manager it means I discard the MPTCP_EVENT_CREATED / MPTCP_EVENT_ESTABLISHED and wait for MPTCP_EVENT_SUB_ESTABLISHED instead but that sounds suboptimal.
The text was updated successfully, but these errors were encountered: