Use consistent method to determine IPV4_OUTPUT/IPV6_OUTPUT.
MFC after: 3 days
This commit is contained in:
parent
c76b949968
commit
1ebccfd0a2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238122
@ -10971,8 +10971,9 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
|
||||
return;
|
||||
}
|
||||
SCTP_ATTACH_CHAIN(o_pak, mout, len);
|
||||
switch (dst->sa_family) {
|
||||
#ifdef INET
|
||||
if (ip != NULL) {
|
||||
case AF_INET:
|
||||
if (port) {
|
||||
if (V_udp_cksum) {
|
||||
udp->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP));
|
||||
@ -11006,10 +11007,10 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
|
||||
}
|
||||
#endif
|
||||
SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if (ip6 != NULL) {
|
||||
case AF_INET6:
|
||||
ip6->ip6_plen = len - sizeof(struct ip6_hdr);
|
||||
if (port) {
|
||||
#if defined(SCTP_WITH_NO_CSUM)
|
||||
@ -11036,8 +11037,15 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
|
||||
}
|
||||
#endif
|
||||
SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
SCTPDBG(SCTP_DEBUG_OUTPUT1, "Unknown protocol (TSNH) type %d\n",
|
||||
dst->sa_family);
|
||||
sctp_m_freem(mout);
|
||||
SCTP_LTRACE_ERR_RET_PKT(mout, NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT);
|
||||
return;
|
||||
}
|
||||
SCTP_STAT_INCR(sctps_sendpackets);
|
||||
SCTP_STAT_INCR_COUNTER64(sctps_outpackets);
|
||||
SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks);
|
||||
|
Loading…
Reference in New Issue
Block a user