]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/netfilter/xt_tcpudp.c
netfilter: xtables: change matches to return error code
[mirror_ubuntu-artful-kernel.git] / net / netfilter / xt_tcpudp.c
index 00728410099f832e0d10a274cfbe0980a62733eb..efa2ede24ae6120487b453ca6898fd7b7d70be6b 100644 (file)
@@ -125,7 +125,7 @@ static int tcp_mt_check(const struct xt_mtchk_param *par)
        const struct xt_tcp *tcpinfo = par->matchinfo;
 
        /* Must specify no unknown invflags */
-       return !(tcpinfo->invflags & ~XT_TCP_INV_MASK);
+       return (tcpinfo->invflags & ~XT_TCP_INV_MASK) ? -EINVAL : 0;
 }
 
 static bool udp_mt(const struct sk_buff *skb, const struct xt_match_param *par)
@@ -160,7 +160,7 @@ static int udp_mt_check(const struct xt_mtchk_param *par)
        const struct xt_udp *udpinfo = par->matchinfo;
 
        /* Must specify no unknown invflags */
-       return !(udpinfo->invflags & ~XT_UDP_INV_MASK);
+       return (udpinfo->invflags & ~XT_UDP_INV_MASK) ? -EINVAL : 0;
 }
 
 static struct xt_match tcpudp_mt_reg[] __read_mostly = {