Sync with Yosemite sources.


git-svn-id: http://sctp-refimpl.googlecode.com/svn/trunk/KERN/usrsctp/usrsctplib@9284 9df1edf5-d72c-5b5f-11c0-5f5209eb73f7
diff --git a/netinet/sctp_asconf.c b/netinet/sctp_asconf.c
index 920db6e..a795e1a 100755
--- a/netinet/sctp_asconf.c
+++ b/netinet/sctp_asconf.c
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 284393 2015-06-14 22:14:00Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #include <netinet/sctp_os.h>
@@ -1116,7 +1116,8 @@
 		   nexthop, the path will not be changed.
 		 */
 		SCTP_RTALLOC((sctp_route_t *)&net->ro,
-			     stcb->sctp_ep->def_vrf_id);
+			     stcb->sctp_ep->def_vrf_id,
+			     stcb->sctp_ep->fibnum);
 		if (net->ro.ro_rt == NULL)
 			continue;
 
diff --git a/netinet/sctp_input.c b/netinet/sctp_input.c
index a094c8b..8b39bb6 100755
--- a/netinet/sctp_input.c
+++ b/netinet/sctp_input.c
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 283650 2015-05-28 16:00:23Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #include <netinet/sctp_os.h>
@@ -207,7 +207,7 @@
 			                             "No listener");
 			sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err,
 #if defined(__FreeBSD__)
-			                mflowtype, mflowid,
+			                mflowtype, mflowid, inp->fibnum,
 #endif
 			                vrf_id, port);
 		}
@@ -1536,7 +1536,7 @@
 		op_err = sctp_generate_cause(SCTP_CAUSE_COOKIE_IN_SHUTDOWN, "");
 		sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err,
 #if defined(__FreeBSD__)
-		                   mflowtype, mflowid,
+		                   mflowtype, mflowid, inp->fibnum,
 #endif
 		                   vrf_id, net->port);
 		if (how_indx < sizeof(asoc->cookie_how))
@@ -1746,7 +1746,7 @@
 		op_err = sctp_generate_cause(SCTP_CAUSE_NAT_COLLIDING_STATE, "");
 		sctp_send_abort(m, iphlen,  src, dst, sh, 0, op_err,
 #if defined(__FreeBSD__)
-		                mflowtype, mflowid,
+		                mflowtype, mflowid, inp->fibnum,
 #endif
 		                vrf_id, port);
 		return (NULL);
@@ -2659,7 +2659,7 @@
 		scm->time_usec = htonl(tim);
 		sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err,
 #if defined(__FreeBSD__)
-		                   mflowtype, mflowid,
+		                   mflowtype, mflowid, l_inp->fibnum,
 #endif
 		                   vrf_id, port);
 		return (NULL);
@@ -2928,6 +2928,7 @@
 			inp->partial_delivery_point = (*inp_p)->partial_delivery_point;
 			inp->sctp_context = (*inp_p)->sctp_context;
 			inp->local_strreset_support = (*inp_p)->local_strreset_support;
+			inp->fibnum = (*inp_p)->fibnum;
 			inp->inp_starting_point_for_iterator = NULL;
 #if defined(__Userspace__)
 			inp->ulp_info = (*inp_p)->ulp_info;
@@ -4542,7 +4543,7 @@
     struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp,
     struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen,
 #if defined(__FreeBSD__)
-    uint8_t mflowtype, uint32_t mflowid,
+    uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
 #endif
     uint32_t vrf_id, uint16_t port)
 {
@@ -4705,7 +4706,7 @@
 			/* no association, so it's out of the blue... */
 			sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, op_err,
 #if defined(__FreeBSD__)
-			                 mflowtype, mflowid,
+			                 mflowtype, mflowid, inp->fibnum,
 #endif
 					 vrf_id, port);
 			*offset = length;
@@ -4751,7 +4752,7 @@
 				sctp_handle_ootb(m, iphlen, *offset, src, dst,
 				                 sh, inp, op_err,
 #if defined(__FreeBSD__)
-				                 mflowtype, mflowid,
+				                 mflowtype, mflowid, fibnum,
 #endif
 				                 vrf_id, port);
 				return (NULL);
@@ -5774,7 +5775,7 @@
 #endif
                              uint8_t ecn_bits,
 #if defined(__FreeBSD__)
