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/udp_usrreq.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/udp_usrreq.c')
| -rw-r--r-- | sys/netinet/udp_usrreq.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index f5c1c094c94..6aa01777569 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.157 2013/03/31 11:18:35 bluhm Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.158 2013/04/02 18:27:47 bluhm Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -1160,12 +1160,11 @@ udp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *addr, } splx(s); #ifdef INET6 - if (((struct inpcb *)so->so_pcb)->inp_flags & INP_IPV6) - ((struct inpcb *) so->so_pcb)->inp_ipv6.ip6_hlim = - ip6_defhlim; + if (sotoinpcb(so)->inp_flags & INP_IPV6) + sotoinpcb(so)->inp_ipv6.ip6_hlim = ip6_defhlim; else #endif /* INET6 */ - ((struct inpcb *) so->so_pcb)->inp_ip.ip_ttl = ip_defttl; + sotoinpcb(so)->inp_ip.ip_ttl = ip_defttl; break; case PRU_DETACH: |
