diff --git a/sys/net/radix.c b/sys/net/radix.c index 29fd378e3560..4f366161f7af 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)radix.c 8.2 (Berkeley) 1/4/94 - * $Id$ + * $Id: radix.c,v 1.3 1994/08/02 07:46:29 davidg Exp $ */ /* @@ -208,13 +208,14 @@ rn_match(v_arg, head) return t; cp = matched_off + v; } - } while (t = t->rn_dupedkey); + } while ((t = t->rn_dupedkey) != 0); t = saved_t; /* start searching up the tree */ do { register struct radix_mask *m; t = t->rn_p; - if (m = t->rn_mklist) { + m = t->rn_mklist; + if (m) { /* * After doing measurements here, it may * turn out to be faster to open code @@ -235,7 +236,7 @@ rn_match(v_arg, head) (Bcmp(mstart, x->rn_key + off, vlen - off) == 0)) return x; - } while (m = m->rm_mklist); + } while ((m = m->rm_mklist) != 0); } } while (t != top); return 0; @@ -421,7 +422,7 @@ rn_addroute(v_arg, n_arg, head, treenodes) if (netmask == 0 || (tt->rn_mask && rn_refines(netmask, tt->rn_mask))) break; - } while (tt = tt->rn_dupedkey); + } while ((tt = tt->rn_dupedkey) != 0); /* * If the mask is not duplicated, we wouldn't * find it among possible duplicate key entries @@ -478,7 +479,7 @@ rn_addroute(v_arg, n_arg, head, treenodes) /* * Skip over masks whose index is > that of new node */ - for (mp = &x->rn_mklist; m = *mp; mp = &m->rm_mklist) + for (mp = &x->rn_mklist; (m = *mp) != 0; mp = &m->rm_mklist) if (m->rm_b >= b_leaf) break; t->rn_mklist = m; *mp = 0; @@ -498,7 +499,7 @@ rn_addroute(v_arg, n_arg, head, treenodes) * masks first. */ cplim = netmask + mlen; - for (mp = &x->rn_mklist; m = *mp; mp = &m->rm_mklist) { + for (mp = &x->rn_mklist; (m = *mp) != 0; mp = &m->rm_mklist) { if (m->rm_b < b_leaf) continue; if (m->rm_b > b_leaf) @@ -550,7 +551,8 @@ rn_delete(v_arg, netmask_arg, head) /* * Delete our route from mask lists. */ - if (dupedkey = tt->rn_dupedkey) { + dupedkey = tt->rn_dupedkey; + if (dupedkey) { if (netmask) netmask = rn_search(netmask, rn_masktop)->rn_key; while (tt->rn_mask != netmask) @@ -573,7 +575,7 @@ rn_delete(v_arg, netmask_arg, head) x = t; t = t->rn_p; } while (b <= t->rn_b && x != top); - for (mp = &x->rn_mklist; m = *mp; mp = &m->rm_mklist) + for (mp = &x->rn_mklist; (m = *mp) != 0; mp = &m->rm_mklist) if (m == saved_m) { *mp = m->rm_mklist; MKFree(m); @@ -624,7 +626,7 @@ rn_delete(v_arg, netmask_arg, head) */ if (t->rn_mklist) { if (x->rn_b >= 0) { - for (mp = &x->rn_mklist; m = *mp;) + for (mp = &x->rn_mklist; (m = *mp) != 0;) mp = &m->rm_mklist; *mp = t->rn_mklist; } else { @@ -634,7 +636,7 @@ rn_delete(v_arg, netmask_arg, head) x->rn_mklist = 0; MKFree(m); } else - printf("%s %x at %x\n", + printf("%s %p at %p\n", "rn_delete: Orphaned Mask", m, x); m = mm; } @@ -687,7 +689,7 @@ rn_walktree(h, f, w) rn = rn->rn_l; next = rn; /* Process leaves */ - while (rn = base) { + while ((rn = base) != 0) { base = rn->rn_dupedkey; if (!(rn->rn_flags & RNF_ROOT) && (error = (*f)(rn, w))) return (error); diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c index f710eedc9bb7..05723785accc 100644 --- a/sys/net/raw_cb.c +++ b/sys/net/raw_cb.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_cb.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: raw_cb.c,v 1.2 1994/08/02 07:46:34 davidg Exp $ */ #include @@ -79,7 +79,8 @@ raw_attach(so, proto) */ if (rp == 0) return (ENOBUFS); - if (error = soreserve(so, raw_sendspace, raw_recvspace)) + error = soreserve(so, raw_sendspace, raw_recvspace); + if (error) return (error); rp->rcb_socket = so; rp->rcb_proto.sp_family = so->so_proto->pr_domain->dom_family; diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index f52ea56ccd6f..f6bc1cb4e5ac 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_usrreq.c 8.1 (Berkeley) 6/10/93 - * $Id: raw_usrreq.c,v 1.2 1994/08/02 07:46:38 davidg Exp $ + * $Id: raw_usrreq.c,v 1.3 1994/08/18 22:35:21 wollman Exp $ */ #include @@ -101,7 +101,8 @@ raw_input(m0, proto, src, dst) continue; if (last) { struct mbuf *n; - if (n = m_copy(m, 0, (int)M_COPYALL)) { + n = m_copy(m, 0, (int)M_COPYALL); + if (n) { if (sbappendaddr(&last->so_rcv, src, n, (struct mbuf *)0) == 0) /* should notify about lost packet */ diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 5653471b8ce5..3341a42c4310 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)rtsock.c 8.3 (Berkeley) 1/4/94 - * $Id: rtsock.c,v 1.4 1994/10/04 06:49:53 phk Exp $ + * $Id: rtsock.c,v 1.5 1994/10/05 20:11:28 wollman Exp $ */ #include @@ -84,7 +84,8 @@ route_usrreq(so, req, m, nam, control) if (req == PRU_ATTACH) { MALLOC(rp, struct rawcb *, sizeof(*rp), M_PCB, M_WAITOK); - if (so->so_pcb = (caddr_t)rp) + so->so_pcb = (caddr_t)rp; + if (so->so_pcb) bzero(so->so_pcb, sizeof(*rp)); } @@ -222,7 +223,8 @@ route_output(m, so) netmask = rt_mask(rt); genmask = rt->rt_genmask; if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) { - if (ifp = rt->rt_ifp) { + ifp = rt->rt_ifp; + if (ifp) { ifpaddr = ifp->if_addrlist->ifa_addr; ifaaddr = rt->rt_ifa->ifa_addr; rtm->rtm_index = ifp->if_index; @@ -451,7 +453,8 @@ rt_msg2(type, rtinfo, cp, w) default: len = sizeof(struct rt_msghdr); } - if (cp0 = cp) + cp0 = cp; + if (cp0) cp += len; for (i = 0; i < RTAX_MAX; i++) { register struct sockaddr *sa; @@ -474,8 +477,9 @@ rt_msg2(type, rtinfo, cp, w) if (rw->w_tmemsize < len) { if (rw->w_tmem) free(rw->w_tmem, M_RTABLE); - if (rw->w_tmem = (caddr_t) - malloc(len, M_RTABLE, M_NOWAIT)) + rw->w_tmem = (caddr_t) + malloc(len, M_RTABLE, M_NOWAIT); + if (rw->w_tmem) rw->w_tmemsize = len; } if (rw->w_tmem) { @@ -643,7 +647,8 @@ sysctl_dumpentry(rn, w) rtm->rtm_index = rt->rt_ifp->if_index; rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0; rtm->rtm_addrs = info.rti_addrs; - if (error = copyout((caddr_t)rtm, w->w_where, size)) + error = copyout((caddr_t)rtm, w->w_where, size); + if (error) w->w_where = NULL; else w->w_where += size; @@ -677,11 +682,12 @@ sysctl_iflist(af, w) ifm->ifm_flags = (u_short)ifp->if_flags; ifm->ifm_data = ifp->if_data; ifm->ifm_addrs = info.rti_addrs; - if (error = copyout((caddr_t)ifm, w->w_where, len)) + error = copyout((caddr_t)ifm, w->w_where, len); + if (error) return (error); w->w_where += len; } - while (ifa = ifa->ifa_next) { + while ((ifa = ifa->ifa_next) != 0) { if (af && af != ifa->ifa_addr->sa_family) continue; ifaaddr = ifa->ifa_addr; @@ -696,7 +702,8 @@ sysctl_iflist(af, w) ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_metric = ifa->ifa_metric; ifam->ifam_addrs = info.rti_addrs; - if (error = copyout(w->w_tmem, w->w_where, len)) + error = copyout(w->w_tmem, w->w_where, len); + if (error) return (error); w->w_where += len; } diff --git a/sys/net/slcompress.c b/sys/net/slcompress.c index bebeeab2acef..42106d5cac35 100644 --- a/sys/net/slcompress.c +++ b/sys/net/slcompress.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)slcompress.c 8.2 (Berkeley) 4/16/94 - * $Id: slcompress.c,v 1.2 1994/08/02 07:46:46 davidg Exp $ + * $Id: slcompress.c,v 1.3 1994/08/18 22:35:22 wollman Exp $ */ /* @@ -272,19 +272,22 @@ sl_compress_tcp(m, ip, comp, compress_cid) * with it. */ goto uncompressed; - if (deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win))) { + deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win)); + if (deltaS) { ENCODE(deltaS); changes |= NEW_W; } - if (deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack)) { + deltaA = ntohl(th->th_ack) - ntohl(oth->th_ack); + if (deltaA) { if (deltaA > 0xffff) goto uncompressed; ENCODE(deltaA); changes |= NEW_A; } - if (deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq)) { + deltaS = ntohl(th->th_seq) - ntohl(oth->th_seq); + if (deltaS) { if (deltaS > 0xffff) goto uncompressed; ENCODE(deltaS);