[PATCH] iptables-nftables nft: Removes if_nametoindex ,NFT_META_IIF, iniface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch takes care of in interfaces .

diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c
index 25cb177..49a9890 100644
--- a/iptables/nft-shared.c
+++ b/iptables/nft-shared.c
@@ -124,13 +124,8 @@ void add_iniface(struct nft_rule *r, char *iface,
int invflags)
        else
                op = NFT_CMP_EQ;

-       if (iface[iface_len - 1] == '+') {
-               add_meta(r, NFT_META_IIFNAME);
-               add_cmp_ptr(r, op, iface, iface_len - 1);
-       } else {
-               add_meta(r, NFT_META_IIF);
-               add_cmp_u32(r, if_nametoindex(iface), op);
-       }
+       add_meta(r, NFT_META_IIFNAME);
+       add_cmp_ptr(r, op, iface, iface_len);
 }

 void add_addr(struct nft_rule *r, int offset,
@@ -251,15 +242,14 @@ void parse_meta(struct nft_rule_expr *e, uint8_t
key, char *iniface,
                        *invflags |= IPT_INV_VIA_IN;

                memcpy(iniface, ifname, len);
-               iniface[len] = '\0';

-               /* If zero, then this is an interface mask */
-               if (if_nametoindex(iniface) == 0) {
-                       iniface[len] = '+';
-                       iniface[len+1] = '\0';
+               if (iniface[len-1] == '+') {
+                       iniface[len] = '\0';
+                       memset(iniface_mask, 0xff, (len - 1));
+               } else {
+                       iniface[len + 1] = '\0';
+                       memset(iniface_mask, 0xff, (len + 1));
                }
-
-               memset(iniface_mask, 0xff, len);
                break;
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux