Changes which improve compilation if neither INET nor INET6 is defined.
MFC after: 3 days
This commit is contained in:
parent
6aef0416fb
commit
5e20b91dbe
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238501
@ -2747,13 +2747,14 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
|
||||
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 sctp_tcb *stcb, struct mbuf *m,
|
||||
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 sctp_tcb *stcb, struct mbuf *m,
|
||||
/* 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, uint32_t offset, uint32_t length, struct so
|
||||
{
|
||||
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, uint32_t offset, uint32_t length, struct so
|
||||
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, uint32_t offset, uint32_t length, struct so
|
||||
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);
|
||||
}
|
||||
|
@ -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 *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
#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_inpcb *inp,
|
||||
* 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)
|
||||
|
@ -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;
|
||||
|
@ -5258,7 +5258,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
||||
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 optname, void *optval, size_t optsize,
|
||||
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 optname, void *optval, size_t optsize,
|
||||
#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 optname, void *optval, size_t optsize,
|
||||
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 optname, void *optval, size_t optsize,
|
||||
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 optname, void *optval, size_t optsize,
|
||||
#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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user