From b29c220387d78a48d78186628d4653c89da5dd30 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Fri, 18 Feb 2022 17:32:29 +0100 Subject: [PATCH] Cleanup gathering interface MTU --- usrsctplib/netinet/sctp_os_userspace.h | 2 -- usrsctplib/netinet/sctp_pcb.c | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/usrsctplib/netinet/sctp_os_userspace.h b/usrsctplib/netinet/sctp_os_userspace.h index 77c39a184..b0d72bd20 100755 --- a/usrsctplib/netinet/sctp_os_userspace.h +++ b/usrsctplib/netinet/sctp_os_userspace.h @@ -889,8 +889,6 @@ int sctp_userspace_get_mtu_from_ifn(uint32_t if_index); #define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_rmx.rmx_mtu : 0) -#define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) (sctp_ifn->ifn_mtu) - #define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \ if (rt != NULL) \ rt->rt_rmx.rmx_mtu = mtu; \ diff --git a/usrsctplib/netinet/sctp_pcb.c b/usrsctplib/netinet/sctp_pcb.c index 24ac6c438..a104557fd 100755 --- a/usrsctplib/netinet/sctp_pcb.c +++ b/usrsctplib/netinet/sctp_pcb.c @@ -4625,7 +4625,12 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr, net->src_addr_selected = 1; /* Now get the interface MTU */ if (net->ro._s_addr->ifn_p != NULL) { - imtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); + /* + * XXX: Should we here just use + * net->ro._s_addr->ifn_p->ifn_mtu + */ + imtu = SCTP_GATHER_MTU_FROM_IFN_INFO(net->ro._s_addr->ifn_p->ifn_p, + net->ro._s_addr->ifn_p->ifn_index); } else { imtu = 0; }