aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2009-10-21 14:05:51 +0000
committerRobert Watson <rwatson@FreeBSD.org>2009-10-21 14:05:51 +0000
commitcbdd92bda4d6f630c198c9df4fab61aed260a36a (patch)
tree5eecd3ff604ae71cf80bd3829d51ad22ef916465
parent5e2ef9933c143854046088b377f5e4009887e20f (diff)
downloadsrc-cbdd92bda4d6f630c198c9df4fab61aed260a36a.tar.gz
src-cbdd92bda4d6f630c198c9df4fab61aed260a36a.zip
Merge r198233 from head to stable/8:
Clean up comments, white space, and style in pfil.c (VNET changes not MFC'd) Approved by: re (kib)
Notes
Notes: svn path=/stable/8/; revision=198326
-rw-r--r--sys/net/pfil.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/sys/net/pfil.c b/sys/net/pfil.c
index 1e2629263ec1..0ae889a6f278 100644
--- a/sys/net/pfil.c
+++ b/sys/net/pfil.c
@@ -85,14 +85,13 @@ pfil_run_hooks(struct pfil_head *ph, struct mbuf **mp, struct ifnet *ifp,
}
}
PFIL_RUNLOCK(ph, &rmpt);
-
*mp = m;
return (rv);
}
/*
- * pfil_head_register() registers a pfil_head with the packet filter
- * hook mechanism.
+ * pfil_head_register() registers a pfil_head with the packet filter hook
+ * mechanism.
*/
int
pfil_head_register(struct pfil_head *ph)
@@ -104,7 +103,7 @@ pfil_head_register(struct pfil_head *ph)
if (ph->ph_type == lph->ph_type &&
ph->ph_un.phu_val == lph->ph_un.phu_val) {
PFIL_LIST_UNLOCK();
- return EEXIST;
+ return (EEXIST);
}
}
PFIL_LOCK_INIT(ph);
@@ -150,7 +149,6 @@ pfil_head_get(int type, u_long val)
if (ph->ph_type == type && ph->ph_un.phu_val == val)
break;
PFIL_LIST_UNLOCK();
-
return (ph);
}
@@ -207,7 +205,7 @@ pfil_add_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int,
ph->ph_nhooks++;
}
PFIL_WUNLOCK(ph);
- return 0;
+ return (0);
locked_error:
PFIL_WUNLOCK(ph);
error:
@@ -215,12 +213,12 @@ error:
free(pfh1, M_IFADDR);
if (pfh2 != NULL)
free(pfh2, M_IFADDR);
- return err;
+ return (err);
}
/*
- * pfil_remove_hook removes a specific function from the packet filter
- * hook list.
+ * pfil_remove_hook removes a specific function from the packet filter hook
+ * list.
*/
int
pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int,
@@ -229,7 +227,6 @@ pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int,
int err = 0;
PFIL_WLOCK(ph);
-
if (flags & PFIL_IN) {
err = pfil_list_remove(&ph->ph_in, func, arg);
if (err == 0)
@@ -241,8 +238,7 @@ pfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *, int,
ph->ph_nhooks--;
}
PFIL_WUNLOCK(ph);
-
- return err;
+ return (err);
}
static int
@@ -256,17 +252,17 @@ pfil_list_add(pfil_list_t *list, struct packet_filter_hook *pfh1, int flags)
TAILQ_FOREACH(pfh, list, pfil_link)
if (pfh->pfil_func == pfh1->pfil_func &&
pfh->pfil_arg == pfh1->pfil_arg)
- return EEXIST;
+ return (EEXIST);
+
/*
- * insert the input list in reverse order of the output list
- * so that the same path is followed in or out of the kernel.
+ * Insert the input list in reverse order of the output list so that
+ * the same path is followed in or out of the kernel.
*/
if (flags & PFIL_IN)
TAILQ_INSERT_HEAD(list, pfh1, pfil_link);
else
TAILQ_INSERT_TAIL(list, pfh1, pfil_link);
-
- return 0;
+ return (0);
}
/*
@@ -284,7 +280,7 @@ pfil_list_remove(pfil_list_t *list,
if (pfh->pfil_func == func && pfh->pfil_arg == arg) {
TAILQ_REMOVE(list, pfh, pfil_link);
free(pfh, M_IFADDR);
- return 0;
+ return (0);
}
- return ENOENT;
+ return (ENOENT);
}