git: 03e166d6ea4d - stable/13 - sctp: cleanup, no functional change intended.

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Wed, 23 Feb 2022 00:17:13 UTC
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=03e166d6ea4dd67dab4379759758e60316884a58

commit 03e166d6ea4dd67dab4379759758e60316884a58
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2022-02-18 13:20:01 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-02-23 00:15:43 +0000

    sctp: cleanup, no functional change intended.
    
    (cherry picked from commit 274a0e4a8d817d88ce7e3d40c4aad71db102c6ff)
---
 sys/netinet/sctp_os_bsd.h | 1 -
 sys/netinet/sctp_pcb.c    | 7 ++++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h
index 4d2c40b59a4b..7d5cef6d5f09 100644
--- a/sys/netinet/sctp_os_bsd.h
+++ b/sys/netinet/sctp_os_bsd.h
@@ -315,7 +315,6 @@ typedef struct callout sctp_os_timer_t;
 /*************************/
 #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index) ((struct ifnet *)ifn)->if_mtu
 #define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, nh) ((uint32_t)((nh != NULL) ? nh->nh_mtu : 0))
-#define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0)
 
 /*************************/
 /* These are for logging */
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 632da61f6cf6..e0ac06f2f87e 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -3969,7 +3969,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;
 			}