mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Revert "icmp: Add counters for rate limits"
This reverts commit3ff50bc627which is commitd0941130c9upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I45a0407c330d682047d4fba1fbabfb245cd0fe5f Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -95,8 +95,6 @@ enum
|
|||||||
ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
|
ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
|
||||||
ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
|
ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
|
||||||
ICMP_MIB_CSUMERRORS, /* InCsumErrors */
|
ICMP_MIB_CSUMERRORS, /* InCsumErrors */
|
||||||
ICMP_MIB_RATELIMITGLOBAL, /* OutRateLimitGlobal */
|
|
||||||
ICMP_MIB_RATELIMITHOST, /* OutRateLimitHost */
|
|
||||||
__ICMP_MIB_MAX
|
__ICMP_MIB_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -114,7 +112,6 @@ enum
|
|||||||
ICMP6_MIB_OUTMSGS, /* OutMsgs */
|
ICMP6_MIB_OUTMSGS, /* OutMsgs */
|
||||||
ICMP6_MIB_OUTERRORS, /* OutErrors */
|
ICMP6_MIB_OUTERRORS, /* OutErrors */
|
||||||
ICMP6_MIB_CSUMERRORS, /* InCsumErrors */
|
ICMP6_MIB_CSUMERRORS, /* InCsumErrors */
|
||||||
ICMP6_MIB_RATELIMITHOST, /* OutRateLimitHost */
|
|
||||||
__ICMP6_MIB_MAX
|
__ICMP6_MIB_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -297,7 +297,6 @@ static bool icmpv4_global_allow(struct net *net, int type, int code)
|
|||||||
if (icmp_global_allow())
|
if (icmp_global_allow())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
__ICMP_INC_STATS(net, ICMP_MIB_RATELIMITGLOBAL);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,8 +326,6 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
|
|||||||
if (peer)
|
if (peer)
|
||||||
inet_putpeer(peer);
|
inet_putpeer(peer);
|
||||||
out:
|
out:
|
||||||
if (!rc)
|
|
||||||
__ICMP_INC_STATS(net, ICMP_MIB_RATELIMITHOST);
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ static void icmp_put(struct seq_file *seq)
|
|||||||
seq_puts(seq, "\nIcmp: InMsgs InErrors InCsumErrors");
|
seq_puts(seq, "\nIcmp: InMsgs InErrors InCsumErrors");
|
||||||
for (i = 0; icmpmibmap[i].name; i++)
|
for (i = 0; icmpmibmap[i].name; i++)
|
||||||
seq_printf(seq, " In%s", icmpmibmap[i].name);
|
seq_printf(seq, " In%s", icmpmibmap[i].name);
|
||||||
seq_puts(seq, " OutMsgs OutErrors OutRateLimitGlobal OutRateLimitHost");
|
seq_puts(seq, " OutMsgs OutErrors");
|
||||||
for (i = 0; icmpmibmap[i].name; i++)
|
for (i = 0; icmpmibmap[i].name; i++)
|
||||||
seq_printf(seq, " Out%s", icmpmibmap[i].name);
|
seq_printf(seq, " Out%s", icmpmibmap[i].name);
|
||||||
seq_printf(seq, "\nIcmp: %lu %lu %lu",
|
seq_printf(seq, "\nIcmp: %lu %lu %lu",
|
||||||
@@ -362,11 +362,9 @@ static void icmp_put(struct seq_file *seq)
|
|||||||
for (i = 0; icmpmibmap[i].name; i++)
|
for (i = 0; icmpmibmap[i].name; i++)
|
||||||
seq_printf(seq, " %lu",
|
seq_printf(seq, " %lu",
|
||||||
atomic_long_read(ptr + icmpmibmap[i].index));
|
atomic_long_read(ptr + icmpmibmap[i].index));
|
||||||
seq_printf(seq, " %lu %lu %lu %lu",
|
seq_printf(seq, " %lu %lu",
|
||||||
snmp_fold_field(net->mib.icmp_statistics, ICMP_MIB_OUTMSGS),
|
snmp_fold_field(net->mib.icmp_statistics, ICMP_MIB_OUTMSGS),
|
||||||
snmp_fold_field(net->mib.icmp_statistics, ICMP_MIB_OUTERRORS),
|
snmp_fold_field(net->mib.icmp_statistics, ICMP_MIB_OUTERRORS));
|
||||||
snmp_fold_field(net->mib.icmp_statistics, ICMP_MIB_RATELIMITGLOBAL),
|
|
||||||
snmp_fold_field(net->mib.icmp_statistics, ICMP_MIB_RATELIMITHOST));
|
|
||||||
for (i = 0; icmpmibmap[i].name; i++)
|
for (i = 0; icmpmibmap[i].name; i++)
|
||||||
seq_printf(seq, " %lu",
|
seq_printf(seq, " %lu",
|
||||||
atomic_long_read(ptr + (icmpmibmap[i].index | 0x100)));
|
atomic_long_read(ptr + (icmpmibmap[i].index | 0x100)));
|
||||||
|
|||||||
@@ -183,7 +183,6 @@ static bool icmpv6_global_allow(struct net *net, int type)
|
|||||||
if (icmp_global_allow())
|
if (icmp_global_allow())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
__ICMP_INC_STATS(net, ICMP_MIB_RATELIMITGLOBAL);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,9 +224,6 @@ static bool icmpv6_xrlim_allow(struct sock *sk, u8 type,
|
|||||||
if (peer)
|
if (peer)
|
||||||
inet_putpeer(peer);
|
inet_putpeer(peer);
|
||||||
}
|
}
|
||||||
if (!res)
|
|
||||||
__ICMP6_INC_STATS(net, ip6_dst_idev(dst),
|
|
||||||
ICMP6_MIB_RATELIMITHOST);
|
|
||||||
dst_release(dst);
|
dst_release(dst);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ static const struct snmp_mib snmp6_icmp6_list[] = {
|
|||||||
SNMP_MIB_ITEM("Icmp6OutMsgs", ICMP6_MIB_OUTMSGS),
|
SNMP_MIB_ITEM("Icmp6OutMsgs", ICMP6_MIB_OUTMSGS),
|
||||||
SNMP_MIB_ITEM("Icmp6OutErrors", ICMP6_MIB_OUTERRORS),
|
SNMP_MIB_ITEM("Icmp6OutErrors", ICMP6_MIB_OUTERRORS),
|
||||||
SNMP_MIB_ITEM("Icmp6InCsumErrors", ICMP6_MIB_CSUMERRORS),
|
SNMP_MIB_ITEM("Icmp6InCsumErrors", ICMP6_MIB_CSUMERRORS),
|
||||||
SNMP_MIB_ITEM("Icmp6OutRateLimitHost", ICMP6_MIB_RATELIMITHOST),
|
|
||||||
SNMP_MIB_SENTINEL
|
SNMP_MIB_SENTINEL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user