]> exis.tech > repos - linux.git/blobdiff - net/netfilter/xt_nat.c
Merge tag 'hwmon-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[linux.git] / net / netfilter / xt_nat.c
index b4f7bbc3f3caf9e3bfcf841da5ff94b01e9ded16..51c7f7ce88d9acd9d715caf1ef3ac263eef273b9 100644 (file)
@@ -26,6 +26,15 @@ static int xt_nat_checkentry_v0(const struct xt_tgchk_param *par)
 
 static int xt_nat_checkentry(const struct xt_tgchk_param *par)
 {
+       switch (par->family) {
+       case NFPROTO_IPV4:
+       case NFPROTO_IPV6:
+       case NFPROTO_INET:
+               break;
+       default:
+               return -EINVAL;
+       }
+
        return nf_ct_netns_get(par->net, par->family);
 }