diff options
author | andre <andre@FreeBSD.org> | 2004-08-19 20:16:17 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-08-19 20:16:17 +0000 |
commit | 93c5d20c7760244ea98d2b9bc9620a20285c02cd (patch) | |
tree | 45b1b6bcdfd38d18e1614b312dbac72904d171aa /sys/netinet/tcp_subr.c | |
parent | 7a83d1fca49a2cba4ac4529728120adc22a09074 (diff) | |
download | FreeBSD-src-93c5d20c7760244ea98d2b9bc9620a20285c02cd.zip FreeBSD-src-93c5d20c7760244ea98d2b9bc9620a20285c02cd.tar.gz |
For IPv6 access pointer to tcpcb only after we have checked it is valid.
Found by: Coverity's automated analysis (via Ted Unangst)
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 2eebce4..cb709fb 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -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 |