diff options
Diffstat (limited to 'net/sctp/protocol.c')
| -rw-r--r-- | net/sctp/protocol.c | 35 | 
1 files changed, 19 insertions, 16 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 5e17092f4ad..6789d785e69 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -23,9 +23,8 @@   * See the GNU General Public License for more details.   *   * You should have received a copy of the GNU General Public License - * along with GNU CC; see the file COPYING.  If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * along with GNU CC; see the file COPYING.  If not, see + * <http://www.gnu.org/licenses/>.   *   * Please send any bug reports or fixes you make to the   * email address(es): @@ -492,8 +491,13 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,  			continue;  		if ((laddr->state == SCTP_ADDR_SRC) &&  		    (AF_INET == laddr->a.sa.sa_family)) { -			fl4->saddr = laddr->a.v4.sin_addr.s_addr;  			fl4->fl4_sport = laddr->a.v4.sin_port; +			flowi4_update_output(fl4, +					     asoc->base.sk->sk_bound_dev_if, +					     RT_CONN_FLAGS(asoc->base.sk), +					     daddr->v4.sin_addr.s_addr, +					     laddr->a.v4.sin_addr.s_addr); +  			rt = ip_route_output_key(sock_net(sk), fl4);  			if (!IS_ERR(rt)) {  				dst = &rt->dst; @@ -635,10 +639,10 @@ static void sctp_addr_wq_timeout_handler(unsigned long arg)  			/* ignore bound-specific endpoints */  			if (!sctp_is_ep_boundall(sk))  				continue; -			sctp_bh_lock_sock(sk); +			bh_lock_sock(sk);  			if (sctp_asconf_mgmt(sp, addrw) < 0)  				pr_debug("%s: sctp_asconf_mgmt failed\n", __func__); -			sctp_bh_unlock_sock(sk); +			bh_unlock_sock(sk);  		}  #if IS_ENABLED(CONFIG_IPV6)  free_next: @@ -958,7 +962,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,  	SCTP_INC_STATS(sock_net(&inet->sk), SCTP_MIB_OUTSCTPPACKS); -	return ip_queue_xmit(skb, &transport->fl); +	return ip_queue_xmit(&inet->sk, skb, &transport->fl);  }  static struct sctp_af sctp_af_inet; @@ -1013,7 +1017,6 @@ static struct inet_protosw sctp_seqpacket_protosw = {  	.protocol   = IPPROTO_SCTP,  	.prot       = &sctp_prot,  	.ops        = &inet_seqpacket_ops, -	.no_check   = 0,  	.flags      = SCTP_PROTOSW_FLAG  };  static struct inet_protosw sctp_stream_protosw = { @@ -1021,7 +1024,6 @@ static struct inet_protosw sctp_stream_protosw = {  	.protocol   = IPPROTO_SCTP,  	.prot       = &sctp_prot,  	.ops        = &inet_seqpacket_ops, -	.no_check   = 0,  	.flags      = SCTP_PROTOSW_FLAG  }; @@ -1031,6 +1033,7 @@ static const struct net_protocol sctp_protocol = {  	.err_handler = sctp_v4_err,  	.no_policy   = 1,  	.netns_ok    = 1, +	.icmp_strict_tag_validation = 1,  };  /* IPv4 address related functions.  */ @@ -1066,8 +1069,8 @@ static struct sctp_af sctp_af_inet = {  #endif  }; -struct sctp_pf *sctp_get_pf_specific(sa_family_t family) { - +struct sctp_pf *sctp_get_pf_specific(sa_family_t family) +{  	switch (family) {  	case PF_INET:  		return sctp_pf_inet_specific; @@ -1100,14 +1103,15 @@ int sctp_register_pf(struct sctp_pf *pf, sa_family_t family)  static inline int init_sctp_mibs(struct net *net)  { -	return snmp_mib_init((void __percpu **)net->sctp.sctp_statistics, -			     sizeof(struct sctp_mib), -			     __alignof__(struct sctp_mib)); +	net->sctp.sctp_statistics = alloc_percpu(struct sctp_mib); +	if (!net->sctp.sctp_statistics) +		return -ENOMEM; +	return 0;  }  static inline void cleanup_sctp_mibs(struct net *net)  { -	snmp_mib_free((void __percpu **)net->sctp.sctp_statistics); +	free_percpu(net->sctp.sctp_statistics);  }  static void sctp_v4_pf_init(void) @@ -1461,7 +1465,6 @@ static __init int sctp_init(void)  	if (status)  		goto err_v6_add_protocol; -	status = 0;  out:  	return status;  err_v6_add_protocol:  | 
