From 90eedd27c3a97bd92f33625886a445649b095581 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Tue, 2 Apr 2013 18:27:48 +0000 Subject: Use macros sotoinpcb() and intotcpcb() instead of casts. Use NULL instead of 0 for pointers. No binary change. OK mpi@ --- sys/netinet/udp_usrreq.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/netinet/udp_usrreq.c') 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: -- cgit v1.2.3