[PATCH 3.16 258/294] netfilter; Add some missing default cases to switch statements in nft_reject.
From: Ben Hutchings
Date: Mon Nov 06 2017 - 19:58:37 EST
3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
commit 129d23a56623eea0947a05288158d76dc7f2f0ac upstream.
This fixes:
====================
net/netfilter/nft_reject.c: In function ânft_reject_dumpâ:
net/netfilter/nft_reject.c:61:2: warning: enumeration value âNFT_REJECT_TCP_RSTâ not handled in switch [-Wswitch]
switch (priv->type) {
^
net/netfilter/nft_reject.c:61:2: warning: enumeration value âNFT_REJECT_ICMPX_UNREACHâ not handled in switch [-Wswi\
tch]
net/netfilter/nft_reject_inet.c: In function ânft_reject_inet_dumpâ:
net/netfilter/nft_reject_inet.c:105:2: warning: enumeration value âNFT_REJECT_TCP_RSTâ not handled in switch [-Wswi\
tch]
switch (priv->type) {
^
====================
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
net/netfilter/nft_reject.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/netfilter/nft_reject.c
+++ b/net/netfilter/nft_reject.c
@@ -61,6 +61,8 @@ int nft_reject_dump(struct sk_buff *skb,
if (nla_put_u8(skb, NFTA_REJECT_ICMP_CODE, priv->icmp_code))
goto nla_put_failure;
break;
+ default:
+ break;
}
return 0;