mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
map: fix portsets starting with 0 and use regular NAT for 1:1 MAP
Signed-off-by: Steven Barth <steven@midlink.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42741 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -343,14 +343,17 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
if (psidlen == 0) {
|
||||
printf("RULE_%d_PORTSETS=0-65535\n", rulecnt);
|
||||
} else if (psid >= 0) {
|
||||
if (psidlen > 0 && psid >= 0) {
|
||||
printf("RULE_%d_PORTSETS='", rulecnt);
|
||||
for (int k = (offset) ? 1 : 0; k < (1 << offset); ++k) {
|
||||
int start = (k << (16 - offset)) | (psid >> offset);
|
||||
int end = start + (1 << (16 - offset - psidlen)) - 1;
|
||||
printf("%d-%d ", start, end);
|
||||
|
||||
if (start == 0)
|
||||
start = 1;
|
||||
|
||||
if (start <= end)
|
||||
printf("%d-%d ", start, end);
|
||||
}
|
||||
printf("'\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user