History

netfilter: fix wrong arithmetics regarding NFT_REJECT_ICMPX_MAX

NFT_REJECT_ICMPX_MAX should be __NFT_REJECT_ICMPX_MAX - 1. nft_reject_icmp_code() and nft_reject_icmpv6_code() are called from the packet path, so BUG_ON in case we try to access an unknown abstracted ICMP code. This should not happen since we already validate this from nft_reject_{inet,bridge}_init().

Pablo Neira Ayuso committed 12 years ago

Commit f0d1f041 parent 91c1a092 files · +5 −7Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+1−1
@@ -774,7 +774,7 @@ enum nft_reject_inet_code { · 773 unmodified lines
774774 NFT_REJECT_ICMPX_ADMIN_PROHIBITED,
775775 __NFT_REJECT_ICMPX_MAX
776776 };
777−#define NFT_REJECT_ICMPX_MAX (__NFT_REJECT_ICMPX_MAX + 1)
777+#define NFT_REJECT_ICMPX_MAX (__NFT_REJECT_ICMPX_MAX - 1)
778778
779779 /**
780780 * enum nft_reject_attributes - nf_tables reject expression netlink attributes

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t