From 6d50da9dc49b3eb06c83c28255aab12d13329024 Mon Sep 17 00:00:00 2001 From: krw Date: Sun, 7 Jun 2015 01:25:27 +0000 Subject: [PATCH] Replace a bunch of == 0 with == NULL in pointer tests. Nuke some annoying trailing, leading and embedded whitespace. No change to .o files. ok deraadt@ --- sys/netinet/if_ether.c | 22 ++++++++++----------- sys/netinet/ip_icmp.c | 10 +++++----- sys/netinet/ip_input.c | 18 ++++++++--------- sys/netinet/ip_output.c | 22 ++++++++++----------- sys/netinet/raw_ip.c | 16 +++++++-------- sys/netinet/tcp_input.c | 42 ++++++++++++++++++++-------------------- sys/netinet/tcp_output.c | 26 ++++++++++++------------- sys/netinet/tcp_usrreq.c | 18 ++++++++--------- 8 files changed, 87 insertions(+), 87 deletions(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 724e77f706a..8b7c5b7e011 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.153 2015/05/26 11:55:34 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.154 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -260,7 +260,7 @@ arp_rtrequest(int req, struct rtentry *rt) break; case RTM_DELETE: - if (la == 0) + if (la == NULL) break; arp_inuse--; LIST_REMOVE(la, la_list); @@ -377,7 +377,7 @@ arpresolve(struct arpcom *ac, struct rtentry *rt0, struct mbuf *m, inet_ntop(AF_INET, &satosin(dst)->sin_addr, addr, sizeof(addr))); } - if (la == 0 || rt == 0) { + if (la == NULL || rt == NULL) { m_freem(m); return (EINVAL); } @@ -685,7 +685,7 @@ in_arpinput(struct mbuf *m) ac->ac_if.if_xname); goto out; } - sdl->sdl_alen = sizeof(ea->arp_sha); + sdl->sdl_alen = sizeof(ea->arp_sha); memcpy(LLADDR(sdl), ea->arp_sha, sizeof(ea->arp_sha)); if (rt->rt_expire) rt->rt_expire = time_second + arpt_keep; @@ -723,7 +723,7 @@ out: } else { la = arplookup(itaddr.s_addr, 0, SIN_PROXY, rtable_l2(m->m_pkthdr.ph_rtableid)); - if (la == 0) + if (la == NULL) goto out; rt = la->la_rt; if (rt->rt_ifp->if_type == IFT_CARP && ifp->if_type != IFT_CARP) @@ -796,7 +796,7 @@ arplookup(u_int32_t addr, int create, int proxy, u_int tableid) flags = (create) ? (RT_REPORT|RT_RESOLVE) : 0; rt = rtalloc((struct sockaddr *)&sin, flags, tableid); - if (rt == 0) + if (rt == NULL) return (0); rt->rt_refcnt--; if ((rt->rt_flags & RTF_GATEWAY) || (rt->rt_flags & RTF_LLINFO) == 0 || @@ -804,7 +804,7 @@ arplookup(u_int32_t addr, int create, int proxy, u_int tableid) if (create) { if (rt->rt_refcnt <= 0 && (rt->rt_flags & RTF_CLONED) != 0) { - rtdeletemsg(rt, tableid); + rtdeletemsg(rt, tableid); } } return (0); @@ -833,8 +833,8 @@ arpproxy(struct in_addr in, u_int rdomain) if (!memcmp(LLADDR((struct sockaddr_dl *)la->la_rt->rt_gateway), LLADDR(ifp->if_sadl), ETHER_ADDR_LEN)) { - found = 1; - break; + found = 1; + break; } } @@ -1029,7 +1029,7 @@ db_print_sa(struct sockaddr *sa) int len; u_char *p; - if (sa == 0) { + if (sa == NULL) { db_printf("[NULL]"); return; } @@ -1050,7 +1050,7 @@ db_print_sa(struct sockaddr *sa) void db_print_ifa(struct ifaddr *ifa) { - if (ifa == 0) + if (ifa == NULL) return; db_printf(" ifa_addr="); db_print_sa(ifa->ifa_addr); diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 665e9f6b7ec..6ea790f0183 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.134 2015/05/19 14:16:35 mpi Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.135 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -551,7 +551,7 @@ icmp_input(struct mbuf *m, ...) if (ifp == NULL) break; ia = ifatoia(ifaof_ifpforaddr(sintosa(&sin), ifp)); - if (ia == 0) + if (ia == NULL) break; icp->icmp_type = ICMP_MASKREPLY; icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr; @@ -929,7 +929,7 @@ icmp_mtudisc_clone(struct in_addr dst, u_int rtableid) /* Check if the route is actually usable */ if (rt->rt_flags & (RTF_REJECT | RTF_BLACKHOLE) || (rt->rt_flags & RTF_UP) == 0) { - rtfree(rt); + rtfree(rt); return (NULL); } @@ -976,7 +976,7 @@ icmp_mtudisc(struct icmp *icp, u_int rtableid) u_long mtu = ntohs(icp->icmp_nextmtu); /* Why a long? IPv6 */ rt = icmp_mtudisc_clone(icp->icmp_ip.ip_dst, rtableid); - if (rt == 0) + if (rt == NULL) return; if (mtu == 0) { @@ -1105,7 +1105,7 @@ icmp_do_exthdr(struct mbuf *m, u_int16_t class, u_int8_t ctype, void *buf, icp->icmp_type != ICMP_PARAMPROB) /* exthdr not supported */ return (0); - + if (icp->icmp_length != 0) /* exthdr already present, giving up */ return (0); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 967c8ddaedb..8fc560dd999 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.249 2015/05/13 10:42:46 jsg Exp $ */ +/* $OpenBSD: ip_input.c,v 1.250 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -159,7 +159,7 @@ ip_init(void) pool_init(&ipq_pool, sizeof(struct ipq), 0, 0, 0, "ipq", NULL); pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); - if (pr == 0) + if (pr == NULL) panic("ip_init"); for (i = 0; i < IPPROTO_MAX; i++) ip_protox[i] = pr - inetsw; @@ -576,7 +576,7 @@ found: */ if ((ip->ip_p == IPPROTO_ESP) || (ip->ip_p == IPPROTO_AH) || (ip->ip_p == IPPROTO_IPCOMP)) - goto skipipsec; + goto skipipsec; /* * If the protected packet was tunneled, then we need to @@ -1050,7 +1050,7 @@ ip_dooptions(struct mbuf *m, struct ifnet *ifp) ipaddr.sin_addr = ip->ip_dst; ia = ifatoia(ifa_ifwithaddr(sintosa(&ipaddr), m->m_pkthdr.ph_rtableid)); - if (ia == 0) { + if (ia == NULL) { if (opt == IPOPT_SSRR) { type = ICMP_UNREACH; code = ICMP_UNREACH_SRCFAIL; @@ -1088,7 +1088,7 @@ ip_dooptions(struct mbuf *m, struct ifnet *ifp) /* keep packet in the virtual instance */ ia = ip_rtaddr(ipaddr.sin_addr, m->m_pkthdr.ph_rtableid); - if (ia == 0) { + if (ia == NULL) { type = ICMP_UNREACH; code = ICMP_UNREACH_SRCFAIL; goto bad; @@ -1129,9 +1129,9 @@ ip_dooptions(struct mbuf *m, struct ifnet *ifp) * Again keep the packet inside the virtual instance. */ if ((ia = ifatoia(ifa_ifwithaddr(sintosa(&ipaddr), - m->m_pkthdr.ph_rtableid))) == 0 && + m->m_pkthdr.ph_rtableid))) == NULL && (ia = ip_rtaddr(ipaddr.sin_addr, - m->m_pkthdr.ph_rtableid)) == 0) { + m->m_pkthdr.ph_rtableid)) == NULL) { type = ICMP_UNREACH; code = ICMP_UNREACH_HOST; goto bad; @@ -1169,7 +1169,7 @@ ip_dooptions(struct mbuf *m, struct ifnet *ifp) ipaddr.sin_addr = dst; ia = ifatoia(ifaof_ifpforaddr(sintosa(&ipaddr), ifp)); - if (ia == 0) + if (ia == NULL) continue; memcpy(&sin, &ia->ia_addr.sin_addr, sizeof(struct in_addr)); @@ -1185,7 +1185,7 @@ ip_dooptions(struct mbuf *m, struct ifnet *ifp) ipaddr.sin_len = sizeof(ipaddr); ipaddr.sin_addr = sin; if (ifa_ifwithaddr(sintosa(&ipaddr), - m->m_pkthdr.ph_rtableid) == 0) + m->m_pkthdr.ph_rtableid) == NULL) continue; ipt.ipt_ptr += sizeof(struct in_addr); break; diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 625c69578a1..960fc284624 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.281 2015/05/23 12:52:59 markus Exp $ */ +/* $OpenBSD: ip_output.c,v 1.282 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -164,7 +164,7 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro, int flags, } donerouting = 1; - if (ro == 0) { + if (ro == NULL) { ro = &iproute; memset(ro, 0, sizeof(*ro)); } @@ -182,7 +182,7 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro, int flags, ro->ro_rt = NULL; } - if (ro->ro_rt == 0) { + if (ro->ro_rt == NULL) { dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = ip->ip_dst; @@ -195,11 +195,11 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro, int flags, mtu = ifp->if_mtu; IFP_TO_IA(ifp, ia); } else { - if (ro->ro_rt == 0) + if (ro->ro_rt == NULL) ro->ro_rt = rtalloc_mpath(&ro->ro_dst, NULL, ro->ro_tableid); - if (ro->ro_rt == 0) { + if (ro->ro_rt == NULL) { ipstat.ips_noroute++; error = EHOSTUNREACH; goto bad; @@ -297,7 +297,7 @@ reroute: mtu = ifp->if_mtu; ro->ro_rt = NULL; } else if (donerouting == 0) { - if (ro == 0) { + if (ro == NULL) { ro = &iproute; memset(ro, 0, sizeof(*ro)); } @@ -315,7 +315,7 @@ reroute: ro->ro_rt = NULL; } - if (ro->ro_rt == 0) { + if (ro->ro_rt == NULL) { dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = ip->ip_dst; @@ -328,11 +328,11 @@ reroute: mtu = ifp->if_mtu; IFP_TO_IA(ifp, ia); } else { - if (ro->ro_rt == 0) + if (ro->ro_rt == NULL) ro->ro_rt = rtalloc_mpath(&ro->ro_dst, &ip->ip_src.s_addr, ro->ro_tableid); - if (ro->ro_rt == 0) { + if (ro->ro_rt == NULL) { ipstat.ips_noroute++; error = EHOSTUNREACH; goto bad; @@ -1295,7 +1295,7 @@ ip_pcbopts(struct mbuf **pcbopt, struct mbuf *m) if (*pcbopt) (void)m_free(*pcbopt); *pcbopt = 0; - if (m == (struct mbuf *)NULL || m->m_len == 0) { + if (m == NULL || m->m_len == 0) { /* * Only turning off any previous options. */ @@ -1365,7 +1365,7 @@ ip_pcbopts(struct mbuf **pcbopt, struct mbuf *m) */ memmove((caddr_t)&cp[IPOPT_OFFSET+1], (caddr_t)(&cp[IPOPT_OFFSET+1] + - sizeof(struct in_addr)), + sizeof(struct in_addr)), (unsigned)cnt - (IPOPT_OFFSET+1)); break; } diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index a16ee6a3843..4a0a64e383b 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip.c,v 1.79 2015/01/24 00:29:06 deraadt Exp $ */ +/* $OpenBSD: raw_ip.c,v 1.80 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */ /* @@ -42,10 +42,10 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgements: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * This product includes software developed at the Information - * Technology Division, US Naval Research Laboratory. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * This product includes software developed at the Information + * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -313,7 +313,7 @@ rip_ctloutput(int op, struct socket *so, int level, int optname, case IP_HDRINCL: error = 0; if (op == PRCO_SETOPT) { - if (*m == 0 || (*m)->m_len < sizeof (int)) + if (*m == NULL || (*m)->m_len < sizeof (int)) error = EINVAL; else if (*mtod(*m, int *)) inp->inp_flags |= INP_HDRINCL; @@ -331,7 +331,7 @@ rip_ctloutput(int op, struct socket *so, int level, int optname, case IP_DIVERTFL: switch (op) { case PRCO_SETOPT: - if (*m == 0 || (*m)->m_len < sizeof (int)) { + if (*m == NULL || (*m)->m_len < sizeof (int)) { error = EINVAL; break; } @@ -448,7 +448,7 @@ rip_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, soisdisconnected(so); /* FALLTHROUGH */ case PRU_DETACH: - if (inp == 0) + if (inp == NULL) panic("rip_detach"); #ifdef MROUTING if (so == ip_mrouter) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9e9ba4f1a91..6a6db0ea0e1 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.290 2015/05/13 10:42:46 jsg Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.291 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -42,10 +42,10 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgements: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * This product includes software developed at the Information - * Technology Division, US Naval Research Laboratory. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * This product includes software developed at the Information + * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -632,7 +632,7 @@ findpcb: * If the TCB exists but is in CLOSED state, it is embryonic, * but should either do a listen or a connect soon. */ - if (inp == 0) { + if (inp == NULL) { ++tcpstat.tcps_noport; goto dropwithreset_ratelim; } @@ -645,7 +645,7 @@ findpcb: goto drop; tp = intotcpcb(inp); - if (tp == 0) + if (tp == NULL) goto dropwithreset_ratelim; if (tp->t_state == TCPS_CLOSED) goto drop; @@ -799,7 +799,7 @@ findpcb: * (2a) "SHOULD NOT be used if alternate * address with sufficient scope is * available" - * (2b) nothing mentioned otherwise. + * (2b) nothing mentioned otherwise. * Here we fall into (2b) case as we have no * choice in our source address selection - we * must obey the peer. @@ -1000,16 +1000,16 @@ findpcb: /* * If we had a pending ICMP message that - * referres to data that have just been - * acknowledged, disregard the recorded ICMP + * refers to data that have just been + * acknowledged, disregard the recorded ICMP * message. */ - if ((tp->t_flags & TF_PMTUD_PEND) && + if ((tp->t_flags & TF_PMTUD_PEND) && SEQ_GT(th->th_ack, tp->t_pmtud_th_seq)) tp->t_flags &= ~TF_PMTUD_PEND; /* - * Keep track of the largest chunk of data + * Keep track of the largest chunk of data * acknowledged since last PMTU update */ if (tp->t_pmtud_mss_acked < acked) @@ -1650,7 +1650,7 @@ trimthenstep6: #if defined(TCP_SACK) || defined(TCP_ECN) if (SEQ_LT(th->th_ack, tp->snd_last)){ - /* + /* * False fast retx after * timeout. Do not cut window. */ @@ -1663,7 +1663,7 @@ trimthenstep6: tp->snd_ssthresh = win * tp->t_maxseg; #ifdef TCP_SACK tp->snd_last = tp->snd_max; - if (tp->sack_enable) { + if (tp->sack_enable) { TCP_TIMER_DISARM(tp, TCPT_REXMT); tp->t_rtttime = 0; #ifdef TCP_ECN @@ -1772,7 +1772,7 @@ trimthenstep6: /* Out of fast recovery */ tp->snd_cwnd = tp->snd_ssthresh; if (tcp_seq_subtract(tp->snd_max, th->th_ack) < - tp->snd_ssthresh) + tp->snd_ssthresh) tp->snd_cwnd = tcp_seq_subtract(tp->snd_max, th->th_ack); @@ -1861,7 +1861,7 @@ trimthenstep6: * that have just been acknowledged, disregard the recorded * ICMP message. */ - if ((tp->t_flags & TF_PMTUD_PEND) && + if ((tp->t_flags & TF_PMTUD_PEND) && SEQ_GT(th->th_ack, tp->t_pmtud_th_seq)) tp->t_flags &= ~TF_PMTUD_PEND; @@ -2625,7 +2625,7 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) #if defined(TCP_SACK) && defined(TCP_FACK) if (SEQ_GT(sack.end, cur->rxmit)) tp->retran_data -= - tcp_seq_subtract(cur->rxmit, + tcp_seq_subtract(cur->rxmit, cur->start); else tp->retran_data -= @@ -3062,7 +3062,7 @@ tcp_mss(struct tcpcb *tp, int offer) * If we compute a larger value, return it for use in sending * a max seg size option, but don't store it for use * unless we received an offer at least that large from peer. - * + * * However, do not accept offers lower than the minimum of * the interface MTU and 216. */ @@ -3257,12 +3257,12 @@ tcp_mss_adv(struct ifnet *ifp, int af) iphlen = sizeof(struct ip); break; #ifdef INET6 - case AF_INET6: + case AF_INET6: if (ifp != NULL) mss = IN6_LINKMTU(ifp); iphlen = sizeof(struct ip6_hdr); break; -#endif +#endif } mss = mss - iphlen - sizeof(struct tcphdr); return (max(mss, tcp_mssdflt)); @@ -3729,7 +3729,7 @@ syn_cache_get(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th, #ifdef INET6 else inp->inp_route6 = sc->sc_route6; -#endif +#endif sc->sc_route4.ro_rt = NULL; am = m_get(M_DONTWAIT, MT_SONAME); /* XXX */ diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index b245e0a9509..2fd005582e8 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_output.c,v 1.109 2015/03/14 03:38:52 jsg Exp $ */ +/* $OpenBSD: tcp_output.c,v 1.110 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: tcp_output.c,v 1.16 1997/06/03 16:17:09 kml Exp $ */ /* @@ -42,10 +42,10 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgements: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * This product includes software developed at the Information - * Technology Division, US Naval Research Laboratory. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * This product includes software developed at the Information + * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -109,7 +109,7 @@ void tcp_print_holes(struct tcpcb *tp) { struct sackhole *p = tp->snd_holes; - if (p == 0) + if (p == NULL) return; printf("Hole report: start--end dups rxmit\n"); while (p) { @@ -155,7 +155,7 @@ tcp_sack_output(struct tcpcb *tp) #endif return (p); } - p = p->next; + p = p->next; } return (NULL); } @@ -300,7 +300,7 @@ again: if (SEQ_LT(tp->snd_una, tp->snd_last)) tp->snd_cwnd -= tp->t_maxseg; #endif - } + } } #endif /* TCP_SACK */ @@ -518,7 +518,7 @@ send: * always fit in a single mbuf, leaving room for a maximum * link header, i.e. * max_linkhdr + sizeof(network header) + sizeof(struct tcphdr + - * optlen <= MHLEN + * optlen <= MHLEN */ optlen = 0; @@ -1103,10 +1103,10 @@ send: if (error) { out: if (error == ENOBUFS) { - /* + /* * If the interface queue is full, or IP cannot * get an mbuf, trigger TCP slow start. - */ + */ tp->snd_cwnd = tp->t_maxseg; return (0); } @@ -1134,10 +1134,10 @@ out: return (error); } - + if (packetlen > tp->t_pmtud_mtu_sent) tp->t_pmtud_mtu_sent = packetlen; - + tcpstat.tcps_sndtotal++; if (tp->t_flags & TF_DELACK) tcpstat.tcps_delack++; diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index b2edc2f4e93..52c81ee38de 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.123 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.124 2015/06/07 01:25:27 krw Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -42,10 +42,10 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgements: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * This product includes software developed at the Information - * Technology Division, US Naval Research Laboratory. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * This product includes software developed at the Information + * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -161,7 +161,7 @@ tcp_usrreq(so, req, m, nam, control, p) * a (struct inpcb) pointed at by the socket, and this * structure will point at a subsidiary (struct tcpcb). */ - if (inp == 0 && req != PRU_ATTACH) { + if (inp == NULL && req != PRU_ATTACH) { error = so->so_error; if (error == 0) error = EINVAL; @@ -297,7 +297,7 @@ tcp_usrreq(so, req, m, nam, control, p) } so->so_state |= SS_CONNECTOUT; - + /* Compute window scaling to request. */ tcp_rscale(tp, sb_max); @@ -805,7 +805,7 @@ tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop) break; #endif case AF_INET: - fin = (struct sockaddr_in *)&tir.faddr; + fin = (struct sockaddr_in *)&tir.faddr; lin = (struct sockaddr_in *)&tir.laddr; break; default: @@ -846,7 +846,7 @@ tcp_ident(void *oldp, size_t *oldlenp, void *newp, size_t newlen, int dodrop) break; #endif case AF_INET: - inp = in_pcblookup_listen(&tcbtable, + inp = in_pcblookup_listen(&tcbtable, lin->sin_addr, lin->sin_port, 0, NULL, tir.rdomain); break; } -- 2.20.1