Author: eri
Date: Tue Jul 21 21:46:24 2015
New Revision: 285770
URL: https://svnweb.freebsd.org/changeset/base/285770

Log:
  IPSEC, remove variable argument function its already due.
  
  Differential Revision:                https://reviews.freebsd.org/D3080
  Reviewed by:  gnn, ae
  Approved by:  gnn(mentor)

Modified:
  head/sys/netinet/udp_usrreq.c
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/ipsec_input.c

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c       Tue Jul 21 21:12:28 2015        
(r285769)
+++ head/sys/netinet/udp_usrreq.c       Tue Jul 21 21:46:24 2015        
(r285770)
@@ -1666,7 +1666,8 @@ udp4_espdecap(struct inpcb *inp, struct 
        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) */

Modified: head/sys/netipsec/ipsec.h
==============================================================================
--- head/sys/netipsec/ipsec.h   Tue Jul 21 21:12:28 2015        (r285769)
+++ head/sys/netipsec/ipsec.h   Tue Jul 21 21:46:24 2015        (r285770)
@@ -337,7 +337,7 @@ extern void ah4_ctlinput(int cmd, struct
 extern int esp4_input(struct mbuf **mp, int *offp, int proto);
 extern void esp4_ctlinput(int cmd, struct sockaddr *sa, void *);
 extern int ipcomp4_input(struct mbuf **mp, int *offp, int proto);
-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 *);

Modified: head/sys/netipsec/ipsec_input.c
==============================================================================
--- head/sys/netipsec/ipsec_input.c     Tue Jul 21 21:12:28 2015        
(r285769)
+++ head/sys/netipsec/ipsec_input.c     Tue Jul 21 21:46:24 2015        
(r285770)
@@ -118,7 +118,7 @@ static void ipsec4_common_ctlinput(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];
@@ -243,24 +243,6 @@ ipsec_common_input(struct mbuf *m, int s
 }
 
 #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);
-}
-
 int
 ah4_input(struct mbuf **mp, int *offp, int proto)
 {
@@ -271,7 +253,8 @@ ah4_input(struct mbuf **mp, int *offp, i
        off = *offp;
        *mp = NULL;
 
-       ipsec4_common_input(m, off, IPPROTO_AH);
+       ipsec_common_input(m, off, offsetof(struct ip, ip_p),
+                               AF_INET, IPPROTO_AH);
        return (IPPROTO_DONE);
 }
 void
@@ -292,7 +275,8 @@ esp4_input(struct mbuf **mp, int *offp, 
        off = *offp;
        mp = NULL;
 
-       ipsec4_common_input(m, off, IPPROTO_ESP);
+       ipsec_common_input(m, off, offsetof(struct ip, ip_p),
+                               AF_INET, IPPROTO_ESP);
        return (IPPROTO_DONE);
 }
 
@@ -314,7 +298,8 @@ ipcomp4_input(struct mbuf **mp, int *off
        off = *offp;
        mp = NULL;
 
-       ipsec4_common_input(m, off, IPPROTO_IPCOMP);
+       ipsec_common_input(m, off, offsetof(struct ip, ip_p),
+                               AF_INET, IPPROTO_IPCOMP);
        return (IPPROTO_DONE);
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to