mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-27 11:55:06 +00:00
Improve consistency. No functional change.
MFC after: 3 days
This commit is contained in:
parent
1180fa861b
commit
94962f6ba0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350588
@ -1957,7 +1957,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
|
||||
/* invalid if we are a v6 only endpoint */
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
|
||||
SCTP_IPV6_V6ONLY(&inp->ip_inp.inp))
|
||||
SCTP_IPV6_V6ONLY(inp))
|
||||
return;
|
||||
|
||||
sin = &ifa->address.sin;
|
||||
@ -2030,9 +2030,8 @@ sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNU
|
||||
case AF_INET:
|
||||
{
|
||||
/* invalid if we are a v6 only endpoint */
|
||||
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
|
||||
SCTP_IPV6_V6ONLY(&inp->ip_inp.inp)) {
|
||||
SCTP_IPV6_V6ONLY(inp)) {
|
||||
cnt_invalid++;
|
||||
if (asc->cnt == cnt_invalid)
|
||||
return (1);
|
||||
@ -2147,7 +2146,7 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
|
||||
/* invalid if we are a v6 only endpoint */
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
|
||||
SCTP_IPV6_V6ONLY(&inp->ip_inp.inp))
|
||||
SCTP_IPV6_V6ONLY(inp))
|
||||
continue;
|
||||
|
||||
sin = &ifa->address.sin;
|
||||
@ -2164,7 +2163,7 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
continue;
|
||||
}
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
|
||||
SCTP_IPV6_V6ONLY(&inp->ip_inp.inp)) {
|
||||
SCTP_IPV6_V6ONLY(inp)) {
|
||||
cnt_invalid++;
|
||||
if (asc->cnt == cnt_invalid)
|
||||
return;
|
||||
|
@ -365,10 +365,10 @@ typedef struct callout sctp_os_timer_t;
|
||||
*/
|
||||
|
||||
/* get the v6 hop limit */
|
||||
#define SCTP_GET_HLIM(inp, ro) in6_selecthlim((struct inpcb *)&inp->ip_inp.inp, (ro ? (ro->ro_rt ? (ro->ro_rt->rt_ifp) : (NULL)) : (NULL)));
|
||||
#define SCTP_GET_HLIM(inp, ro) in6_selecthlim(&inp->ip_inp.inp, (ro ? (ro->ro_rt ? (ro->ro_rt->rt_ifp) : (NULL)) : (NULL)));
|
||||
|
||||
/* is the endpoint v6only? */
|
||||
#define SCTP_IPV6_V6ONLY(inp) (((struct inpcb *)inp)->inp_flags & IN6P_IPV6_V6ONLY)
|
||||
#define SCTP_IPV6_V6ONLY(sctp_inpcb) ((sctp_inpcb)->ip_inp.inp.inp_flags & IN6P_IPV6_V6ONLY)
|
||||
/* is the socket non-blocking? */
|
||||
#define SCTP_SO_IS_NBIO(so) ((so)->so_state & SS_NBIO)
|
||||
#define SCTP_SET_SO_NBIO(so) ((so)->so_state |= SS_NBIO)
|
||||
|
@ -2845,7 +2845,7 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr,
|
||||
struct sockaddr_in *sin;
|
||||
|
||||
/* IPV6_V6ONLY socket? */
|
||||
if (SCTP_IPV6_V6ONLY(ip_inp)) {
|
||||
if (SCTP_IPV6_V6ONLY(inp)) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL);
|
||||
return (EINVAL);
|
||||
}
|
||||
@ -3643,8 +3643,9 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
|
||||
|
||||
|
||||
#ifdef INET6
|
||||
if (ip_pcb->inp_vflag & INP_IPV6)
|
||||
ip6_freepcbopts(((struct inpcb *)inp)->in6p_outputopts);
|
||||
if (ip_pcb->inp_vflag & INP_IPV6) {
|
||||
ip6_freepcbopts(ip_pcb->in6p_outputopts);
|
||||
}
|
||||
#endif /* INET6 */
|
||||
ip_pcb->inp_vflag = 0;
|
||||
/* free up authentication fields */
|
||||
|
@ -1412,7 +1412,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
|
||||
}
|
||||
if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
|
||||
(num_v4 > 0)) {
|
||||
|
||||
if (SCTP_IPV6_V6ONLY(inp)) {
|
||||
/*
|
||||
* if IPV6_V6ONLY flag, ignore connections destined
|
||||
@ -6931,14 +6930,14 @@ sctp_connect(struct socket *so, struct sockaddr *addr, struct thread *p)
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
{
|
||||
struct sockaddr_in *sinp;
|
||||
struct sockaddr_in *sin;
|
||||
|
||||
if (addr->sa_len != sizeof(struct sockaddr_in)) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
return (EINVAL);
|
||||
}
|
||||
sinp = (struct sockaddr_in *)addr;
|
||||
if (p != NULL && (error = prison_remote_ip4(p->td_ucred, &sinp->sin_addr)) != 0) {
|
||||
sin = (struct sockaddr_in *)addr;
|
||||
if (p != NULL && (error = prison_remote_ip4(p->td_ucred, &sin->sin_addr)) != 0) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
|
||||
return (error);
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ sctp6_bind(struct socket *so, struct sockaddr *addr, struct thread *p)
|
||||
}
|
||||
inp->ip_inp.inp.inp_vflag &= ~INP_IPV4;
|
||||
inp->ip_inp.inp.inp_vflag |= INP_IPV6;
|
||||
if ((addr != NULL) && (SCTP_IPV6_V6ONLY(&inp->ip_inp.inp) == 0)) {
|
||||
if ((addr != NULL) && (SCTP_IPV6_V6ONLY(inp) == 0)) {
|
||||
switch (addr->sa_family) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
|
Loading…
Reference in New Issue
Block a user