Skip to content

Commit

Permalink
Cleanup gathering interface MTU
Browse files Browse the repository at this point in the history
  • Loading branch information
tuexen committed Feb 18, 2022
1 parent ed352c4 commit b29c220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions usrsctplib/netinet/sctp_os_userspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
7 changes: 6 additions & 1 deletion usrsctplib/netinet/sctp_pcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b29c220

Please sign in to comment.