diff options
-rw-r--r-- | net/netfilter/nft_nat.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/netfilter/nft_nat.c b/net/netfilter/nft_nat.c index a95e0c1addd3..afe2b0b45ec4 100644 --- a/net/netfilter/nft_nat.c +++ b/net/netfilter/nft_nat.c | |||
@@ -191,17 +191,19 @@ static int nft_nat_dump(struct sk_buff *skb, const struct nft_expr *expr) | |||
191 | 191 | ||
192 | if (nla_put_be32(skb, NFTA_NAT_FAMILY, htonl(priv->family))) | 192 | if (nla_put_be32(skb, NFTA_NAT_FAMILY, htonl(priv->family))) |
193 | goto nla_put_failure; | 193 | goto nla_put_failure; |
194 | if (nla_put_be32(skb, | 194 | |
195 | NFTA_NAT_REG_ADDR_MIN, htonl(priv->sreg_addr_min))) | 195 | if (priv->sreg_addr_min) { |
196 | goto nla_put_failure; | 196 | if (nla_put_be32(skb, NFTA_NAT_REG_ADDR_MIN, |
197 | if (nla_put_be32(skb, | 197 | htonl(priv->sreg_addr_min)) || |
198 | NFTA_NAT_REG_ADDR_MAX, htonl(priv->sreg_addr_max))) | 198 | nla_put_be32(skb, NFTA_NAT_REG_ADDR_MAX, |
199 | goto nla_put_failure; | 199 | htonl(priv->sreg_addr_max))) |
200 | goto nla_put_failure; | ||
201 | } | ||
202 | |||
200 | if (priv->sreg_proto_min) { | 203 | if (priv->sreg_proto_min) { |
201 | if (nla_put_be32(skb, NFTA_NAT_REG_PROTO_MIN, | 204 | if (nla_put_be32(skb, NFTA_NAT_REG_PROTO_MIN, |
202 | htonl(priv->sreg_proto_min))) | 205 | htonl(priv->sreg_proto_min)) || |
203 | goto nla_put_failure; | 206 | nla_put_be32(skb, NFTA_NAT_REG_PROTO_MAX, |
204 | if (nla_put_be32(skb, NFTA_NAT_REG_PROTO_MAX, | ||
205 | htonl(priv->sreg_proto_max))) | 207 | htonl(priv->sreg_proto_max))) |
206 | goto nla_put_failure; | 208 | goto nla_put_failure; |
207 | } | 209 | } |