-                             uint8_t mflowtype, uint32_t mflowid,
+                             uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
 #endif
                              uint32_t vrf_id, uint16_t port)
 {
@@ -5861,7 +5862,7 @@
 		if (ch->chunk_type == SCTP_SHUTDOWN_ACK) {
 			sctp_send_shutdown_complete2(src, dst, sh,
 #if defined(__FreeBSD__)
-			                             mflowtype, mflowid,
+			                             mflowtype, mflowid, fibnum,
 #endif
 			                             vrf_id, port);
 			goto out;
@@ -5878,7 +5879,7 @@
 				sctp_send_abort(m, iphlen, src, dst,
 				                sh, 0, op_err,
 #if defined(__FreeBSD__)
-				                mflowtype, mflowid,
+				                mflowtype, mflowid, fibnum,
 #endif
 				                vrf_id, port);
 			}
@@ -5939,7 +5940,7 @@
 			                             msg);
 			sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
 #if defined(__FreeBSD__)
-			                 mflowtype, mflowid,
+			                 mflowtype, mflowid, inp->fibnum,
 #endif
 			                 vrf_id, port);
 			goto out;
@@ -5953,7 +5954,7 @@
 		                            src, dst, sh, ch,
 		                            inp, stcb, &net, &fwd_tsn_seen,
 #if defined(__FreeBSD__)
-		                            mflowtype, mflowid,
+		                            mflowtype, mflowid, fibnum,
 #endif
 		                            vrf_id, port);
 		if (stcb) {
@@ -5995,7 +5996,7 @@
 			                             msg);
 			sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
 #if defined(__FreeBSD__)
-			                 mflowtype, mflowid,
+			                 mflowtype, mflowid, fibnum,
 #endif
 					 vrf_id, port);
 			goto out;
@@ -6070,7 +6071,7 @@
 			                             msg);
 			sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err,
 #if defined(__FreeBSD__)
-			                 mflowtype, mflowid,
+			                 mflowtype, mflowid, inp->fibnum,
 #endif
 					 vrf_id, port);
 			goto out;
@@ -6212,6 +6213,7 @@
 #if defined(__FreeBSD__)
 	uint32_t mflowid;
 	uint8_t mflowtype;
+	uint16_t fibnum;
 #endif
 #if !(defined(__FreeBSD__) || defined(__APPLE__) || defined(__Windows__))
 	uint16_t port = 0;
@@ -6282,6 +6284,7 @@
 #if defined(__FreeBSD__)
 	mflowid = m->m_pkthdr.flowid;
 	mflowtype = M_HASHTYPE_GET(m);
+	fibnum = M_GETFIB(m);
 #endif
 	SCTP_STAT_INCR(sctps_recvpackets);
 	SCTP_STAT_INCR_COUNTER64(sctps_inpackets);
@@ -6378,7 +6381,7 @@
 #endif
 	                             ecn_bits,
 #if defined(__FreeBSD__)
-	                             mflowtype, mflowid,
+	                             mflowtype, mflowid, fibnum,
 #endif
 	                             vrf_id, port);
  out:
diff --git a/netinet/sctp_input.h b/netinet/sctp_input.h
index 5d45fef..866f480 100755
--- a/netinet/sctp_input.h
+++ b/netinet/sctp_input.h
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.h 273168 2014-10-16 15:36:04Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.h 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #ifndef _NETINET_SCTP_INPUT_H_
@@ -48,7 +48,7 @@
 #endif
                              uint8_t,
 #if defined(__FreeBSD__)
-                             uint8_t, uint32_t,
+                             uint8_t, uint32_t, uint16_t,
 #endif
                              uint32_t, uint16_t);
 
diff --git a/netinet/sctp_os_userspace.h b/netinet/sctp_os_userspace.h
index 13df424..677c432 100755
--- a/netinet/sctp_os_userspace.h
+++ b/netinet/sctp_os_userspace.h
@@ -888,7 +888,7 @@
 	 *  SCTP_GET_IF_INDEX_FROM_ROUTE macro.
 	 */
 }
-#define SCTP_RTALLOC(ro, vrf_id) sctp_userspace_rtalloc((sctp_route_t *)ro)
+#define SCTP_RTALLOC(ro, vrf_id, fibnum) sctp_userspace_rtalloc((sctp_route_t *)ro)
 
 /* dummy rtfree needed once user_route.h is included */
 static inline void sctp_userspace_rtfree(sctp_rtentry_t *rt)
