summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias/alias_mod.c
diff options
context:
space:
mode:
authorpiso <piso@FreeBSD.org>2009-04-08 11:56:49 +0000
committerpiso <piso@FreeBSD.org>2009-04-08 11:56:49 +0000
commit5551ee2e3d1c8bf42ad84be6cd576d32c108ced4 (patch)
treec31101909fbad146ea2f40aa38b2d6a067973466 /sys/netinet/libalias/alias_mod.c
parentd271d75d6e163a5db92e5a0bbd34157d11c5fb50 (diff)
downloadFreeBSD-src-5551ee2e3d1c8bf42ad84be6cd576d32c108ced4.zip
FreeBSD-src-5551ee2e3d1c8bf42ad84be6cd576d32c108ced4.tar.gz
-don't pass down, to module's fingerprint function, unused data like
a pointer to the ip header. -style -spacing
Diffstat (limited to 'sys/netinet/libalias/alias_mod.c')
-rw-r--r--sys/netinet/libalias/alias_mod.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/sys/netinet/libalias/alias_mod.c b/sys/netinet/libalias/alias_mod.c
index 643fe5f..2713137 100644
--- a/sys/netinet/libalias/alias_mod.c
+++ b/sys/netinet/libalias/alias_mod.c
@@ -133,9 +133,10 @@ handler_chain_destroy(void)
static int
_attach_handler(struct proto_handler *p)
{
- struct proto_handler *b = NULL;
+ struct proto_handler *b;
- LIBALIAS_WLOCK_ASSERT();
+ LIBALIAS_WLOCK_ASSERT();
+ b = NULL;
LIST_FOREACH(b, &handler_chain, entries) {
if ((b->pri == p->pri) &&
(b->dir == p->dir) &&
@@ -172,10 +173,11 @@ _detach_handler(struct proto_handler *p)
int
LibAliasAttachHandlers(struct proto_handler *_p)
{
- int i, error = -1;
+ int i, error;
LIBALIAS_WLOCK();
- for (i=0; 1; i++) {
+ error = -1;
+ for (i = 0; 1; i++) {
if (*((int *)&_p[i]) == EOH)
break;
error = _attach_handler(&_p[i]);
@@ -189,10 +191,11 @@ LibAliasAttachHandlers(struct proto_handler *_p)
int
LibAliasDetachHandlers(struct proto_handler *_p)
{
- int i, error = -1;
+ int i, error;
LIBALIAS_WLOCK();
- for (i=0; 1; i++) {
+ error = -1;
+ for (i = 0; 1; i++) {
if (*((int *)&_p[i]) == EOH)
break;
error = _detach_handler(&_p[i]);
@@ -206,26 +209,27 @@ LibAliasDetachHandlers(struct proto_handler *_p)
int
detach_handler(struct proto_handler *_p)
{
- int error = -1;
+ int error;
LIBALIAS_WLOCK();
+ error = -1;
error = _detach_handler(_p);
LIBALIAS_WUNLOCK();
return (error);
}
int
-find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip,
- struct alias_data *ad)
+find_handler(int8_t dir, int8_t proto, struct libalias *la, __unused struct ip *pip,
+ struct alias_data *ad)
{
struct proto_handler *p;
- int error = ENOENT;
+ int error;
LIBALIAS_RLOCK();
-
+ error = ENOENT;
LIST_FOREACH(p, &handler_chain, entries) {
if ((p->dir & dir) && (p->proto & proto))
- if (p->fingerprint(la, pip, ad) == 0) {
+ if (p->fingerprint(la, ad) == 0) {
error = p->protohandler(la, pip, ad);
break;
}
@@ -259,9 +263,11 @@ attach_dll(struct dll *p)
void *
detach_dll(char *p)
{
- struct dll *b = NULL, *b_tmp;
- void *error = NULL;
+ struct dll *b, *b_tmp;
+ void *error;
+ b = NULL;
+ error = NULL;
SLIST_FOREACH_SAFE(b, &dll_chain, next, b_tmp)
if (!strncmp(b->name, p, DLL_LEN)) {
SLIST_REMOVE(&dll_chain, b, dll, next);
OpenPOWER on IntegriCloud