summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-01-14 12:31:38 +0000
committerPatrick McHardy <kaber@trash.net>2014-01-14 12:31:38 +0000
commit7d98127b61f5e530388ff2344ace69a292a9829d (patch)
tree86292dd6142764e406821465db1950def498fd30
parent3f8820318302da097795ba7d8b2ae3f6dff6cf2e (diff)
parent5e8f8a1807917f92e568437598670b0026462c1c (diff)
Merge remote-tracking branch 'origin/master' into next-3.14
-rw-r--r--Makefile.defs.in1
-rw-r--r--Makefile.rules.in2
-rw-r--r--configure.ac1
-rw-r--r--doc/Makefile.in4
-rw-r--r--files/Makefile.in3
-rw-r--r--src/netlink_delinearize.c8
-rw-r--r--src/netlink_linearize.c14
-rw-r--r--src/parser.y3
-rw-r--r--src/scanner.l1
9 files changed, 19 insertions, 18 deletions
diff --git a/Makefile.defs.in b/Makefile.defs.in
index 502f3748..3fee9c22 100644
--- a/Makefile.defs.in
+++ b/Makefile.defs.in
@@ -5,6 +5,7 @@ LEX = @LEX@
YACC = @YACC@
MKDIR_P = @MKDIR_P@
INSTALL = @INSTALL@
+SED = @SED@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
diff --git a/Makefile.rules.in b/Makefile.rules.in
index a93a26bd..25988dd7 100644
--- a/Makefile.rules.in
+++ b/Makefile.rules.in
@@ -61,7 +61,7 @@ clean_targets += $(1)-clean
$(1)-install:
@echo -e " INSTALL\t$1"
$(MKDIR_P) $$(DESTDIR)/$$($(1)-destdir)
- $(INSTALL) -m 755 -o root -g root \
+ $(INSTALL) -m 755 -p \
$(SUBDIR)$(1) \
$$(DESTDIR)/$$($(1)-destdir)/$(1)
install_targets += $(1)-install
diff --git a/configure.ac b/configure.ac
index 811d7e22..ca14d835 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,7 @@ AC_SUBST([CONFIG_DEBUG])
AC_PROG_CC
AC_PROG_MKDIR_P
AC_PROG_INSTALL
+AC_PROG_SED
AC_CHECK_PROG(CONFIG_MAN, docbook2x-man, y, n)
if test "$CONFIG_MAN" != "y"
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 2c42d7e5..e0732adb 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -10,11 +10,11 @@ install: $(mandocs-y) $(pdfdocs-y)
@echo -e " INSTALL\tdoc"
if test -n "$(mandocs-y)"; then \
$(MKDIR_P) $(DESTDIR)/${mandir}/man8 ;\
- $(INSTALL) -m 755 -o root -g root $(mandocs-y) \
+ $(INSTALL) -m 755 -p $(mandocs-y) \
$(DESTDIR)/${mandir}/man8/ ;\
fi
if test -n "$(pdfdocs-y)"; then \
$(MKDIR_P) $(DESTDIR)/${pdfdir} ;\
- $(INSTALL) -m 755 -o root -g root $(pdfdocs-y) \
+ $(INSTALL) -m 755 -p $(pdfdocs-y) \
$(DESTDIR)/${pdfdir}/ ;\
fi
diff --git a/files/Makefile.in b/files/Makefile.in
index cd67c37d..dc237e23 100644
--- a/files/Makefile.in
+++ b/files/Makefile.in
@@ -1,4 +1,5 @@
install:
@echo -e " INSTALL\tfiles"
$(MKDIR_P) $(DESTDIR)/$(confdir)
- $(INSTALL) -m 755 -o root -g root $(SUBDIR)nftables/* $(DESTDIR)/$(confdir)/
+ $(INSTALL) -m 755 -p $(SUBDIR)nftables/* $(DESTDIR)/$(confdir)/
+ $(SED) -i "s~#\! nft~#\!@sbindir@/nft~" $(DESTDIR)/$(confdir)/*
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index 8f6ee381..59b50745 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -103,7 +103,7 @@ static void netlink_parse_immediate(struct netlink_parse_ctx *ctx,
static enum ops netlink_parse_cmp_op(const struct nft_rule_expr *nle)
{
- switch (nft_rule_expr_get_u8(nle, NFT_EXPR_CMP_OP)) {
+ switch (nft_rule_expr_get_u32(nle, NFT_EXPR_CMP_OP)) {
case NFT_CMP_EQ:
return OP_EQ;
case NFT_CMP_NEQ:
@@ -132,7 +132,7 @@ static void netlink_parse_cmp(struct netlink_parse_ctx *ctx,
nld.value = nft_rule_expr_get(nle, NFT_EXPR_CMP_DATA, &nld.len);
left = netlink_get_register(ctx, loc,
- nft_rule_expr_get_u8(nle, NFT_EXPR_CMP_SREG));
+ nft_rule_expr_get_u32(nle, NFT_EXPR_CMP_SREG));
if (left == NULL)
return netlink_error(ctx, loc,
"Relational expression has no left "
@@ -332,9 +332,9 @@ static void netlink_parse_meta_dreg(struct netlink_parse_ctx *ctx,
struct expr *expr;
expr = meta_expr_alloc(loc,
- nft_rule_expr_get_u8(nle, NFT_EXPR_META_KEY));
+ nft_rule_expr_get_u32(nle, NFT_EXPR_META_KEY));
netlink_set_register(ctx,
- nft_rule_expr_get_u8(nle, NFT_EXPR_META_DREG),
+ nft_rule_expr_get_u32(nle, NFT_EXPR_META_DREG),
expr);
}
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index 9ae9bb76..332383af 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -210,9 +210,9 @@ static void netlink_gen_cmp(struct netlink_linearize_ctx *ctx,
}
nle = alloc_nft_expr("cmp");
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_OP,
- netlink_gen_cmp_op(expr->op));
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP,
+ netlink_gen_cmp_op(expr->op));
netlink_gen_data(right, &nld);
nft_rule_expr_set(nle, NFT_EXPR_CMP_DATA, nld.value, nld.len);
release_register(ctx);
@@ -235,7 +235,7 @@ static void netlink_gen_range(struct netlink_linearize_ctx *ctx,
netlink_gen_expr(ctx, expr->left, sreg);
nle = alloc_nft_expr("cmp");
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP,
netlink_gen_cmp_op(OP_GTE));
netlink_gen_data(range->left, &nld);
@@ -243,7 +243,7 @@ static void netlink_gen_range(struct netlink_linearize_ctx *ctx,
nft_rule_add_expr(ctx->nlr, nle);
nle = alloc_nft_expr("cmp");
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP,
netlink_gen_cmp_op(OP_LTE));
netlink_gen_data(range->right, &nld);
@@ -283,8 +283,8 @@ static void netlink_gen_flagcmp(struct netlink_linearize_ctx *ctx,
nle = alloc_nft_expr("cmp");
netlink_gen_raw_data(zero, expr->right->byteorder, len, &nld);
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_SREG, sreg);
- nft_rule_expr_set_u8(nle, NFT_EXPR_CMP_OP, NFT_CMP_NEQ);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_SREG, sreg);
+ nft_rule_expr_set_u32(nle, NFT_EXPR_CMP_OP, NFT_CMP_NEQ);
netlink_gen_data(expr->right, &nld);
nft_rule_expr_set(nle, NFT_EXPR_CMP_DATA, nld.value, nld.len);
nft_rule_add_expr(ctx->nlr, nle);
diff --git a/src/parser.y b/src/parser.y
index 7c18875d..e5610e5a 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -150,7 +150,6 @@ static void location_update(struct location *loc, struct location *rhs, int n)
%token DASH "-"
%token AT "@"
%token ARROW "=>"
-%token VMAP "vmap"
%token INCLUDE "include"
%token DEFINE "define"
@@ -1273,7 +1272,7 @@ map_expr : concat_expr MAP expr
}
;
-verdict_map_expr : concat_expr VMAP expr
+verdict_map_expr : concat_expr MAP expr
{
$$ = map_expr_alloc(&@$, $1, $3);
}
diff --git a/src/scanner.l b/src/scanner.l
index 0b8abacb..5a5ec723 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -210,7 +210,6 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
"$" { return '$'; }
"=" { return '='; }
"=>" { return ARROW; }
-"vmap" { return VMAP; }
"include" { return INCLUDE; }
"define" { return DEFINE; }