ipf.c (7c478bd9) | ipf.c (7663b816) |
---|---|
1/* 2 * Copyright (C) 1993-2001 by Darren Reed. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 * 6 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 7 * Use is subject to license terms. 8 */ --- 346 unchanged lines hidden (view full) --- 355 if (!strcmp(arg, "s") || !strcmp(arg, "S")) { 356 if (*arg == 'S') 357 fl = 0; 358 else 359 fl = 1; 360 rem = fl; 361 362 closedevice(); | 1/* 2 * Copyright (C) 1993-2001 by Darren Reed. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 * 6 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 7 * Use is subject to license terms. 8 */ --- 346 unchanged lines hidden (view full) --- 355 if (!strcmp(arg, "s") || !strcmp(arg, "S")) { 356 if (*arg == 'S') 357 fl = 0; 358 else 359 fl = 1; 360 rem = fl; 361 362 closedevice(); |
363 if (opendevice(IPSTATE_NAME, 1) != -2 && 364 ioctl(fd, SIOCIPFFL, &fl) == -1) 365 perror("ioctl(SIOCIPFFL)"); | 363 364 if (opendevice(IPSTATE_NAME, 1) != -2) { 365 if (use_inet6) { 366#ifdef USE_INET6 367 if (ioctl(fd, SIOCIPFL6, &fl) == -1) 368 perror("SIOCIPFL6"); 369#endif 370 } else { 371 if (ioctl(fd, SIOCIPFFL, &fl) == -1) 372 perror("SIOCIPFFL"); 373 } 374 } 375 |
366 if ((opts & (OPT_DONOTHING|OPT_VERBOSE)) == OPT_VERBOSE) { 367 printf("remove flags %s (%d)\n", arg, rem); 368 printf("removed %d filter rules\n", fl); 369 } 370 closedevice(); 371 return; 372 } 373 --- 19 unchanged lines hidden (view full) --- 393 if (strchr(arg, 'o') || strchr(arg, 'O')) 394 fl = FR_OUTQUE; 395 if (strchr(arg, 'a') || strchr(arg, 'A')) 396 fl = FR_OUTQUE|FR_INQUE; 397 if (opts & OPT_INACTIVE) 398 fl |= FR_INACTIVE; 399 rem = fl; 400 | 376 if ((opts & (OPT_DONOTHING|OPT_VERBOSE)) == OPT_VERBOSE) { 377 printf("remove flags %s (%d)\n", arg, rem); 378 printf("removed %d filter rules\n", fl); 379 } 380 closedevice(); 381 return; 382 } 383 --- 19 unchanged lines hidden (view full) --- 403 if (strchr(arg, 'o') || strchr(arg, 'O')) 404 fl = FR_OUTQUE; 405 if (strchr(arg, 'a') || strchr(arg, 'A')) 406 fl = FR_OUTQUE|FR_INQUE; 407 if (opts & OPT_INACTIVE) 408 fl |= FR_INACTIVE; 409 rem = fl; 410 |
401 if (opendevice(ipfname, 1) != -2 && ioctl(fd, SIOCIPFFL, &fl) == -1) 402 perror("ioctl(SIOCIPFFL)"); | 411 if (opendevice(ipfname, 1) != -2) { 412 if (use_inet6) { 413#ifdef USE_INET6 414 if (ioctl(fd, SIOCIPFL6, &fl) == -1) 415 perror("SIOCIPFL6"); 416#endif 417 } else { 418 if (ioctl(fd, SIOCIPFFL, &fl) == -1) 419 perror("SIOCIPFFL"); 420 } 421 } 422 |
403 if ((opts & (OPT_DONOTHING|OPT_VERBOSE)) == OPT_VERBOSE) { 404 printf("remove flags %s%s (%d)\n", (rem & FR_INQUE) ? "I" : "", 405 (rem & FR_OUTQUE) ? "O" : "", rem); 406 printf("removed %d filter rules\n", fl); 407 } 408 return; 409} 410 --- 234 unchanged lines hidden --- | 423 if ((opts & (OPT_DONOTHING|OPT_VERBOSE)) == OPT_VERBOSE) { 424 printf("remove flags %s%s (%d)\n", (rem & FR_INQUE) ? "I" : "", 425 (rem & FR_OUTQUE) ? "O" : "", rem); 426 printf("removed %d filter rules\n", fl); 427 } 428 return; 429} 430 --- 234 unchanged lines hidden --- |