For IPv6 access pointer to tcpcb only after we have checked it is valid.

Found by:	Coverity's automated analysis (via Ted Unangst)
This commit is contained in:
Andre Oppermann 2004-08-19 20:16:17 +00:00
parent 0b54748fec
commit 6f2d4ea6f8
2 changed files with 8 additions and 2 deletions

View File

@ -1420,11 +1420,14 @@ tcp_mtudisc(inp, errno)
u_int romtu;
int mss;
#ifdef INET6
int isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0;
int isipv6;
#endif /* INET6 */
bzero(&tao, sizeof(tao));
if (tp != NULL) {
#ifdef INET6
isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0;
#endif
maxmtu = tcp_hc_getmtu(&inp->inp_inc); /* IPv4 and IPv6 */
romtu =
#ifdef INET6

View File

@ -1420,11 +1420,14 @@ tcp_mtudisc(inp, errno)
u_int romtu;
int mss;
#ifdef INET6
int isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0;
int isipv6;
#endif /* INET6 */
bzero(&tao, sizeof(tao));
if (tp != NULL) {
#ifdef INET6
isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0;
#endif
maxmtu = tcp_hc_getmtu(&inp->inp_inc); /* IPv4 and IPv6 */
romtu =
#ifdef INET6