summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-10-21 09:55:58 +0300
committerToomas Soome <tsoome@me.com>2019-09-03 22:46:18 +0300
commitd9c462b2dd4afc98da9074ea6ace57ecd8035001 (patch)
tree78db8537096b47febea5ada4f01f575c4aec1513 /usr
parentfd121eb4d1d06ebe9153101f4c80d19c65452dd2 (diff)
downloadillumos-joyent-d9c462b2dd4afc98da9074ea6ace57ecd8035001.tar.gz
11598 pfmod: cast between incompatible function types
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/uts/common/io/pfmod.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/usr/src/uts/common/io/pfmod.c b/usr/src/uts/common/io/pfmod.c
index c9c452e6ef..e6c241eafa 100644
--- a/usr/src/uts/common/io/pfmod.c
+++ b/usr/src/uts/common/io/pfmod.c
@@ -35,7 +35,7 @@
*
* Based on SunOS 4.x version. This version has minor changes:
* - general SVR4 porting stuff
- * - change name and prefixes from "nit" buffer to streams buffer
+ * - change name and prefixes from "nit" buffer to streams buffer
* - multithreading assumes configured as D_MTQPAIR
*/
@@ -87,12 +87,8 @@ static int pfopen(queue_t *, dev_t *, int, int, cred_t *);
static int pfclose(queue_t *, int, cred_t *);
static void pfioctl(queue_t *wq, mblk_t *mp);
static int FilterPacket(struct packdesc *, struct epacketfilt *);
-/*
- * To save instructions, since STREAMS ignores the return value
- * from these functions, they are defined as void here. Kind of icky, but...
- */
-static void pfwput(queue_t *, mblk_t *);
-static void pfrput(queue_t *, mblk_t *);
+static int pfwput(queue_t *, mblk_t *);
+static int pfrput(queue_t *, mblk_t *);
static struct module_info pf_minfo = {
22, /* mi_idnum */
@@ -104,7 +100,7 @@ static struct module_info pf_minfo = {
};
static struct qinit pf_rinit = {
- (int (*)())pfrput, /* qi_putp */
+ pfrput, /* qi_putp */
NULL,
pfopen, /* qi_qopen */
pfclose, /* qi_qclose */
@@ -114,7 +110,7 @@ static struct qinit pf_rinit = {
};
static struct qinit pf_winit = {
- (int (*)())pfwput, /* qi_putp */
+ pfwput, /* qi_putp */
NULL, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
@@ -207,7 +203,7 @@ pfclose(queue_t *rq, int flags __unused, cred_t *credp __unused)
* Write-side put procedure. Its main task is to detect ioctls.
* Other message types are passed on through.
*/
-static void
+static int
pfwput(queue_t *wq, mblk_t *mp)
{
switch (mp->b_datap->db_type) {
@@ -219,6 +215,7 @@ pfwput(queue_t *wq, mblk_t *mp)
putnext(wq, mp);
break;
}
+ return (0);
}
/*
@@ -230,7 +227,7 @@ pfwput(queue_t *wq, mblk_t *mp)
* which are skipped over before executing the packet filter
* on any remaining M_DATA mblks.
*/
-static void
+static int
pfrput(queue_t *rq, mblk_t *mp)
{
struct epacketfilt *pfp = (struct epacketfilt *)rq->q_ptr;
@@ -308,7 +305,7 @@ pfrput(queue_t *rq, mblk_t *mp)
if (mbp) {
pd.pd_body = (ushort_t *)mbp->b_rptr;
pd.pd_bodylen = (mbp->b_wptr - mbp->b_rptr) /
- sizeof (ushort_t);
+ sizeof (ushort_t);
} else {
pd.pd_body = NULL;
pd.pd_bodylen = 0;
@@ -328,7 +325,7 @@ pfrput(queue_t *rq, mblk_t *mp)
putnext(rq, mp);
break;
}
-
+ return (0);
}
/*