diff options
author | 2013-04-02 18:27:46 +0000 | |
---|---|---|
committer | 2013-04-02 18:27:46 +0000 | |
commit | faff72426c3829a1ac8d12a6f45ec88e24dd9fd9 (patch) | |
tree | 38df231aa48629f79da7d7e345545db887e0686b /sys/netinet/tcp_subr.c | |
parent | better implementation for tcp_read() that can get the packet length in (diff) | |
download | wireguard-openbsd-faff72426c3829a1ac8d12a6f45ec88e24dd9fd9.tar.xz wireguard-openbsd-faff72426c3829a1ac8d12a6f45ec88e24dd9fd9.zip |
Use macros sotoinpcb() and intotcpcb() instead of casts. Use NULL
instead of 0 for pointers. No binary change.
OK mpi@
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 285a510e9e4..9954687ff55 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.116 2013/03/28 23:10:06 tedu Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.117 2013/04/02 18:27:47 bluhm Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -459,7 +459,7 @@ tcp_newtcpcb(struct inpcb *inp) tp = pool_get(&tcpcb_pool, PR_NOWAIT|PR_ZERO); if (tp == NULL) - return ((struct tcpcb *)0); + return (NULL); TAILQ_INIT(&tp->t_segq); tp->t_maxseg = tcp_mssdflt; tp->t_maxopd = 0; @@ -576,7 +576,7 @@ tcp_close(struct tcpcb *tp) inp->inp_ppcb = 0; soisdisconnected(so); in_pcbdetach(inp); - return ((struct tcpcb *)0); + return (NULL); } void @@ -629,7 +629,7 @@ tcp_notify(inp, error) struct inpcb *inp; int error; { - struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb; + struct tcpcb *tp = intotcpcb(inp); struct socket *so = inp->inp_socket; /* |