diff options
author | phk <phk@FreeBSD.org> | 1994-10-02 17:48:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1994-10-02 17:48:58 +0000 |
commit | f3c1ed23270f2db1e6c2456439dd12b7b68e8bde (patch) | |
tree | c117ab448d9316a116c92751ddc54084d53fb88a /sys/netinet | |
parent | 451659421c6fd9cc8d83d27e51ae1ba317522182 (diff) | |
download | FreeBSD-src-f3c1ed23270f2db1e6c2456439dd12b7b68e8bde.zip FreeBSD-src-f3c1ed23270f2db1e6c2456439dd12b7b68e8bde.tar.gz |
GCC cleanup.
Reviewed by:
Submitted by:
Obtained from:
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 5 | ||||
-rw-r--r-- | sys/netinet/in.c | 8 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.c | 20 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 9 | ||||
-rw-r--r-- | sys/netinet/ip_mroute.c | 13 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 13 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 11 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 11 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 4 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 5 |
11 files changed, 55 insertions, 48 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 717814d..56b1b7c 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.c,v 1.3 1994/08/18 22:35:26 wollman Exp $ + * $Id: if_ether.c,v 1.4 1994/10/01 21:50:33 wollman Exp $ */ /* @@ -310,7 +310,8 @@ arpresolve(ac, rt, m, dst, desten) if (rt) la = (struct llinfo_arp *)rt->rt_llinfo; else { - if (la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0)) + la = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0); + if (la) rt = la->la_rt; } if (la == 0 || rt == 0) { diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 57a0bb3..b1c0aa2 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)in.c 8.2 (Berkeley) 11/15/93 - * $Id: in.c,v 1.4 1994/08/18 22:35:28 wollman Exp $ + * $Id: in.c,v 1.5 1994/09/16 05:47:06 phk Exp $ */ #include <sys/param.h> @@ -213,14 +213,16 @@ in_control(so, cmd, data, ifp) if (oia == (struct in_ifaddr *)NULL) return (ENOBUFS); bzero((caddr_t)oia, sizeof *oia); - if (ia = in_ifaddr) { + ia = in_ifaddr; + if (ia) { for ( ; ia->ia_next; ia = ia->ia_next) continue; ia->ia_next = oia; } else in_ifaddr = oia; ia = oia; - if (ifa = ifp->if_addrlist) { + ifa = ifp->if_addrlist; + if (ifa) { for ( ; ifa->ifa_next; ifa = ifa->ifa_next) continue; ifa->ifa_next = (struct ifaddr *) ia; diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 1b7f80a..d26c6a1 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 - * $Id$ + * $Id: ip_icmp.c,v 1.2 1994/08/02 07:48:32 davidg Exp $ */ #include <sys/param.h> @@ -85,7 +85,7 @@ icmp_error(n, type, code, dest, destifp) #ifdef ICMPPRINTFS if (icmpprintfs) - printf("icmp_error(%x, %d, %d)\n", oip, type, code); + printf("icmp_error(%p, %x, %d)\n", oip, type, code); #endif if (type != ICMP_REDIRECT) icmpstat.icps_error++; @@ -191,7 +191,7 @@ icmp_input(m, hlen) */ #ifdef ICMPPRINTFS if (icmpprintfs) - printf("icmp_input from %x to %x, len %d\n", + printf("icmp_input from %lx to %lx, len %d\n", ntohl(ip->ip_src.s_addr), ntohl(ip->ip_dst.s_addr), icmplen); #endif @@ -292,7 +292,8 @@ icmp_input(m, hlen) printf("deliver to protocol %d\n", icp->icmp_ip.ip_p); #endif icmpsrc.sin_addr = icp->icmp_ip.ip_dst; - if (ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput) + ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput; + if (ctlfunc) (*ctlfunc)(code, (struct sockaddr *)&icmpsrc, &icp->icmp_ip); break; @@ -373,8 +374,9 @@ reflect: icmpdst.sin_addr = icp->icmp_gwaddr; #ifdef ICMPPRINTFS if (icmpprintfs) - printf("redirect dst %x to %x\n", icp->icmp_ip.ip_dst, - icp->icmp_gwaddr); + printf("redirect dst %lx to %lx\n", + NTOHL(icp->icmp_ip.ip_dst.s_addr), + NTOHL(icp->icmp_gwaddr.s_addr)); #endif icmpsrc.sin_addr = icp->icmp_ip.ip_dst; rtredirect((struct sockaddr *)&icmpsrc, @@ -497,7 +499,8 @@ icmp_reflect(m) } } /* Terminate & pad, if necessary */ - if (cnt = opts->m_len % 4) { + cnt = opts->m_len % 4; + if (cnt) { for (; cnt < 4; cnt++) { *(mtod(opts, caddr_t) + opts->m_len) = IPOPT_EOL; @@ -552,7 +555,8 @@ icmp_send(m, opts) m->m_len += hlen; #ifdef ICMPPRINTFS if (icmpprintfs) - printf("icmp_send dst %x src %x\n", ip->ip_dst, ip->ip_src); + printf("icmp_send dst %lx src %lx\n", + NTOHL(ip->ip_dst.s_addr), NTOHL(ip->ip_src.s_addr)); #endif (void) ip_output(m, opts, NULL, 0, NULL); } diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 85fa95c..deba74a 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_input.c,v 1.5 1994/09/06 22:42:21 wollman Exp $ + * $Id: ip_input.c,v 1.6 1994/09/14 03:10:09 wollman Exp $ */ #include <sys/param.h> @@ -196,7 +196,8 @@ next: } ip = mtod(m, struct ip *); } - if (ip->ip_sum = in_cksum(m, hlen)) { + ip->ip_sum = in_cksum(m, hlen); + if (ip->ip_sum) { ipstat.ips_badsum++; goto bad; } @@ -1018,8 +1019,8 @@ ip_forward(m, srcrt) dest = 0; #ifdef DIAGNOSTIC if (ipprintfs) - printf("forward: src %x dst %x ttl %x\n", ip->ip_src, - ip->ip_dst, ip->ip_ttl); + printf("forward: src %x dst %x ttl %x\n", + ip->ip_src.s_addr, ip->ip_dst.s_addr, ip->ip_ttl); #endif if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) { ipstat.ips_cantforward++; diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index b6a97fa..345e4b8 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -510,7 +510,8 @@ X_ip_mrouter_done() while (mb_rt) { if ( mb_rt->m_act != NULL) { untimeout(cleanup_cache, (caddr_t)mb_rt); - while (m = mb_rt->m_act) { + while (mb_rt->m_act) { + m = mb_rt->m_act; mb_rt->m_act = m->m_act; rte = mtod(m, struct rtdetq *); m_freem(rte->m); @@ -695,7 +696,7 @@ add_mfc(mfccp) struct mfcctl *mfccp; { struct mfc *rt; - struct mfc *rt1; + struct mfc *rt1 = 0; register struct mbuf *mb_rt; struct mbuf *prev_mb_rt; u_long hash; @@ -857,7 +858,7 @@ del_mfc(mfccp) u_long hash; struct mfc **cmfc; struct mfc **cmfcend; - int s, i; + int s; origin = mfccp->mfcc_origin; mcastgrp = mfccp->mfcc_mcastgrp; @@ -920,14 +921,12 @@ X_ip_mforward(ip, ifp, m, imo) struct ip_moptions *imo; { register struct mfc *rt; - register struct vif *vifp; register u_char *ipoptions; u_long tunnel_src; static struct sockproto k_igmpproto = { AF_INET, IPPROTO_IGMP }; static struct sockaddr_in k_igmpsrc = { AF_INET }; static struct sockaddr_in k_igmpdst = { AF_INET }; register struct mbuf *mm; - register struct mbuf *mn; register struct ip *k_data; int s; @@ -1025,7 +1024,6 @@ X_ip_mforward(ip, ifp, m, imo) register struct rtdetq *rte; register struct mbuf *rte_m; register u_long hash; - register struct timeval tp; mrtstat.mrts_no_route++; if (mrtdebug) @@ -1293,7 +1291,6 @@ phyint_send(ip, vifp, m) struct mbuf *m; { register struct mbuf *mb_copy; - register struct mbuf *mopts; register struct ip_moptions *imo; if ((mb_copy = m_copy(m, 0, M_COPYALL)) == NULL) @@ -1619,7 +1616,6 @@ void tbf_process_q(vifp) register struct vif *vifp; { - register struct mbuf *m; register struct pkt_queue pkt_1; register int index = (vifp - viftable); register int s = splnet(); @@ -1729,7 +1725,6 @@ tbf_send_packet(vifp, m, imo) register struct mbuf *m; struct ip_moptions *imo; { - register struct mbuf *mcp; int error; int s = splnet(); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index fee9fb1..13ab25c 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 - * $Id: raw_ip.c,v 1.3 1994/09/06 22:42:26 wollman Exp $ + * $Id: raw_ip.c,v 1.4 1994/09/14 03:10:15 wollman Exp $ */ #include <sys/param.h> @@ -100,10 +100,11 @@ rip_input(m) inp->inp_faddr.s_addr == ip->ip_src.s_addr) continue; if (last) { - struct mbuf *n; - if (n = m_copy(m, 0, (int)M_COPYALL)) { - if (sbappendaddr(&last->so_rcv, &ripsrc, - n, (struct mbuf *)0) == 0) + struct mbuf *n = m_copy(m, 0, (int)M_COPYALL); + if (n) { + if (sbappendaddr(&last->so_rcv, + (struct sockaddr *)&ripsrc, n, + (struct mbuf *)0) == 0) /* should notify about lost packet */ m_freem(n); else @@ -113,7 +114,7 @@ rip_input(m) last = inp->inp_socket; } if (last) { - if (sbappendaddr(&last->so_rcv, &ripsrc, + if (sbappendaddr(&last->so_rcv, (struct sockaddr *)&ripsrc, m, (struct mbuf *)0) == 0) m_freem(m); else diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index c6f3e20..b522006 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.7 1994/08/26 22:27:16 wollman Exp $ + * $Id: tcp_input.c,v 1.8 1994/09/15 10:36:54 davidg Exp $ */ #ifndef TUBA_INCLUDE @@ -258,7 +258,8 @@ tcp_input(m, iphlen) ti->ti_x1 = 0; ti->ti_len = (u_short)tlen; HTONS(ti->ti_len); - if (ti->ti_sum = in_cksum(m, len)) { + ti->ti_sum = in_cksum(m, len); + if (ti->ti_sum) { tcpstat.tcps_rcvbadsum++; goto drop; } @@ -1128,9 +1129,9 @@ step6: * Don't look at window if no ACK: TAC's send garbage on first SYN. */ if ((tiflags & TH_ACK) && - (SEQ_LT(tp->snd_wl1, ti->ti_seq) || tp->snd_wl1 == ti->ti_seq && - (SEQ_LT(tp->snd_wl2, ti->ti_ack) || - tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))) { + (SEQ_LT(tp->snd_wl1, ti->ti_seq) || + (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) || + (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) { /* keep track of pure window updates */ if (ti->ti_len == 0 && tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd) diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index c6f3e20..b522006 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.7 1994/08/26 22:27:16 wollman Exp $ + * $Id: tcp_input.c,v 1.8 1994/09/15 10:36:54 davidg Exp $ */ #ifndef TUBA_INCLUDE @@ -258,7 +258,8 @@ tcp_input(m, iphlen) ti->ti_x1 = 0; ti->ti_len = (u_short)tlen; HTONS(ti->ti_len); - if (ti->ti_sum = in_cksum(m, len)) { + ti->ti_sum = in_cksum(m, len); + if (ti->ti_sum) { tcpstat.tcps_rcvbadsum++; goto drop; } @@ -1128,9 +1129,9 @@ step6: * Don't look at window if no ACK: TAC's send garbage on first SYN. */ if ((tiflags & TH_ACK) && - (SEQ_LT(tp->snd_wl1, ti->ti_seq) || tp->snd_wl1 == ti->ti_seq && - (SEQ_LT(tp->snd_wl2, ti->ti_ack) || - tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))) { + (SEQ_LT(tp->snd_wl1, ti->ti_seq) || + (tp->snd_wl1 == ti->ti_seq && (SEQ_LT(tp->snd_wl2, ti->ti_ack) || + (tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd))))) { /* keep track of pure window updates */ if (ti->ti_len == 0 && tp->snd_wl2 == ti->ti_ack && tiwin > tp->snd_wnd) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index b0fd7a5..0e01df8 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tcp_subr.c,v 1.3 1994/08/02 07:49:08 davidg Exp $ */ #include <sys/param.h> @@ -327,7 +327,7 @@ tcp_close(tp) * and bad news. */ if ((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 && - (i = tp->snd_ssthresh) && rt->rt_rmx.rmx_ssthresh || + ((i = tp->snd_ssthresh)) && rt->rt_rmx.rmx_ssthresh || i < (rt->rt_rmx.rmx_sendpipe / 2)) { /* * convert the limit from user data bytes to diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index b0fd7a5..0e01df8 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_subr.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: tcp_subr.c,v 1.3 1994/08/02 07:49:08 davidg Exp $ */ #include <sys/param.h> @@ -327,7 +327,7 @@ tcp_close(tp) * and bad news. */ if ((rt->rt_rmx.rmx_locks & RTV_SSTHRESH) == 0 && - (i = tp->snd_ssthresh) && rt->rt_rmx.rmx_ssthresh || + ((i = tp->snd_ssthresh)) && rt->rt_rmx.rmx_ssthresh || i < (rt->rt_rmx.rmx_sendpipe / 2)) { /* * convert the limit from user data bytes to diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index fbd83ae..8d70484 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)udp_usrreq.c 8.4 (Berkeley) 1/21/94 - * $Id$ + * $Id: udp_usrreq.c,v 1.3 1994/08/02 07:49:24 davidg Exp $ */ #include <sys/param.h> @@ -144,7 +144,8 @@ udp_input(m, iphlen) ((struct ipovly *)ip)->ih_prev = 0; ((struct ipovly *)ip)->ih_x1 = 0; ((struct ipovly *)ip)->ih_len = uh->uh_ulen; - if (uh->uh_sum = in_cksum(m, len + sizeof (struct ip))) { + uh->uh_sum = in_cksum(m, len + sizeof (struct ip)); + if (uh->uh_sum) { udpstat.udps_badsum++; m_freem(m); return; |