Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says: ==================== Netfilter fixes for net-next This batch contains two fixes for what you have in your net-next, they are: 1) Remove nf_send_reset6() from header file. This function now resides in the nf_reject_ipv6 module. Reported by Eric Dumazet. 2) Fix wrong NFT_REJECT_ICMPX_MAX definition and adjust code to fix errors reported by Dan Carpenter's static analysis tools. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
7b6fa1eef6
3 changed files with 7 additions and 162 deletions
|
@ -72,7 +72,7 @@ nla_put_failure:
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(nft_reject_dump);
|
||||
|
||||
static u8 icmp_code_v4[NFT_REJECT_ICMPX_MAX] = {
|
||||
static u8 icmp_code_v4[NFT_REJECT_ICMPX_MAX + 1] = {
|
||||
[NFT_REJECT_ICMPX_NO_ROUTE] = ICMP_NET_UNREACH,
|
||||
[NFT_REJECT_ICMPX_PORT_UNREACH] = ICMP_PORT_UNREACH,
|
||||
[NFT_REJECT_ICMPX_HOST_UNREACH] = ICMP_HOST_UNREACH,
|
||||
|
@ -81,8 +81,7 @@ static u8 icmp_code_v4[NFT_REJECT_ICMPX_MAX] = {
|
|||
|
||||
int nft_reject_icmp_code(u8 code)
|
||||
{
|
||||
if (code > NFT_REJECT_ICMPX_MAX)
|
||||
return -EINVAL;
|
||||
BUG_ON(code > NFT_REJECT_ICMPX_MAX);
|
||||
|
||||
return icmp_code_v4[code];
|
||||
}
|
||||
|
@ -90,7 +89,7 @@ int nft_reject_icmp_code(u8 code)
|
|||
EXPORT_SYMBOL_GPL(nft_reject_icmp_code);
|
||||
|
||||
|
||||
static u8 icmp_code_v6[NFT_REJECT_ICMPX_MAX] = {
|
||||
static u8 icmp_code_v6[NFT_REJECT_ICMPX_MAX + 1] = {
|
||||
[NFT_REJECT_ICMPX_NO_ROUTE] = ICMPV6_NOROUTE,
|
||||
[NFT_REJECT_ICMPX_PORT_UNREACH] = ICMPV6_PORT_UNREACH,
|
||||
[NFT_REJECT_ICMPX_HOST_UNREACH] = ICMPV6_ADDR_UNREACH,
|
||||
|
@ -99,8 +98,7 @@ static u8 icmp_code_v6[NFT_REJECT_ICMPX_MAX] = {
|
|||
|
||||
int nft_reject_icmpv6_code(u8 code)
|
||||
{
|
||||
if (code > NFT_REJECT_ICMPX_MAX)
|
||||
return -EINVAL;
|
||||
BUG_ON(code > NFT_REJECT_ICMPX_MAX);
|
||||
|
||||
return icmp_code_v6[code];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue