swconfig: revert the portmapping patches, they seem to cause a segfault

Revert "kernel/swconfig: remove obsolete portmapping feature from swconfig"

This reverts commit 675407baa4.

Revert "swconfig: remove obsolete portmapping feature"

This reverts commit fca1eb349e.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2016-08-16 10:19:13 +02:00
parent 5846620890
commit 99a1888287
8 changed files with 228 additions and 1 deletions

View File

@@ -41,6 +41,7 @@ enum {
CMD_LOAD,
CMD_HELP,
CMD_SHOW,
CMD_PORTMAP,
};
static void
@@ -284,6 +285,10 @@ int main(int argc, char **argv)
print_usage();
cmd = CMD_LOAD;
ckey = argv[++i];
} else if (!strcmp(arg, "portmap")) {
if (i + 1 < argc)
csegment = argv[++i];
cmd = CMD_PORTMAP;
} else if (!strcmp(arg, "show")) {
cmd = CMD_SHOW;
} else {
@@ -357,6 +362,9 @@ int main(int argc, char **argv)
case CMD_HELP:
list_attributes(dev);
break;
case CMD_PORTMAP:
swlib_print_portmap(dev, csegment);
break;
case CMD_SHOW:
if (cport >= 0 || cvlan >= 0) {
if (cport >= 0)