diff options
author | julian <julian@FreeBSD.org> | 2001-09-07 07:19:12 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2001-09-07 07:19:12 +0000 |
commit | 3cc9960fd1b52e850d61e0fdab1cf2cb1a9f3735 (patch) | |
tree | d013f55450d9cf7688fbd35f24d13797e19ae112 /sys/netinet6 | |
parent | f307b418db18dcf0791a53a9429ff162625fbd9c (diff) | |
download | FreeBSD-src-3cc9960fd1b52e850d61e0fdab1cf2cb1a9f3735.zip FreeBSD-src-3cc9960fd1b52e850d61e0fdab1cf2cb1a9f3735.tar.gz |
Patches from KAME to remove usage of Varargs in existing
IPV4 code. For now they will still have some in the developing stuff (IPv6)
Submitted by: Keiichi SHIMA / <keiichi@iij.ad.jp>
Obtained from: KAME
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ah.h | 2 | ||||
-rw-r--r-- | sys/netinet6/ah_input.c | 18 | ||||
-rw-r--r-- | sys/netinet6/esp.h | 2 | ||||
-rw-r--r-- | sys/netinet6/esp_input.c | 17 | ||||
-rw-r--r-- | sys/netinet6/ipcomp.h | 2 | ||||
-rw-r--r-- | sys/netinet6/ipcomp_input.c | 17 |
6 files changed, 16 insertions, 42 deletions
diff --git a/sys/netinet6/ah.h b/sys/netinet6/ah.h index 0846466..e804653 100644 --- a/sys/netinet6/ah.h +++ b/sys/netinet6/ah.h @@ -85,7 +85,7 @@ extern const struct ah_algorithm *ah_algorithm_lookup __P((int)); extern int ah_hdrlen __P((struct secasvar *)); extern size_t ah_hdrsiz __P((struct ipsecrequest *)); -extern void ah4_input __P((struct mbuf *, ...)); +extern void ah4_input __P((struct mbuf *, int)); extern int ah4_output __P((struct mbuf *, struct ipsecrequest *)); extern int ah4_calccksum __P((struct mbuf *, caddr_t, size_t, const struct ah_algorithm *, struct secasvar *)); diff --git a/sys/netinet6/ah_input.c b/sys/netinet6/ah_input.c index 4ee2a99..63605d0 100644 --- a/sys/netinet6/ah_input.c +++ b/sys/netinet6/ah_input.c @@ -97,13 +97,9 @@ extern struct protosw inetsw[]; void -#if __STDC__ -ah4_input(struct mbuf *m, ...) -#else -ah4_input(m, va_alist) +ah4_input(m, off) struct mbuf *m; - va_dcl -#endif + int off; { struct ip *ip; struct ah *ah; @@ -115,15 +111,9 @@ ah4_input(m, va_alist) struct secasvar *sav = NULL; u_int16_t nxt; size_t hlen; - int off, proto; - va_list ap; + int proto; size_t stripsiz = 0; - va_start(ap, m); - off = va_arg(ap, int); - proto = mtod(m, struct ip *)->ip_p; - va_end(ap); - #ifndef PULLDOWN_TEST if (m->m_len < off + sizeof(struct newah)) { m = m_pullup(m, off + sizeof(struct newah)); @@ -136,9 +126,11 @@ ah4_input(m, va_alist) } ip = mtod(m, struct ip *); + proto = ip->ip_p; ah = (struct ah *)(((caddr_t)ip) + off); #else ip = mtod(m, struct ip *); + proto = ip->ip_p; IP6_EXTHDR_GET(ah, struct ah *, m, off, sizeof(struct newah)); if (ah == NULL) { ipseclog((LOG_DEBUG, "IPv4 AH input: can't pullup;" diff --git a/sys/netinet6/esp.h b/sys/netinet6/esp.h index 6f794a8..320e994 100644 --- a/sys/netinet6/esp.h +++ b/sys/netinet6/esp.h @@ -98,7 +98,7 @@ extern int esp_max_ivlen __P((void)); /* crypt routines */ extern int esp4_output __P((struct mbuf *, struct ipsecrequest *)); -extern void esp4_input __P((struct mbuf *, ...)); +extern void esp4_input __P((struct mbuf *, int)); extern size_t esp_hdrsiz __P((struct ipsecrequest *)); extern int esp_schedule __P((const struct esp_algorithm *, struct secasvar *)); diff --git a/sys/netinet6/esp_input.c b/sys/netinet6/esp_input.c index af12ec0..c235d99 100644 --- a/sys/netinet6/esp_input.c +++ b/sys/netinet6/esp_input.c @@ -100,13 +100,9 @@ extern struct protosw inetsw[]; void -#if __STDC__ -esp4_input(struct mbuf *m, ...) -#else -esp4_input(m, va_alist) +esp4_input(m, off) struct mbuf *m; - va_dcl -#endif + int off; { struct ip *ip; struct esp *esp; @@ -119,13 +115,7 @@ esp4_input(m, va_alist) int ivlen; size_t hlen; size_t esplen; - va_list ap; - int off, proto; - - va_start(ap, m); - off = va_arg(ap, int); - proto = mtod(m, struct ip *)->ip_p; - va_end(ap); + int proto; /* sanity check for alignment. */ if (off % 4 != 0 || m->m_pkthdr.len % 4 != 0) { @@ -146,6 +136,7 @@ esp4_input(m, va_alist) } ip = mtod(m, struct ip *); + proto = ip->ip_p; esp = (struct esp *)(((u_int8_t *)ip) + off); #ifdef _IP_VHL hlen = IP_VHL_HL(ip->ip_vhl) << 2; diff --git a/sys/netinet6/ipcomp.h b/sys/netinet6/ipcomp.h index 08d62da..4c69d58 100644 --- a/sys/netinet6/ipcomp.h +++ b/sys/netinet6/ipcomp.h @@ -64,7 +64,7 @@ struct ipcomp_algorithm { struct ipsecrequest; extern const struct ipcomp_algorithm *ipcomp_algorithm_lookup __P((int)); -extern void ipcomp4_input __P((struct mbuf *, ...)); +extern void ipcomp4_input __P((struct mbuf *, int)); extern int ipcomp4_output __P((struct mbuf *, struct ipsecrequest *)); #endif /*KERNEL*/ diff --git a/sys/netinet6/ipcomp_input.c b/sys/netinet6/ipcomp_input.c index f3143d2..ece1603 100644 --- a/sys/netinet6/ipcomp_input.c +++ b/sys/netinet6/ipcomp_input.c @@ -86,13 +86,9 @@ extern struct protosw inetsw[]; void -#if __STDC__ -ipcomp4_input(struct mbuf *m, ...) -#else -ipcomp4_input(m, va_alist) +ipcomp4_input(m, off) struct mbuf *m; - va_dcl -#endif + int off; { struct mbuf *md; struct ip *ip; @@ -104,13 +100,7 @@ ipcomp4_input(m, va_alist) int error; size_t newlen, olen; struct secasvar *sav = NULL; - int off, proto; - va_list ap; - - va_start(ap, m); - off = va_arg(ap, int); - proto = mtod(m, struct ip *)->ip_p; - va_end(ap); + int proto; if (m->m_pkthdr.len < off + sizeof(struct ipcomp)) { ipseclog((LOG_DEBUG, "IPv4 IPComp input: assumption failed " @@ -129,6 +119,7 @@ ipcomp4_input(m, va_alist) } ipcomp = mtod(md, struct ipcomp *); ip = mtod(m, struct ip *); + proto = ip->ip_p; nxt = ipcomp->comp_nxt; #ifdef _IP_VHL hlen = IP_VHL_HL(ip->ip_vhl) << 2; |