diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2015-09-16 08:05:26 -0500 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2015-10-20 12:09:04 -0500 |
commit | 3175ce5dd251d2c811f3d0879cd3cfd577ff506d (patch) | |
tree | 82350210112eca93c7090b4548860b21864a84a2 | |
parent | 746fef67f99420a94493e5b5e2aba2d4d76f006d (diff) | |
download | FreeBSD-src-3175ce5dd251d2c811f3d0879cd3cfd577ff506d.zip FreeBSD-src-3175ce5dd251d2c811f3d0879cd3cfd577ff506d.tar.gz |
MFC r285770:
IPSEC, remove variable argument function its already due.
Differential Revision: https://reviews.freebsd.org/D3080
Reviewed by: gnn, ae
Approved by: gnn(mentor)
TAG: IPSEC-HEAD
Issue: #4841
-rw-r--r-- | sys/netinet/udp_usrreq.c | 3 | ||||
-rw-r--r-- | sys/netipsec/ipsec.h | 2 | ||||
-rw-r--r-- | sys/netipsec/ipsec_input.c | 29 |
3 files changed, 10 insertions, 24 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 4078163..46bebf6 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1560,7 +1560,8 @@ udp4_espdecap(struct inpcb *inp, struct mbuf *m, int off) if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) m->m_pkthdr.csum_flags &= ~(CSUM_DATA_VALID|CSUM_PSEUDO_HDR); - (void) ipsec4_common_input(m, iphlen, ip->ip_p); + (void) ipsec_common_input(m, iphlen, offsetof(struct ip, ip_p), + AF_INET, ip->ip_p); return (NULL); /* NB: consumed, bypass processing. */ } #endif /* defined(IPSEC) && defined(IPSEC_NAT_T) */ diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h index 8ec6d54..c05be36 100644 --- a/sys/netipsec/ipsec.h +++ b/sys/netipsec/ipsec.h @@ -341,7 +341,7 @@ extern void ah4_ctlinput(int cmd, struct sockaddr *sa, void *); extern void esp4_input(struct mbuf *m, int off); extern void esp4_ctlinput(int cmd, struct sockaddr *sa, void *); extern void ipcomp4_input(struct mbuf *m, int off); -extern int ipsec4_common_input(struct mbuf *m, ...); +extern int ipsec_common_input(struct mbuf *m, int, int, int, int); extern int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff); extern int ipsec4_process_packet(struct mbuf *, struct ipsecrequest *); diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c index fa37eb1..8fb74ff 100644 --- a/sys/netipsec/ipsec_input.c +++ b/sys/netipsec/ipsec_input.c @@ -117,7 +117,7 @@ static void ipsec4_common_ctlinput(int, struct sockaddr *, void *, int); * and call the appropriate transform. The transform callback * takes care of further processing (like ingress filtering). */ -static int +int ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) { char buf[INET6_ADDRSTRLEN]; @@ -242,28 +242,11 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) } #ifdef INET -/* - * Common input handler for IPv4 AH, ESP, and IPCOMP. - */ -int -ipsec4_common_input(struct mbuf *m, ...) -{ - va_list ap; - int off, nxt; - - va_start(ap, m); - off = va_arg(ap, int); - nxt = va_arg(ap, int); - va_end(ap); - - return ipsec_common_input(m, off, offsetof(struct ip, ip_p), - AF_INET, nxt); -} - void ah4_input(struct mbuf *m, int off) { - ipsec4_common_input(m, off, IPPROTO_AH); + ipsec_common_input(m, off, offsetof(struct ip, ip_p), + AF_INET, IPPROTO_AH); } void ah4_ctlinput(int cmd, struct sockaddr *sa, void *v) @@ -276,7 +259,8 @@ ah4_ctlinput(int cmd, struct sockaddr *sa, void *v) void esp4_input(struct mbuf *m, int off) { - ipsec4_common_input(m, off, IPPROTO_ESP); + ipsec_common_input(m, off, offsetof(struct ip, ip_p), + AF_INET, IPPROTO_ESP); } void esp4_ctlinput(int cmd, struct sockaddr *sa, void *v) @@ -289,7 +273,8 @@ esp4_ctlinput(int cmd, struct sockaddr *sa, void *v) void ipcomp4_input(struct mbuf *m, int off) { - ipsec4_common_input(m, off, IPPROTO_IPCOMP); + ipsec_common_input(m, off, offsetof(struct ip, ip_p), + AF_INET, IPPROTO_IPCOMP); } /* |