Skip to contentSkip to conversation

netfilter: nf_tables: add reject module for NFPROTO_INET

DISCUSSION Dave Jones 2 participants 2 messages Feb 12, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#1 lore raw
In reply to a message not in the archive
Quoted 16 lines · Linux Kernel
Gitweb:     http://git.kernel.org/linus/;a=commit;h=05513e9e33dbded8124567466a444d32173eecc6
Commit:     05513e9e33dbded8124567466a444d32173eecc6
Parent:     cc4723ca316742891954efa346298e7c747c0d17
Author:     Patrick McHardy <[email protected]>
AuthorDate: Wed Feb 5 15:03:39 2014 +0000
Committer:  Pablo Neira Ayuso <[email protected]>
CommitDate: Thu Feb 6 09:44:18 2014 +0100

netfilter: nf_tables: add reject module for NFPROTO_INET

Add a reject module for NFPROTO_INET. It does nothing but dispatch to the AF-specific modules based on the hook family.

---

....

Review

Quoted 11 lines
(quoted diff) +11 -0
+static void nft_reject_inet_eval(const struct nft_expr *expr,
+				 struct nft_data data[NFT_REG_MAX + 1],
+				 const struct nft_pktinfo *pkt)
+{
+	switch (pkt->ops->pf) {
+	case NFPROTO_IPV4:
+		nft_reject_ipv4_eval(expr, data, pkt);
+	case NFPROTO_IPV6:
+		nft_reject_ipv6_eval(expr, data, pkt);
+	}
+}

Is the fallthrough intentional here, or is there a missing break ?

Dave

#2 lore raw
Quoted 20 lines · Dave Jones
Quoted 16 lines · Linux Kernel
Gitweb:     http://git.kernel.org/linus/;a=commit;h=05513e9e33dbded8124567466a444d32173eecc6
Commit:     05513e9e33dbded8124567466a444d32173eecc6
Parent:     cc4723ca316742891954efa346298e7c747c0d17
Author:     Patrick McHardy <[email protected]>
AuthorDate: Wed Feb 5 15:03:39 2014 +0000
Committer:  Pablo Neira Ayuso <[email protected]>
CommitDate: Thu Feb 6 09:44:18 2014 +0100

netfilter: nf_tables: add reject module for NFPROTO_INET

Add a reject module for NFPROTO_INET. It does nothing but dispatch to the AF-specific modules based on the hook family.

---

....

Quoted 13 lines

Review

Quoted 11 lines
(quoted diff) +11 -0
+static void nft_reject_inet_eval(const struct nft_expr *expr,
+				 struct nft_data data[NFT_REG_MAX + 1],
+				 const struct nft_pktinfo *pkt)
+{
+	switch (pkt->ops->pf) {
+	case NFPROTO_IPV4:
+		nft_reject_ipv4_eval(expr, data, pkt);
+	case NFPROTO_IPV6:
+		nft_reject_ipv6_eval(expr, data, pkt);
+	}
+}

Is the fallthrough intentional here, or is there a missing break ?

Crap. Thanks for catching this, I'll send a fix later.