From 857f9ad34acd3e8ffac0b071b8c2a6921fea6cc2 Mon Sep 17 00:00:00 2001 From: Syrone Wong Date: Tue, 10 May 2022 22:18:02 +0800 Subject: [PATCH] Fix IPv6 handling Signed-off-by: Syrone Wong --- src/nf_nat_fullcone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nf_nat_fullcone.c b/src/nf_nat_fullcone.c index b60e31a679c..f48df4b93d2 100644 --- a/src/nf_nat_fullcone.c +++ b/src/nf_nat_fullcone.c @@ -1223,12 +1223,12 @@ static unsigned int nf_nat_handle_prerouting(u8 nfproto, struct sk_buff *skb, un if (nfproto == NFPROTO_IPV4) { newrange->min_addr.ip = mapping->int_addr; newrange->max_addr.ip = mapping->int_addr; + newrange->min_proto.udp.port = cpu_to_be16(mapping->int_port); } else if (nfproto == NFPROTO_IPV6) { newrange->min_addr = mapping_6->int_addr; newrange->max_addr = mapping_6->int_addr; + newrange->min_proto.udp.port = cpu_to_be16(mapping_6->int_port); } - - newrange->min_proto.udp.port = cpu_to_be16(mapping->int_port); newrange->max_proto = newrange->min_proto; if (nfproto == NFPROTO_IPV4) {