netfilter: nft_nat: don't dump port information if unset
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: nft_nat: don't dump port information if unset
Don't include port information attributes if they are unset.
Reported-by Ana Rey <[email protected]>
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nft_nat.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
net/netfilter/nft_nat.c +8 -6
@@ -175,12 +175,14 @@ static int nft_nat_dump(struct sk_buff *skb, const struct nft_expr *expr)if (nla_put_be32 (skb,NFTA_NAT_REG_ADDR_MAX ,htonl (priv->sreg_addr_max))) goto nla_put_failure; -if (nla_put_be32 (skb, -NFTA_NAT_REG_PROTO_MIN ,htonl (priv->sreg_proto_min))) - goto nla_put_failure; -if (nla_put_be32 (skb, -NFTA_NAT_REG_PROTO_MAX ,htonl (priv->sreg_proto_max))) - goto nla_put_failure; +if (priv->sreg_proto_min) { +if (nla_put_be32 (skb,NFTA_NAT_REG_PROTO_MIN , +htonl (priv->sreg_proto_min))) + goto nla_put_failure; +if (nla_put_be32 (skb,NFTA_NAT_REG_PROTO_MAX , +htonl (priv->sreg_proto_max))) + goto nla_put_failure; + }return 0 ; nla_put_failure:
Signature · 1 line
1.7.10.4