aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/nf_nat_proto_common.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/net/ipv4/netfilter/nf_nat_proto_common.c b/net/ipv4/netfilter/nf_nat_proto_common.c
index ef4dc3988925..4904b86265e1 100644
--- a/net/ipv4/netfilter/nf_nat_proto_common.c
+++ b/net/ipv4/netfilter/nf_nat_proto_common.c
@@ -105,24 +105,16 @@ EXPORT_SYMBOL_GPL(nf_nat_proto_nlattr_to_range);
105int nf_nat_proto_nlattr_to_range(struct nlattr *tb[], 105int nf_nat_proto_nlattr_to_range(struct nlattr *tb[],
106 struct nf_nat_range *range) 106 struct nf_nat_range *range)
107{ 107{
108 int ret = 0;
109
110 /* we have to return whether we actually parsed something or not */
111
112 if (tb[CTA_PROTONAT_PORT_MIN]) { 108 if (tb[CTA_PROTONAT_PORT_MIN]) {
113 ret = 1;
114 range->min.all = nla_get_be16(tb[CTA_PROTONAT_PORT_MIN]); 109 range->min.all = nla_get_be16(tb[CTA_PROTONAT_PORT_MIN]);
110 range->max.all = range->min.tcp.port;
111 range->flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
115 } 112 }
116 113 if (tb[CTA_PROTONAT_PORT_MAX]) {
117 if (!tb[CTA_PROTONAT_PORT_MAX]) {
118 if (ret)
119 range->max.all = range->min.all;
120 } else {
121 ret = 1;
122 range->max.all = nla_get_be16(tb[CTA_PROTONAT_PORT_MAX]); 114 range->max.all = nla_get_be16(tb[CTA_PROTONAT_PORT_MAX]);
115 range->flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
123 } 116 }
124 117 return 0;
125 return ret;
126} 118}
127EXPORT_SYMBOL_GPL(nf_nat_proto_range_to_nlattr); 119EXPORT_SYMBOL_GPL(nf_nat_proto_range_to_nlattr);
128#endif 120#endif