Author: tuexen
Date: Wed Jul 18 09:16:59 2012
New Revision: 238578
URL: http://svn.freebsd.org/changeset/base/238578

Log:
  MFC r238475:
  #ifdef INET and INET6 consistently. This also fixes a bug, where
  it was done wrong.
  
  Approved by: re@

Modified:
  stable/9/sys/netinet/sctp_output.c
  stable/9/sys/netinet/sctp_pcb.c
  stable/9/sys/netinet/sctp_usrreq.c
  stable/9/sys/netinet/sctputil.c
  stable/9/sys/netinet6/sctp6_usrreq.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/sctp_output.c
==============================================================================
--- stable/9/sys/netinet/sctp_output.c  Wed Jul 18 09:16:47 2012        
(r238577)
+++ stable/9/sys/netinet/sctp_output.c  Wed Jul 18 09:16:59 2012        
(r238578)
@@ -8518,12 +8518,14 @@ again_one_more_time:
                }
                /* now lets add any data within the MTU constraints */
                switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) {
+#ifdef INET
                case AF_INET:
                        if (net->mtu > (sizeof(struct ip) + sizeof(struct 
sctphdr)))
                                omtu = net->mtu - (sizeof(struct ip) + 
sizeof(struct sctphdr));
                        else
                                omtu = 0;
                        break;
+#endif
 #ifdef INET6
                case AF_INET6:
                        if (net->mtu > (sizeof(struct ip6_hdr) + sizeof(struct 
sctphdr)))
@@ -12272,7 +12274,7 @@ sctp_lower_sosend(struct socket *so,
                union sctp_sockstore *raddr = (union sctp_sockstore *)addr;
 
                switch (raddr->sa.sa_family) {
-#if defined(INET)
+#ifdef INET
                case AF_INET:
                        if (raddr->sin.sin_len != sizeof(struct sockaddr_in)) {
                                SCTP_LTRACE_ERR_RET(inp, stcb, net, 
SCTP_FROM_SCTP_OUTPUT, EINVAL);
@@ -12282,7 +12284,7 @@ sctp_lower_sosend(struct socket *so,
                        port = raddr->sin.sin_port;
                        break;
 #endif
-#if defined(INET6)
+#ifdef INET6
                case AF_INET6:
                        if (raddr->sin6.sin6_len != sizeof(struct 
sockaddr_in6)) {
                                SCTP_LTRACE_ERR_RET(inp, stcb, net, 
SCTP_FROM_SCTP_OUTPUT, EINVAL);

Modified: stable/9/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/9/sys/netinet/sctp_pcb.c     Wed Jul 18 09:16:47 2012        
(r238577)
+++ stable/9/sys/netinet/sctp_pcb.c     Wed Jul 18 09:16:59 2012        
(r238578)
@@ -3125,6 +3125,7 @@ continue_anyway:
 
                memset(&store_sa, 0, sizeof(store_sa));
                switch (addr->sa_family) {
+#ifdef INET
                case AF_INET:
                        {
                                struct sockaddr_in *sin;
@@ -3134,6 +3135,8 @@ continue_anyway:
                                sin->sin_port = 0;
                                break;
                        }
+#endif
+#ifdef INET6
                case AF_INET6:
                        {
                                struct sockaddr_in6 *sin6;
@@ -3143,6 +3146,7 @@ continue_anyway:
                                sin6->sin6_port = 0;
                                break;
                        }
+#endif
                default:
                        break;
                }
@@ -5304,12 +5308,16 @@ sctp_destination_is_reachable(struct sct
        }
        /* NOTE: all "scope" checks are done when local addresses are added */
        switch (destaddr->sa_family) {
+#ifdef INET6
        case AF_INET6:
                answer = inp->ip_inp.inp.inp_vflag & INP_IPV6;
                break;
+#endif
+#ifdef INET
        case AF_INET:
                answer = inp->ip_inp.inp.inp_vflag & INP_IPV4;
                break;
+#endif
        default:
                /* invalid family, so it's unreachable */
                answer = 0;
@@ -5400,7 +5408,7 @@ sctp_add_local_addr_ep(struct sctp_inpcb
                        inp->ip_inp.inp.inp_vflag |= INP_IPV6;
                        break;
 #endif
-#ifdef INET6
+#ifdef INET
                case AF_INET:
                        inp->ip_inp.inp.inp_vflag |= INP_IPV4;
                        break;

Modified: stable/9/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/9/sys/netinet/sctp_usrreq.c  Wed Jul 18 09:16:47 2012        
(r238577)
+++ stable/9/sys/netinet/sctp_usrreq.c  Wed Jul 18 09:16:59 2012        
(r238578)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/sctp_pcb.h>
 #include <netinet/sctp_header.h>
 #include <netinet/sctp_var.h>
-#if defined(INET6)
+#ifdef INET6
 #endif
 #include <netinet/sctp_sysctl.h>
 #include <netinet/sctp_output.h>

Modified: stable/9/sys/netinet/sctputil.c
==============================================================================
--- stable/9/sys/netinet/sctputil.c     Wed Jul 18 09:16:47 2012        
(r238577)
+++ stable/9/sys/netinet/sctputil.c     Wed Jul 18 09:16:59 2012        
(r238578)
@@ -5691,7 +5691,7 @@ found_one:
                        memcpy(from, &sin6, sizeof(struct sockaddr_in6));
                }
 #endif
-#if defined(INET6)
+#ifdef INET6
                {
                        struct sockaddr_in6 lsa6, *from6;
 
@@ -6588,7 +6588,7 @@ sctp_bindx_delete_address(struct sctp_in
                return;
        }
        addr_touse = sa;
-#if defined(INET6)
+#ifdef INET6
        if (sa->sa_family == AF_INET6) {
                struct sockaddr_in6 *sin6;
 

Modified: stable/9/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- stable/9/sys/netinet6/sctp6_usrreq.c        Wed Jul 18 09:16:47 2012        
(r238577)
+++ stable/9/sys/netinet6/sctp6_usrreq.c        Wed Jul 18 09:16:59 2012        
(r238578)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/sctp_pcb.h>
 #include <netinet/sctp_header.h>
 #include <netinet/sctp_var.h>
-#if defined(INET6)
+#ifdef INET6
 #include <netinet6/sctp6_var.h>
 #endif
 #include <netinet/sctp_sysctl.h>
@@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef IPSEC
 #include <netipsec/ipsec.h>
-#if defined(INET6)
+#ifdef INET6
 #include <netipsec/ipsec6.h>
 #endif                         /* INET6 */
 #endif                         /* IPSEC */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to