svn commit: r238501 - in head/sys: netinet netinet6
Michael Tuexen
tuexen at FreeBSD.org
Sun Jul 15 20:16:18 UTC 2012
Author: tuexen
Date: Sun Jul 15 20:16:17 2012
New Revision: 238501
URL: http://svn.freebsd.org/changeset/base/238501
Log:
Changes which improve compilation if neither INET nor INET6 is defined.
MFC after: 3 days
Modified:
head/sys/netinet/sctp_asconf.c
head/sys/netinet/sctp_output.c
head/sys/netinet/sctp_uio.h
head/sys/netinet/sctp_usrreq.c
head/sys/netinet6/sctp6_usrreq.c
Modified: head/sys/netinet/sctp_asconf.c
==============================================================================
--- head/sys/netinet/sctp_asconf.c Sun Jul 15 19:52:23 2012 (r238500)
+++ head/sys/netinet/sctp_asconf.c Sun Jul 15 20:16:17 2012 (r238501)
@@ -2747,13 +2747,14 @@ sctp_process_initack_addresses(struct sc
struct sctp_paramhdr tmp_param, *ph;
uint16_t plen, ptype;
struct sctp_ifa *sctp_ifa;
- struct sctp_ipv6addr_param addr_store;
#ifdef INET6
+ struct sctp_ipv6addr_param addr6_store;
struct sockaddr_in6 sin6;
#endif
#ifdef INET
+ struct sctp_ipv4addr_param addr4_store;
struct sockaddr_in sin;
#endif
@@ -2802,7 +2803,7 @@ sctp_process_initack_addresses(struct sc
a6p = (struct sctp_ipv6addr_param *)
sctp_m_getptr(m, offset,
sizeof(struct sctp_ipv6addr_param),
- (uint8_t *) & addr_store);
+ (uint8_t *) & addr6_store);
if (plen != sizeof(struct sctp_ipv6addr_param) ||
a6p == NULL) {
return;
@@ -2821,7 +2822,7 @@ sctp_process_initack_addresses(struct sc
/* get the entire IPv4 address param */
a4p = (struct sctp_ipv4addr_param *)sctp_m_getptr(m, offset,
sizeof(struct sctp_ipv4addr_param),
- (uint8_t *) & addr_store);
+ (uint8_t *) & addr4_store);
if (plen != sizeof(struct sctp_ipv4addr_param) ||
a4p == NULL) {
return;
@@ -2899,16 +2900,17 @@ sctp_addr_in_initack(struct mbuf *m, uin
{
struct sctp_paramhdr tmp_param, *ph;
uint16_t plen, ptype;
- struct sctp_ipv6addr_param addr_store;
#ifdef INET
struct sockaddr_in *sin;
struct sctp_ipv4addr_param *a4p;
+ struct sctp_ipv6addr_param addr4_store;
#endif
#ifdef INET6
struct sockaddr_in6 *sin6;
struct sctp_ipv6addr_param *a6p;
+ struct sctp_ipv6addr_param addr6_store;
struct sockaddr_in6 sin6_tmp;
#endif
@@ -2954,7 +2956,7 @@ sctp_addr_in_initack(struct mbuf *m, uin
a6p = (struct sctp_ipv6addr_param *)
sctp_m_getptr(m, offset,
sizeof(struct sctp_ipv6addr_param),
- (uint8_t *) & addr_store);
+ (uint8_t *) & addr6_store);
if (a6p == NULL) {
return (0);
}
@@ -2984,7 +2986,7 @@ sctp_addr_in_initack(struct mbuf *m, uin
a4p = (struct sctp_ipv4addr_param *)
sctp_m_getptr(m, offset,
sizeof(struct sctp_ipv4addr_param),
- (uint8_t *) & addr_store);
+ (uint8_t *) & addr4_store);
if (a4p == NULL) {
return (0);
}
Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c Sun Jul 15 19:52:23 2012 (r238500)
+++ head/sys/netinet/sctp_output.c Sun Jul 15 20:16:17 2012 (r238501)
@@ -3799,6 +3799,7 @@ sctp_get_ect(struct sctp_tcb *stcb)
}
}
+#if defined(INET) || defined(INET6)
static void
sctp_handle_no_route(struct sctp_tcb *stcb,
struct sctp_nets *net,
@@ -3843,6 +3844,8 @@ sctp_handle_no_route(struct sctp_tcb *st
}
}
+#endif
+
static int
sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
struct sctp_tcb *stcb, /* may be NULL */
@@ -3882,14 +3885,18 @@ sctp_lowlevel_chunk_output(struct sctp_i
* interface and smallest_mtu size as well.
*/
/* Will need ifdefs around this */
- struct mbuf *o_pak;
struct mbuf *newm;
struct sctphdr *sctphdr;
int packet_length;
int ret;
uint32_t vrf_id;
+
+#if defined(INET) || defined(INET6)
+ struct mbuf *o_pak;
sctp_route_t *ro = NULL;
struct udphdr *udp = NULL;
+
+#endif
uint8_t tos_value;
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
Modified: head/sys/netinet/sctp_uio.h
==============================================================================
--- head/sys/netinet/sctp_uio.h Sun Jul 15 19:52:23 2012 (r238500)
+++ head/sys/netinet/sctp_uio.h Sun Jul 15 20:16:17 2012 (r238501)
@@ -1124,10 +1124,10 @@ struct sctpstat {
#define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x)
union sctp_sockstore {
-#if defined(INET) || !defined(_KERNEL)
+#if defined(INET)
struct sockaddr_in sin;
#endif
-#if defined(INET6) || !defined(_KERNEL)
+#if defined(INET6)
struct sockaddr_in6 sin6;
#endif
struct sockaddr sa;
Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c Sun Jul 15 19:52:23 2012 (r238500)
+++ head/sys/netinet/sctp_usrreq.c Sun Jul 15 20:16:17 2012 (r238501)
@@ -5258,7 +5258,6 @@ sctp_setopt(struct socket *so, int optna
case SCTP_BINDX_ADD_ADDR:
{
struct sctp_getaddresses *addrs;
- size_t sz;
struct thread *td;
td = (struct thread *)p;
@@ -5266,8 +5265,7 @@ sctp_setopt(struct socket *so, int optna
optsize);
#ifdef INET
if (addrs->addr->sa_family == AF_INET) {
- sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in);
- if (optsize < sz) {
+ if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
break;
@@ -5280,8 +5278,7 @@ sctp_setopt(struct socket *so, int optna
#endif
#ifdef INET6
if (addrs->addr->sa_family == AF_INET6) {
- sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6);
- if (optsize < sz) {
+ if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
break;
@@ -5305,7 +5302,6 @@ sctp_setopt(struct socket *so, int optna
case SCTP_BINDX_REM_ADDR:
{
struct sctp_getaddresses *addrs;
- size_t sz;
struct thread *td;
td = (struct thread *)p;
@@ -5313,8 +5309,7 @@ sctp_setopt(struct socket *so, int optna
SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, optsize);
#ifdef INET
if (addrs->addr->sa_family == AF_INET) {
- sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in);
- if (optsize < sz) {
+ if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in)) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
break;
@@ -5327,8 +5322,7 @@ sctp_setopt(struct socket *so, int optna
#endif
#ifdef INET6
if (addrs->addr->sa_family == AF_INET6) {
- sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6);
- if (optsize < sz) {
+ if (optsize < sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6)) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
break;
Modified: head/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- head/sys/netinet6/sctp6_usrreq.c Sun Jul 15 19:52:23 2012 (r238500)
+++ head/sys/netinet6/sctp6_usrreq.c Sun Jul 15 20:16:17 2012 (r238501)
@@ -34,6 +34,7 @@
__FBSDID("$FreeBSD$");
#include <netinet/sctp_os.h>
+#ifdef INET6
#include <sys/proc.h>
#include <netinet/sctp_pcb.h>
#include <netinet/sctp_header.h>
@@ -1240,3 +1241,5 @@ struct pr_usrreqs sctp6_usrreqs = {
.pru_sosend = sctp_sosend,
.pru_soreceive = sctp_soreceive
};
+
+#endif
More information about the svn-src-head
mailing list