X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..d190cdc3f5544636abb56dc1874be391d3e1b148:/bsd/netinet6/ah_output.c?ds=sidebyside diff --git a/bsd/netinet6/ah_output.c b/bsd/netinet6/ah_output.c index 918196d8e..1e723fa3f 100644 --- a/bsd/netinet6/ah_output.c +++ b/bsd/netinet6/ah_output.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008 Apple Inc. All rights reserved. + * Copyright (c) 2008-2011 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -117,8 +117,7 @@ extern lck_mtx_t *sadb_mutex; * virtual interface, and control MTU/MSS by the interface MTU. */ size_t -ah_hdrsiz(isr) - struct ipsecrequest *isr; +ah_hdrsiz(struct ipsecrequest *isr) { /* sanity check */ @@ -184,9 +183,7 @@ estimate: * the function does not modify m. */ int -ah4_output(m, sav) - struct mbuf *m; - struct secasvar *sav; +ah4_output(struct mbuf *m, struct secasvar *sav) { const struct ah_algorithm *algo; u_int32_t spi; @@ -277,7 +274,7 @@ ah4_output(m, sav) if (sav->flags & SADB_X_EXT_OLD) { struct ah *ahdr; - ahdr = (struct ah *)ahdrpos; + ahdr = (struct ah *)(void *)ahdrpos; ahsumpos = (u_char *)(ahdr + 1); ahdr->ah_len = plen >> 2; ahdr->ah_nxt = ip->ip_p; @@ -287,7 +284,7 @@ ah4_output(m, sav) } else { struct newah *ahdr; - ahdr = (struct newah *)ahdrpos; + ahdr = (struct newah *)(void *)ahdrpos; ahsumpos = (u_char *)(ahdr + 1); ahdr->ah_len = (plen >> 2) + 1; /* plus one for seq# */ ahdr->ah_nxt = ip->ip_p; @@ -371,8 +368,7 @@ ah4_output(m, sav) /* Calculate AH length */ int -ah_hdrlen(sav) - struct secasvar *sav; +ah_hdrlen(struct secasvar *sav) { const struct ah_algorithm *algo; int plen, ahlen; @@ -398,11 +394,8 @@ ah_hdrlen(sav) * Fill in the Authentication Header and calculate checksum. */ int -ah6_output(m, nexthdrp, md, sav) - struct mbuf *m; - u_char *nexthdrp; - struct mbuf *md; - struct secasvar *sav; +ah6_output(struct mbuf *m, u_char *nexthdrp, struct mbuf *md, + struct secasvar *sav) { struct mbuf *mprev; struct mbuf *mah; @@ -553,8 +546,7 @@ ah6_output(m, nexthdrp, md, sav) * The mbuf must be pulled up toward, at least, ip option part. */ static struct in_addr * -ah4_finaldst(m) - struct mbuf *m; +ah4_finaldst(struct mbuf *m) { struct ip *ip; int optlen; @@ -617,7 +609,7 @@ ah4_finaldst(m) return NULL; } i += q[i + IPOPT_OLEN] - sizeof(struct in_addr); - return (struct in_addr *)(q + i); + return (struct in_addr *)(void *)(q + i); default: if (q[i + IPOPT_OLEN] < 2 || optlen - i < q[i + IPOPT_OLEN]) {