Deleted Added
full compact
ip_auth.c (92685) ip_auth.c (95418)
1/*
2 * Copyright (C) 1998-2001 by Darren Reed & Guido van Rooij.
3 *
4 * See the IPFILTER.LICENCE file for details on licencing.
5 */
6#ifdef __sgi
7# include <sys/ptimers.h>
8#endif

--- 91 unchanged lines hidden (view full) ---

100# if (defined(_KERNEL) || defined(KERNEL)) && !defined(IPFILTER_LKM)
101# include <sys/libkern.h>
102# include <sys/systm.h>
103# endif
104#endif
105
106#if !defined(lint)
107/* static const char rcsid[] = "@(#)$Id: ip_auth.c,v 2.11.2.12 2001/07/18 14:57:08 darrenr Exp $"; */
1/*
2 * Copyright (C) 1998-2001 by Darren Reed & Guido van Rooij.
3 *
4 * See the IPFILTER.LICENCE file for details on licencing.
5 */
6#ifdef __sgi
7# include <sys/ptimers.h>
8#endif

--- 91 unchanged lines hidden (view full) ---

100# if (defined(_KERNEL) || defined(KERNEL)) && !defined(IPFILTER_LKM)
101# include <sys/libkern.h>
102# include <sys/systm.h>
103# endif
104#endif
105
106#if !defined(lint)
107/* static const char rcsid[] = "@(#)$Id: ip_auth.c,v 2.11.2.12 2001/07/18 14:57:08 darrenr Exp $"; */
108static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/ip_auth.c 92685 2002-03-19 11:44:16Z darrenr $";
108static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/ip_auth.c 95418 2002-04-25 03:31:39Z darrenr $";
109#endif
110
111
112#if (SOLARIS || defined(__sgi)) && defined(_KERNEL)
113extern KRWLOCK_T ipf_auth, ipf_mutex;
114extern kmutex_t ipf_authmx;
115# if SOLARIS
116extern kcondvar_t ipfauthwait;

--- 288 unchanged lines hidden (view full) ---

405 SPL_NET(s);
406 fr_authnext++;
407 if (fr_authnext == FR_NUMAUTH)
408 fr_authnext = 0;
409 SPL_X(s);
410 RWLOCK_EXIT(&ipf_auth);
411 return 0;
412 }
109#endif
110
111
112#if (SOLARIS || defined(__sgi)) && defined(_KERNEL)
113extern KRWLOCK_T ipf_auth, ipf_mutex;
114extern kmutex_t ipf_authmx;
115# if SOLARIS
116extern kcondvar_t ipfauthwait;

--- 288 unchanged lines hidden (view full) ---

405 SPL_NET(s);
406 fr_authnext++;
407 if (fr_authnext == FR_NUMAUTH)
408 fr_authnext = 0;
409 SPL_X(s);
410 RWLOCK_EXIT(&ipf_auth);
411 return 0;
412 }
413 RWLOCK_EXIT(&ipf_auth);
413#ifdef _KERNEL
414# if SOLARIS
415 mutex_enter(&ipf_authmx);
416 if (!cv_wait_sig(&ipfauthwait, &ipf_authmx)) {
417 mutex_exit(&ipf_authmx);
418 return EINTR;
419 }
420 mutex_exit(&ipf_authmx);
421# else
422 error = SLEEP(&fr_authnext, "fr_authnext");
423# endif
424#endif
414#ifdef _KERNEL
415# if SOLARIS
416 mutex_enter(&ipf_authmx);
417 if (!cv_wait_sig(&ipfauthwait, &ipf_authmx)) {
418 mutex_exit(&ipf_authmx);
419 return EINTR;
420 }
421 mutex_exit(&ipf_authmx);
422# else
423 error = SLEEP(&fr_authnext, "fr_authnext");
424# endif
425#endif
425 RWLOCK_EXIT(&ipf_auth);
426 if (!error)
427 goto fr_authioctlloop;
428 break;
429 case SIOCAUTHR:
430 if (!(mode & FWRITE)) {
431 error = EPERM;
432 break;
433 }

--- 13 unchanged lines hidden (view full) ---

447 m = fr_authpkts[i];
448 fra->fra_index = -2;
449 fra->fra_pass = au->fra_pass;
450 fr_authpkts[i] = NULL;
451 RWLOCK_EXIT(&ipf_auth);
452#ifdef _KERNEL
453 if (m && au->fra_info.fin_out) {
454# if SOLARIS
426 if (!error)
427 goto fr_authioctlloop;
428 break;
429 case SIOCAUTHR:
430 if (!(mode & FWRITE)) {
431 error = EPERM;
432 break;
433 }

--- 13 unchanged lines hidden (view full) ---

447 m = fr_authpkts[i];
448 fra->fra_index = -2;
449 fra->fra_pass = au->fra_pass;
450 fr_authpkts[i] = NULL;
451 RWLOCK_EXIT(&ipf_auth);
452#ifdef _KERNEL
453 if (m && au->fra_info.fin_out) {
454# if SOLARIS
455 error = fr_qout(fra->fra_q, m);
455 error = (fr_qout(fra->fra_q, m) == 0) ? EINVAL : 0;
456# else /* SOLARIS */
457 struct route ro;
458
459 bzero((char *)&ro, sizeof(ro));
460# if ((_BSDI_VERSION >= 199802) && (_BSDI_VERSION < 200005)) || \
461 defined(__OpenBSD__) || (defined(IRIX) && (IRIX >= 605))
462 error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL,
463 NULL);

--- 5 unchanged lines hidden (view full) ---

469 }
470# endif /* SOLARIS */
471 if (error)
472 fr_authstats.fas_sendfail++;
473 else
474 fr_authstats.fas_sendok++;
475 } else if (m) {
476# if SOLARIS
456# else /* SOLARIS */
457 struct route ro;
458
459 bzero((char *)&ro, sizeof(ro));
460# if ((_BSDI_VERSION >= 199802) && (_BSDI_VERSION < 200005)) || \
461 defined(__OpenBSD__) || (defined(IRIX) && (IRIX >= 605))
462 error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL,
463 NULL);

--- 5 unchanged lines hidden (view full) ---

469 }
470# endif /* SOLARIS */
471 if (error)
472 fr_authstats.fas_sendfail++;
473 else
474 fr_authstats.fas_sendok++;
475 } else if (m) {
476# if SOLARIS
477 error = fr_qin(fra->fra_q, m);
477 error = (fr_qin(fra->fra_q, m) == 0) ? EINVAL : 0;
478# else /* SOLARIS */
479 if (! IF_HANDOFF(&ipintrq, m, NULL))
480 error = ENOBUFS;
481 else
482 schednetisr(NETISR_IP);
483# endif /* SOLARIS */
484 if (error)
485 fr_authstats.fas_quefail++;

--- 142 unchanged lines hidden ---
478# else /* SOLARIS */
479 if (! IF_HANDOFF(&ipintrq, m, NULL))
480 error = ENOBUFS;
481 else
482 schednetisr(NETISR_IP);
483# endif /* SOLARIS */
484 if (error)
485 fr_authstats.fas_quefail++;

--- 142 unchanged lines hidden ---