diff --git a/netinet/sctp_output.c b/netinet/sctp_output.c
index 40c2ceb..aca6cfe 100755
--- a/netinet/sctp_output.c
+++ b/netinet/sctp_output.c
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 284331 2015-06-12 17:20:09Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #include <netinet/sctp_os.h>
@@ -3470,7 +3470,7 @@
 		/*
 		 * Need a route to cache.
 		 */
-		SCTP_RTALLOC(ro, vrf_id);
+		SCTP_RTALLOC(ro, vrf_id, inp->fibnum);
 	}
 	if (ro->ro_rt == NULL) {
 		return (NULL);
@@ -4325,7 +4325,7 @@
 				sctp_free_ifa(_lsrc);
 			} else {
 				ip->ip_src = over_addr->sin.sin_addr;
-				SCTP_RTALLOC(ro, vrf_id);
+				SCTP_RTALLOC(ro, vrf_id, inp->fibnum);
 			}
 		}
 		if (port) {
@@ -4728,7 +4728,7 @@
 				sctp_free_ifa(_lsrc);
 			} else {
 				lsa6->sin6_addr = over_addr->sin6.sin6_addr;
-				SCTP_RTALLOC(ro, vrf_id);
+				SCTP_RTALLOC(ro, vrf_id, inp->fibnum);
 			}
 #ifdef SCTP_EMBEDDED_V6_SCOPE
 #ifdef SCTP_KAME
@@ -5877,7 +5877,7 @@
 		                             "Address added");
 		sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err,
 #if defined(__FreeBSD__)
-		                mflowtype, mflowid,
+		                mflowtype, mflowid, inp->fibnum,
 #endif
 		                vrf_id, port);
 		return;
@@ -5898,7 +5898,7 @@
 		sctp_send_abort(init_pkt, iphlen, src, dst, sh,
 				init_chk->init.initiate_tag, op_err,
 #if defined(__FreeBSD__)
-		                mflowtype, mflowid,
+		                mflowtype, mflowid, inp->fibnum,
 #endif
 		                vrf_id, port);
 		return;
@@ -11328,7 +11328,7 @@
 sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
                    struct sctphdr *sh, uint32_t vtag,
                    uint8_t type, struct mbuf *cause,
-                   uint8_t mflowtype, uint32_t mflowid,
+                   uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
                    uint32_t vrf_id, uint16_t port)
 #else
 static void
@@ -11434,6 +11434,7 @@
 	SCTP_BUF_LEN(mout) = len;
 	SCTP_BUF_NEXT(mout) = cause;
 #if defined(__FreeBSD__)
+	M_SETFIB(mout, fibnum);
 	mout->m_pkthdr.flowid = mflowid;
 	M_HASHTYPE_SET(mout, mflowtype);
 #endif
@@ -11725,13 +11726,13 @@
 sctp_send_shutdown_complete2(struct sockaddr *src, struct sockaddr *dst,
                              struct sctphdr *sh,
 #if defined(__FreeBSD__)
-                             uint8_t mflowtype, uint32_t mflowid,
+                             uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
 #endif
                              uint32_t vrf_id, uint16_t port)
 {
 	sctp_send_resp_msg(src, dst, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL,
 #if defined(__FreeBSD__)
-	                   mflowtype, mflowid,
+	                   mflowtype, mflowid, fibnum,
 #endif
 	                   vrf_id, port);
 }
@@ -12577,7 +12578,7 @@
 sctp_send_abort(struct mbuf *m, int iphlen, struct sockaddr *src, struct sockaddr *dst,
                 struct sctphdr *sh, uint32_t vtag, struct mbuf *cause,
 #if defined(__FreeBSD__)
-                uint8_t mflowtype, uint32_t mflowid,
+                uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
 #endif
                 uint32_t vrf_id, uint16_t port)
 {
@@ -12589,7 +12590,7 @@
 	}
 	sctp_send_resp_msg(src, dst, sh, vtag, SCTP_ABORT_ASSOCIATION, cause,
 #if defined(__FreeBSD__)
-	                   mflowtype, mflowid,
+	                   mflowtype, mflowid, fibnum,
 #endif
 	                   vrf_id, port);
 	return;
