Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d99fa429 authored by Wei Yongjun's avatar Wei Yongjun Committed by Vlad Yasevich
Browse files

SCTP: Use net_ratelimit to suppress error messages print too fast



When multi bundling SHUTDOWN-ACK message is received in ESTAB state,
this will cause "sctp protocol violation state" message print many times.
If SHUTDOWN-ACK is bundled 300 times in one packet, message will be
print 300 times. The same problem also exists when received unexpected
HEARTBEAT-ACK message which is bundled message times.

This patch used net_ratelimit() to suppress error messages print too fast.

Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
parent 00f1c2df
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1013,6 +1013,7 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
		break;

	case SCTP_DISPOSITION_VIOLATION:
		if (net_ratelimit())
			printk(KERN_ERR "sctp protocol violation state %d "
			       "chunkid %d\n", state, subtype.chunk);
		break;
+14 −12
Original line number Diff line number Diff line
@@ -1032,6 +1032,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
	/* This should never happen, but lets log it if so.  */
	if (unlikely(!link)) {
		if (from_addr.sa.sa_family == AF_INET6) {
			if (net_ratelimit())
				printk(KERN_WARNING
				    "%s association %p could not find address "
				    NIP6_FMT "\n",
@@ -1039,6 +1040,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
				    asoc,
				    NIP6(from_addr.v6.sin6_addr));
		} else {
			if (net_ratelimit())
				printk(KERN_WARNING
				    "%s association %p could not find address "
				    NIPQUAD_FMT "\n",