--- ipvsadm.c.orig Tue May 23 10:59:37 2000 +++ ipvsadm.c Tue May 23 10:58:16 2000 @@ -39,6 +39,10 @@ * Horms : ensure that a -r is passed when needed * Wensong Zhang : fixed the output of fwmark rules * Horms : added kernel version verification + * Horms : Specifying command and option options + * (e.g. -Ln or -At) in one short option + * with popt problem fixed. + * * * ippfvsadm - Port Fowarding & Virtual Server ADMinistration program * @@ -488,12 +492,26 @@ #ifdef HAVE_POPT poptFreeContext(context); + context = poptGetContext("ipvsadm", argc, argv, options_sub, 0); /* - * Discard the first argumet, which we have already paresed - */ - poptGetNextOpt(context); + * Mangle the first argument + * The first option from this argument has been read, + * but there may be others + */ + c=strlen(argv[1]); + if(c>2){ + if(argv[1][1] != '-'){ + /* Suffle first option out of argument */ + memmove(argv[1]+1, argv[1]+2, c-2); + argv[1][c-1]='\0'; + } + } + else{ + /* Skip argument */ + poptGetNextOpt(context); + } while ((c=poptGetNextOpt(context)) >= 0){ #else