From: mikeb Date: Mon, 15 Jun 2015 12:37:37 +0000 (+0000) Subject: Use proper argument type for crp_callback functions; no functional change. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6753a1fb254147a43f93b81cab5a050c8f2a2894;p=openbsd Use proper argument type for crp_callback functions; no functional change. --- diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index c449cc221c0..12721b8fff3 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.116 2015/04/17 11:04:01 mikeb Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.117 2015/06/15 12:37:37 mikeb Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -76,8 +76,8 @@ #define DPRINTF(x) #endif -int ah_output_cb(void *); -int ah_input_cb(void *); +int ah_output_cb(struct cryptop *); +int ah_input_cb(struct cryptop *); int ah_massage_headers(struct mbuf **, int, int, int, int); struct ahstat ahstat; @@ -678,10 +678,10 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) /* Crypto operation descriptor. */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ crp->crp_flags = CRYPTO_F_IMBUF; - crp->crp_buf = (caddr_t) m; - crp->crp_callback = (int (*) (struct cryptop *)) ah_input_cb; + crp->crp_buf = (caddr_t)m; + crp->crp_callback = ah_input_cb; crp->crp_sid = tdb->tdb_cryptoid; - crp->crp_opaque = (caddr_t) tc; + crp->crp_opaque = (caddr_t)tc; /* These are passed as-is to the callback. */ tc->tc_skip = skip; @@ -698,14 +698,13 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) * AH input callback, called directly by the crypto driver. */ int -ah_input_cb(void *op) +ah_input_cb(struct cryptop *crp) { int s, roff, rplen, error, skip, protoff; unsigned char calc[AH_ALEN_MAX]; struct mbuf *m1, *m0, *m; struct auth_hash *ahx; struct tdb_crypto *tc; - struct cryptop *crp; struct tdb *tdb; u_int32_t btsx, esn; caddr_t ptr; @@ -713,8 +712,6 @@ ah_input_cb(void *op) char buf[INET6_ADDRSTRLEN]; #endif - crp = (struct cryptop *) op; - tc = (struct tdb_crypto *) crp->crp_opaque; skip = tc->tc_skip; protoff = tc->tc_protoff; @@ -1189,10 +1186,10 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, /* Crypto operation descriptor. */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ crp->crp_flags = CRYPTO_F_IMBUF; - crp->crp_buf = (caddr_t) m; - crp->crp_callback = (int (*) (struct cryptop *)) ah_output_cb; + crp->crp_buf = (caddr_t)m; + crp->crp_callback = ah_output_cb; crp->crp_sid = tdb->tdb_cryptoid; - crp->crp_opaque = (caddr_t) tc; + crp->crp_opaque = (caddr_t)tc; /* These are passed as-is to the callback. */ tc->tc_skip = skip; @@ -1209,17 +1206,15 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, * AH output callback, called directly from the crypto handler. */ int -ah_output_cb(void *op) +ah_output_cb(struct cryptop *crp) { int skip, error; struct tdb_crypto *tc; - struct cryptop *crp; struct tdb *tdb; struct mbuf *m; caddr_t ptr; int err, s; - crp = (struct cryptop *) op; tc = (struct tdb_crypto *) crp->crp_opaque; skip = tc->tc_skip; ptr = (caddr_t) (tc + 1); diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 11e2de714db..743c2da20eb 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.131 2015/04/17 11:04:01 mikeb Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.132 2015/06/15 12:37:37 mikeb Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -69,8 +69,8 @@ #include "bpfilter.h" -int esp_output_cb(void *); -int esp_input_cb(void *); +int esp_output_cb(struct cryptop *); +int esp_input_cb(struct cryptop *); #ifdef ENCDEBUG #define DPRINTF(x) if (encdebug) printf x @@ -483,10 +483,10 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length */ crp->crp_flags = CRYPTO_F_IMBUF; - crp->crp_buf = (caddr_t) m; - crp->crp_callback = (int (*) (struct cryptop *)) esp_input_cb; + crp->crp_buf = (caddr_t)m; + crp->crp_callback = esp_input_cb; crp->crp_sid = tdb->tdb_cryptoid; - crp->crp_opaque = (caddr_t) tc; + crp->crp_opaque = (caddr_t)tc; /* These are passed as-is to the callback */ tc->tc_skip = skip; @@ -518,14 +518,13 @@ esp_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) * ESP input callback, called directly by the crypto driver. */ int -esp_input_cb(void *op) +esp_input_cb(struct cryptop *crp) { u_int8_t lastthree[3], aalg[AH_HMAC_MAX_HASHLEN]; int s, hlen, roff, skip, protoff, error; struct mbuf *m1, *mo, *m; struct auth_hash *esph; struct tdb_crypto *tc; - struct cryptop *crp; struct tdb *tdb; u_int32_t btsx, esn; caddr_t ptr; @@ -533,8 +532,6 @@ esp_input_cb(void *op) char buf[INET6_ADDRSTRLEN]; #endif - crp = (struct cryptop *) op; - tc = (struct tdb_crypto *) crp->crp_opaque; skip = tc->tc_skip; protoff = tc->tc_protoff; @@ -1006,9 +1003,9 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, /* Crypto operation descriptor. */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */ crp->crp_flags = CRYPTO_F_IMBUF; - crp->crp_buf = (caddr_t) m; - crp->crp_callback = (int (*) (struct cryptop *)) esp_output_cb; - crp->crp_opaque = (caddr_t) tc; + crp->crp_buf = (caddr_t)m; + crp->crp_callback = esp_output_cb; + crp->crp_opaque = (caddr_t)tc; crp->crp_sid = tdb->tdb_cryptoid; if (esph) { @@ -1042,9 +1039,8 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, * ESP output callback, called directly by the crypto driver. */ int -esp_output_cb(void *op) +esp_output_cb(struct cryptop *crp) { - struct cryptop *crp = (struct cryptop *) op; struct tdb_crypto *tc; struct tdb *tdb; struct mbuf *m;