-/* $FreeBSD$ */
+/* $NetBSD: ip_state.c,v 1.4 2012/12/20 21:42:28 christos Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
/* to pointers and adjusts running stats for the hash table as appropriate. */
/* */
/* This function can fail if the filter rule has had a population policy of */
-/* IP addresses used with stateful filteirng assigned to it. */
+/* IP addresses used with stateful filtering assigned to it. */
/* */
/* Locking: it is assumed that some kind of lock on ipf_state is held. */
/* Exits with is_lock initialised and held - *EVEN IF ERROR*. */
}
/*
- * If we could trust is_hv, then the modulous would not be needed,
+ * If we could trust is_hv, then the modulus would not be needed,
* but when running with IPFILTER_SYNC, this stops bad values.
*/
hv = is->is_hv % softs->ipf_state_size;
SBUMPD(ipf_state_stats, iss_bucket_full);
return 4;
}
+
+ /*
+ * No existing state; create new
+ */
KMALLOC(is, ipstate_t *);
if (is == NULL) {
SBUMPD(ipf_state_stats, iss_nomem);
is->is_rule = fr;
/*
- * Do not do the modulous here, it is done in ipf_state_insert().
+ * Do not do the modulus here, it is done in ipf_state_insert().
*/
if (fr != NULL) {
ipftq_t *tq;
/*
* It may seem strange to set is_ref to 2, but if stsave is not NULL
* then a copy of the pointer is being stored somewhere else and in
- * the end, it will expect to be able to do osmething with it.
+ * the end, it will expect to be able to do something with it.
*/
is->is_me = stsave;
if (stsave != NULL) {