@@ -12599,13 +12600,13 @@
 sctp_send_operr_to(struct sockaddr *src, struct sockaddr *dst,
                    struct sctphdr *sh, uint32_t vtag, struct mbuf *cause,
 #if defined(__FreeBSD__)
-                   uint8_t mflowtype, uint32_t mflowid,
+                   uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
 #endif
                    uint32_t vrf_id, uint16_t port)
 {
 	sctp_send_resp_msg(src, dst, sh, vtag, SCTP_OPERATION_ERROR, cause,
 #if defined(__FreeBSD__)
-	                   mflowtype, mflowid,
+	                   mflowtype, mflowid, fibnum,
 #endif
 	                   vrf_id, port);
 	return;
diff --git a/netinet/sctp_output.h b/netinet/sctp_output.h
index d03bead..361b348 100755
--- a/netinet/sctp_output.h
+++ b/netinet/sctp_output.h
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.h 272751 2014-10-08 15:30:59Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.h 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #ifndef _NETINET_SCTP_OUTPUT_H_
@@ -122,7 +122,7 @@
 void sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *,
                                   struct sctphdr *,
 #if defined(__FreeBSD__)
-                                  uint8_t, uint32_t,
+                                  uint8_t, uint32_t, uint16_t,
 #endif
                                   uint32_t, uint16_t);
 
@@ -215,14 +215,14 @@
 sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *,
                 struct sctphdr *, uint32_t, struct mbuf *,
 #if defined(__FreeBSD__)
-                uint8_t, uint32_t,
+                uint8_t, uint32_t, uint16_t,
 #endif
                 uint32_t, uint16_t);
 
 void sctp_send_operr_to(struct sockaddr *, struct sockaddr *,
                         struct sctphdr *, uint32_t, struct mbuf *,
 #if defined(__FreeBSD__)
-                        uint8_t, uint32_t,
+                        uint8_t, uint32_t, uint16_t,
 #endif
                         uint32_t, uint16_t);
 
diff --git a/netinet/sctp_pcb.c b/netinet/sctp_pcb.c
index d7630a3..b286761 100755
--- a/netinet/sctp_pcb.c
+++ b/netinet/sctp_pcb.c
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 283664 2015-05-28 18:52:32Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #include <netinet/sctp_os.h>
@@ -2846,6 +2846,11 @@
 	inp->reconfig_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_reconfig_enable);
 	inp->nrsack_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_nrsack_enable);
 	inp->pktdrop_supported = (uint8_t)SCTP_BASE_SYSCTL(sctp_pktdrop_enable);
+#if defined(__FreeBSD__)
+	inp->fibnum = so->so_fibnum;
+#else
+	inp->fibnum = 0;
+#endif
 #if defined(__Userspace__)
 	inp->ulp_info = NULL;
 	inp->recv_callback = NULL;
@@ -4655,7 +4660,9 @@
 	}
 #endif /* SCTP_EMBEDDED_V6_SCOPE */
 #endif
-	SCTP_RTALLOC((sctp_route_t *)&net->ro, stcb->asoc.vrf_id);
+	SCTP_RTALLOC((sctp_route_t *)&net->ro,
+	             stcb->asoc.vrf_id,
+	             stcb->sctp_ep->fibnum);
 
 #if defined(__Userspace__)
 	net->src_addr_selected = 0;
diff --git a/netinet/sctp_pcb.h b/netinet/sctp_pcb.h
index 0f124c7..e4ffc56 100755
--- a/netinet/sctp_pcb.h
+++ b/netinet/sctp_pcb.h
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.h 279859 2015-03-10 19:49:25Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.h 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #ifndef _NETINET_SCTP_PCB_H_
@@ -564,6 +564,7 @@
 	uint32_t i_am_here_line;
 #endif
 	uint32_t def_vrf_id;
+	uint16_t fibnum;
 #ifdef SCTP_MVRF
 	uint32_t *m_vrf_ids;
 	uint32_t num_vrfs;
diff --git a/netinet/sctp_usrreq.c b/netinet/sctp_usrreq.c
index 6d5e543..9ef75a9 100755
--- a/netinet/sctp_usrreq.c
+++ b/netinet/sctp_usrreq.c
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 284332 2015-06-12 18:59:29Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #include <netinet/sctp_os.h>
@@ -7591,7 +7591,24 @@
 	size_t optsize = 0;
 	void *p;
 	int error = 0;
+#if defined(__FreeBSD__)
+	struct sctp_inpcb *inp;
+#endif
 
