Tidy up some code to conform better to surroundings and style(9), 0 = NULL
and space/tab.
This commit is contained in:
parent
fc30a25199
commit
4dfdffe9e2
@ -441,9 +441,9 @@ tcp_input(struct mbuf *m, int off0)
|
|||||||
int optlen = 0;
|
int optlen = 0;
|
||||||
int len, tlen, off;
|
int len, tlen, off;
|
||||||
int drop_hdrlen;
|
int drop_hdrlen;
|
||||||
struct tcpcb *tp = 0;
|
struct tcpcb *tp = NULL;
|
||||||
int thflags;
|
int thflags;
|
||||||
struct socket *so = 0;
|
struct socket *so = NULL;
|
||||||
int todrop, acked, ourfinisacked, needoutput = 0;
|
int todrop, acked, ourfinisacked, needoutput = 0;
|
||||||
u_long tiwin;
|
u_long tiwin;
|
||||||
struct tcpopt to; /* options in this segment */
|
struct tcpopt to; /* options in this segment */
|
||||||
@ -514,7 +514,8 @@ tcp_input(struct mbuf *m, int off0)
|
|||||||
off0 = sizeof(struct ip);
|
off0 = sizeof(struct ip);
|
||||||
}
|
}
|
||||||
if (m->m_len < sizeof (struct tcpiphdr)) {
|
if (m->m_len < sizeof (struct tcpiphdr)) {
|
||||||
if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == 0) {
|
if ((m = m_pullup(m, sizeof (struct tcpiphdr)))
|
||||||
|
== NULL) {
|
||||||
tcpstat.tcps_rcvshort++;
|
tcpstat.tcps_rcvshort++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -576,7 +577,7 @@ tcp_input(struct mbuf *m, int off0)
|
|||||||
} else {
|
} else {
|
||||||
if (m->m_len < sizeof(struct ip) + off) {
|
if (m->m_len < sizeof(struct ip) + off) {
|
||||||
if ((m = m_pullup(m, sizeof (struct ip) + off))
|
if ((m = m_pullup(m, sizeof (struct ip) + off))
|
||||||
== 0) {
|
== NULL) {
|
||||||
tcpstat.tcps_rcvshort++;
|
tcpstat.tcps_rcvshort++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -670,13 +671,11 @@ findpcb:
|
|||||||
|
|
||||||
#if defined(IPSEC) || defined(FAST_IPSEC)
|
#if defined(IPSEC) || defined(FAST_IPSEC)
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
if (isipv6) {
|
if (isipv6 && inp != NULL && ipsec6_in_reject(m, inp)) {
|
||||||
if (inp != NULL && ipsec6_in_reject(m, inp)) {
|
|
||||||
#ifdef IPSEC
|
#ifdef IPSEC
|
||||||
ipsec6stat.in_polvio++;
|
ipsec6stat.in_polvio++;
|
||||||
#endif
|
#endif
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
#endif /* INET6 */
|
#endif /* INET6 */
|
||||||
if (inp != NULL && ipsec4_in_reject(m, inp)) {
|
if (inp != NULL && ipsec4_in_reject(m, inp)) {
|
||||||
@ -768,7 +767,7 @@ findpcb:
|
|||||||
* segment and send an appropriate response.
|
* segment and send an appropriate response.
|
||||||
*/
|
*/
|
||||||
tp = intotcpcb(inp);
|
tp = intotcpcb(inp);
|
||||||
if (tp == 0) {
|
if (tp == NULL) {
|
||||||
INP_UNLOCK(inp);
|
INP_UNLOCK(inp);
|
||||||
rstreason = BANDLIM_RST_CLOSEDPORT;
|
rstreason = BANDLIM_RST_CLOSEDPORT;
|
||||||
goto dropwithreset;
|
goto dropwithreset;
|
||||||
@ -2702,7 +2701,7 @@ tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m,
|
|||||||
}
|
}
|
||||||
cnt -= m->m_len;
|
cnt -= m->m_len;
|
||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
panic("tcp_pulloutofband");
|
panic("tcp_pulloutofband");
|
||||||
|
@ -441,9 +441,9 @@ tcp_input(struct mbuf *m, int off0)
|
|||||||
int optlen = 0;
|
int optlen = 0;
|
||||||
int len, tlen, off;
|
int len, tlen, off;
|
||||||
int drop_hdrlen;
|
int drop_hdrlen;
|
||||||
struct tcpcb *tp = 0;
|
struct tcpcb *tp = NULL;
|
||||||
int thflags;
|
int thflags;
|
||||||
struct socket *so = 0;
|
struct socket *so = NULL;
|
||||||
int todrop, acked, ourfinisacked, needoutput = 0;
|
int todrop, acked, ourfinisacked, needoutput = 0;
|
||||||
u_long tiwin;
|
u_long tiwin;
|
||||||
struct tcpopt to; /* options in this segment */
|
struct tcpopt to; /* options in this segment */
|
||||||
@ -514,7 +514,8 @@ tcp_input(struct mbuf *m, int off0)
|
|||||||
off0 = sizeof(struct ip);
|
off0 = sizeof(struct ip);
|
||||||
}
|
}
|
||||||
if (m->m_len < sizeof (struct tcpiphdr)) {
|
if (m->m_len < sizeof (struct tcpiphdr)) {
|
||||||
if ((m = m_pullup(m, sizeof (struct tcpiphdr))) == 0) {
|
if ((m = m_pullup(m, sizeof (struct tcpiphdr)))
|
||||||
|
== NULL) {
|
||||||
tcpstat.tcps_rcvshort++;
|
tcpstat.tcps_rcvshort++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -576,7 +577,7 @@ tcp_input(struct mbuf *m, int off0)
|
|||||||
} else {
|
} else {
|
||||||
if (m->m_len < sizeof(struct ip) + off) {
|
if (m->m_len < sizeof(struct ip) + off) {
|
||||||
if ((m = m_pullup(m, sizeof (struct ip) + off))
|
if ((m = m_pullup(m, sizeof (struct ip) + off))
|
||||||
== 0) {
|
== NULL) {
|
||||||
tcpstat.tcps_rcvshort++;
|
tcpstat.tcps_rcvshort++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -670,13 +671,11 @@ findpcb:
|
|||||||
|
|
||||||
#if defined(IPSEC) || defined(FAST_IPSEC)
|
#if defined(IPSEC) || defined(FAST_IPSEC)
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
if (isipv6) {
|
if (isipv6 && inp != NULL && ipsec6_in_reject(m, inp)) {
|
||||||
if (inp != NULL && ipsec6_in_reject(m, inp)) {
|
|
||||||
#ifdef IPSEC
|
#ifdef IPSEC
|
||||||
ipsec6stat.in_polvio++;
|
ipsec6stat.in_polvio++;
|
||||||
#endif
|
#endif
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
#endif /* INET6 */
|
#endif /* INET6 */
|
||||||
if (inp != NULL && ipsec4_in_reject(m, inp)) {
|
if (inp != NULL && ipsec4_in_reject(m, inp)) {
|
||||||
@ -768,7 +767,7 @@ findpcb:
|
|||||||
* segment and send an appropriate response.
|
* segment and send an appropriate response.
|
||||||
*/
|
*/
|
||||||
tp = intotcpcb(inp);
|
tp = intotcpcb(inp);
|
||||||
if (tp == 0) {
|
if (tp == NULL) {
|
||||||
INP_UNLOCK(inp);
|
INP_UNLOCK(inp);
|
||||||
rstreason = BANDLIM_RST_CLOSEDPORT;
|
rstreason = BANDLIM_RST_CLOSEDPORT;
|
||||||
goto dropwithreset;
|
goto dropwithreset;
|
||||||
@ -2702,7 +2701,7 @@ tcp_pulloutofband(struct socket *so, struct tcphdr *th, struct mbuf *m,
|
|||||||
}
|
}
|
||||||
cnt -= m->m_len;
|
cnt -= m->m_len;
|
||||||
m = m->m_next;
|
m = m->m_next;
|
||||||
if (m == 0)
|
if (m == NULL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
panic("tcp_pulloutofband");
|
panic("tcp_pulloutofband");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user