+#if defined(__FreeBSD__)
+	if ((sopt->sopt_level == SOL_SOCKET) &&
+	    (sopt->sopt_name == SO_SETFIB)) {
+		inp = (struct sctp_inpcb *)so->so_pcb;
+		if (inp == NULL) {
+			SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS);
+			return (EINVAL);
+		}
+		SCTP_INP_WLOCK(inp);
+		inp->fibnum = so->so_fibnum;
+		SCTP_INP_WUNLOCK(inp);
+		return (0);
+	}
+#endif
 	if (sopt->sopt_level != IPPROTO_SCTP) {
 		/* wrong proto level... send back up to IP */
 #ifdef INET6
diff --git a/netinet/sctputil.c b/netinet/sctputil.c
index f015566..69d9615 100755
--- a/netinet/sctputil.c
+++ b/netinet/sctputil.c
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 283654 2015-05-28 16:39:22Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #include <netinet/sctp_os.h>
@@ -4075,7 +4075,7 @@
 	}
 	sctp_send_abort(m, iphlen, src, dst, sh, vtag, op_err,
 #if defined(__FreeBSD__)
-	                mflowtype, mflowid,
+	                mflowtype, mflowid, inp->fibnum,
 #endif
 	                vrf_id, port);
 	if (stcb != NULL) {
@@ -4246,7 +4246,7 @@
                  struct sctphdr *sh, struct sctp_inpcb *inp,
                  struct mbuf *cause,
 #if defined(__FreeBSD__)
-                 uint8_t mflowtype, uint32_t mflowid,
+                 uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
 #endif
                  uint32_t vrf_id, uint16_t port)
 {
@@ -4296,7 +4296,7 @@
 		case SCTP_SHUTDOWN_ACK:
 			sctp_send_shutdown_complete2(src, dst, sh,
 #if defined(__FreeBSD__)
-			                             mflowtype, mflowid,
+			                             mflowtype, mflowid, fibnum,
 #endif
 			                             vrf_id, port);
 			return;
@@ -4312,7 +4312,7 @@
 	     (contains_init_chunk == 0))) {
 		sctp_send_abort(m, iphlen, src, dst, sh, 0, cause,
 #if defined(__FreeBSD__)
-		                mflowtype, mflowid,
+		                mflowtype, mflowid, fibnum,
 #endif
 		                vrf_id, port);
 	}
diff --git a/netinet/sctputil.h b/netinet/sctputil.h
index cca915b..cdcb7f8 100755
--- a/netinet/sctputil.h
+++ b/netinet/sctputil.h
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctputil.h 276914 2015-01-10 20:49:57Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctputil.h 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #ifndef _NETINET_SCTP_UTIL_H_
@@ -206,7 +206,7 @@
                       struct sctphdr *, struct sctp_inpcb *,
                       struct mbuf *,
 #if defined(__FreeBSD__)
-                      uint8_t, uint32_t,
+                      uint8_t, uint32_t, uint16_t,
 #endif
                       uint32_t, uint16_t);
 
diff --git a/netinet6/sctp6_usrreq.c b/netinet6/sctp6_usrreq.c
index a46e4c1..493ed45 100644
--- a/netinet6/sctp6_usrreq.c
+++ b/netinet6/sctp6_usrreq.c
@@ -32,7 +32,7 @@
 
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 283650 2015-05-28 16:00:23Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 284515 2015-06-17 15:20:14Z tuexen $");
 #endif
 
 #include <netinet/sctp_os.h>
@@ -163,6 +163,7 @@
 #if defined(__FreeBSD__)
 	uint32_t mflowid;
 	uint8_t mflowtype;
+	uint16_t fibnum;
 #endif
 #if !(defined(__APPLE__) || defined (__FreeBSD__))
 	uint16_t port = 0;
@@ -233,7 +234,8 @@
 #if defined(__FreeBSD__)
 	mflowid = m->m_pkthdr.flowid;
 	mflowtype = M_HASHTYPE_GET(m);
- #endif
+	fibnum = M_GETFIB(m);
+#endif
 	SCTP_STAT_INCR(sctps_recvpackets);
 	SCTP_STAT_INCR_COUNTER64(sctps_inpackets);
 	/* Get IP, SCTP, and first chunk header together in the first mbuf. */
@@ -324,7 +326,7 @@
 #endif
 	                             ecn_bits,
 #if defined(__FreeBSD__)
-	                             mflowtype, mflowid,
+	                             mflowtype, mflowid, fibnum,
 #endif
 	                             vrf_id, port);
  out: