lint
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 28 May 1983 04:46:41 +0000 (20:46 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 28 May 1983 04:46:41 +0000 (20:46 -0800)
SCCS-vsn: sys/netinet/if_ether.c 4.2
SCCS-vsn: sys/netinet/ip_icmp.c 4.32
SCCS-vsn: sys/netinet/tcp_timer.c 4.32
SCCS-vsn: sys/netinet/tcp_output.c 4.55

usr/src/sys/netinet/if_ether.c
usr/src/sys/netinet/ip_icmp.c
usr/src/sys/netinet/tcp_output.c
usr/src/sys/netinet/tcp_timer.c

index 3c5bd35..653f9ab 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_ether.c      4.1     83/03/15        */
+/*     if_ether.c      4.2     83/05/27        */
 
 /*
  * Ethernet address resolution protocol.
 
 /*
  * Ethernet address resolution protocol.
@@ -10,6 +10,7 @@
 #include "../h/socket.h"
 #include "../h/time.h"
 #include "../h/kernel.h"
 #include "../h/socket.h"
 #include "../h/time.h"
 #include "../h/kernel.h"
+#include "../h/errno.h"
 
 #include "../net/if.h"
 #include "../netinet/in.h"
 
 #include "../net/if.h"
 #include "../netinet/in.h"
@@ -84,13 +85,14 @@ arpattach(ac)
  */
 arptimer()
 {
  */
 arptimer()
 {
-       register struct arpcom *ac;
        register struct arptab *at;
        register i;
 
        register struct arptab *at;
        register i;
 
-       timeout(arptimer, 0, hz);
+       timeout(arptimer, (caddr_t)0, hz);
 #ifdef notdef
        if (++arpt_sanity > ARPT_SANITY) {
 #ifdef notdef
        if (++arpt_sanity > ARPT_SANITY) {
+               register struct arpcom *ac;
+
                /*
                 * Randomize sanity timer based on my host address.
                 * Ask who has my own address;  if someone else replies,
                /*
                 * Randomize sanity timer based on my host address.
                 * Ask who has my own address;  if someone else replies,
@@ -130,23 +132,25 @@ arpwhohas(ac, addr)
        struct sockaddr sa;
 
        if ((m = m_get(M_DONTWAIT, MT_DATA)) == NULL)
        struct sockaddr sa;
 
        if ((m = m_get(M_DONTWAIT, MT_DATA)) == NULL)
-               return (1);
+               return (ENOBUFS);
        m->m_len = sizeof *ea + sizeof *eh;
        m->m_off = MMAXOFF - m->m_len;
        ea = mtod(m, struct ether_arp *);
        eh = (struct ether_header *)sa.sa_data;
        m->m_len = sizeof *ea + sizeof *eh;
        m->m_off = MMAXOFF - m->m_len;
        ea = mtod(m, struct ether_arp *);
        eh = (struct ether_header *)sa.sa_data;
-       bzero((caddr_t)ea, sizeof *ea);
-       bcopy(etherbroadcastaddr, eh->ether_dhost, sizeof etherbroadcastaddr);
+       bzero((caddr_t)ea, sizeof (*ea));
+       bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
+          sizeof (etherbroadcastaddr));
        eh->ether_type = ETHERPUP_ARPTYPE;      /* if_output will swap */
        ea->arp_hrd = htons(ARPHRD_ETHER);
        ea->arp_pro = htons(ETHERPUP_IPTYPE);
        ea->arp_hln = sizeof ea->arp_sha;       /* hardware address length */
        ea->arp_pln = sizeof ea->arp_spa;       /* protocol address length */
        ea->arp_op = htons(ARPOP_REQUEST);
        eh->ether_type = ETHERPUP_ARPTYPE;      /* if_output will swap */
        ea->arp_hrd = htons(ARPHRD_ETHER);
        ea->arp_pro = htons(ETHERPUP_IPTYPE);
        ea->arp_hln = sizeof ea->arp_sha;       /* hardware address length */
        ea->arp_pln = sizeof ea->arp_spa;       /* protocol address length */
        ea->arp_op = htons(ARPOP_REQUEST);
-       bcopy(ac->ac_enaddr, ea->arp_sha, sizeof ea->arp_sha);
+       bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->arp_sha,
+          sizeof (ea->arp_sha));
        bcopy((caddr_t)&((struct sockaddr_in *)&ac->ac_if.if_addr)->sin_addr,
        bcopy((caddr_t)&((struct sockaddr_in *)&ac->ac_if.if_addr)->sin_addr,
-           ea->arp_spa, sizeof ea->arp_spa);
-       bcopy((caddr_t)addr, ea->arp_tpa, sizeof ea->arp_tpa);
+          (caddr_t)ea->arp_spa, sizeof (ea->arp_spa));
+       bcopy((caddr_t)addr, (caddr_t)ea->arp_tpa, sizeof (ea->arp_tpa));
        sa.sa_family = AF_UNSPEC;
        return ((*ac->ac_if.if_output)(&ac->ac_if, m, &sa));
 }
        sa.sa_family = AF_UNSPEC;
        return ((*ac->ac_if.if_output)(&ac->ac_if, m, &sa));
 }
@@ -169,25 +173,24 @@ arpresolve(ac, m, destip, desten)
        register u_char *desten;
 {
        register struct arptab *at;
        register u_char *desten;
 {
        register struct arptab *at;
-       register i;
        struct sockaddr_in sin;
        int s, lna;
 
        lna = in_lnaof(*destip);
        if (lna == INADDR_ANY) {        /* broadcast address */
        struct sockaddr_in sin;
        int s, lna;
 
        lna = in_lnaof(*destip);
        if (lna == INADDR_ANY) {        /* broadcast address */
-               bcopy(etherbroadcastaddr, desten, sizeof etherbroadcastaddr);
+               bcopy((caddr_t)etherbroadcastaddr, (caddr_t)desten,
+                  sizeof (etherbroadcastaddr));
                return (1);
        }
        if (destip->s_addr == ((struct sockaddr_in *)&ac->ac_if.if_addr)->
            sin_addr.s_addr) {                  /* if for us, use lo driver */
                sin.sin_family = AF_INET;
                sin.sin_addr = *destip;
                return (1);
        }
        if (destip->s_addr == ((struct sockaddr_in *)&ac->ac_if.if_addr)->
            sin_addr.s_addr) {                  /* if for us, use lo driver */
                sin.sin_family = AF_INET;
                sin.sin_addr = *destip;
-               looutput(&loif, m, &sin);
-               return (0);
+               return (looutput(&loif, m, (struct sockaddr *)&sin));
        }
 #ifdef OLDMAP
        if (lna >= 1024) {
        }
 #ifdef OLDMAP
        if (lna >= 1024) {
-               bcopy(ac->ac_enaddr, desten, 3);
+               bcopy((caddr_t)ac->ac_enaddr, (caddr_t)desten, 3);
                desten[3] = (lna >> 16) & 0x7f;
                desten[4] = (lna >> 8) & 0xff;
                desten[5] = lna & 0xff;
                desten[3] = (lna >> 16) & 0x7f;
                desten[4] = (lna >> 8) & 0xff;
                desten[5] = lna & 0xff;
@@ -205,7 +208,7 @@ arpresolve(ac, m, destip, desten)
        }
        at->at_timer = 0;               /* restart the timer */
        if (at->at_flags & ATF_COM) {   /* entry IS complete */
        }
        at->at_timer = 0;               /* restart the timer */
        if (at->at_flags & ATF_COM) {   /* entry IS complete */
-               bcopy(at->at_enaddr, desten, 6);
+               bcopy((caddr_t)at->at_enaddr, (caddr_t)desten, 6);
                splx(s);
                return (1);
        }
                splx(s);
                return (1);
        }
@@ -230,6 +233,7 @@ arpresolve(ac, m, destip, desten)
  * Unimplemented at present, return 0 and assume that the host
  * will set his own IP address via the SIOCSIFADDR ioctl.
  */
  * Unimplemented at present, return 0 and assume that the host
  * will set his own IP address via the SIOCSIFADDR ioctl.
  */
+/*ARGSUSED*/
 struct in_addr
 arpmyaddr(ac)
        register struct arpcom *ac;
 struct in_addr
 arpmyaddr(ac)
        register struct arpcom *ac;
@@ -266,7 +270,8 @@ arpinput(ac, m)
                goto out;
        isaddr.s_addr = ((struct in_addr *)ea->arp_spa)->s_addr;
        itaddr.s_addr = ((struct in_addr *)ea->arp_tpa)->s_addr;
                goto out;
        isaddr.s_addr = ((struct in_addr *)ea->arp_spa)->s_addr;
        itaddr.s_addr = ((struct in_addr *)ea->arp_tpa)->s_addr;
-       if (!bcmp(ea->arp_sha, ac->ac_enaddr, sizeof ac->ac_enaddr))
+       if (!bcmp((caddr_t)ea->arp_sha, (caddr_t)ac->ac_enaddr,
+         sizeof (ac->ac_enaddr)))
                goto out;       /* it's from me, ignore it. */
        if (isaddr.s_addr == myaddr.s_addr) {
                printf("duplicate IP address!! sent from ethernet address: ");
                goto out;       /* it's from me, ignore it. */
        if (isaddr.s_addr == myaddr.s_addr) {
                printf("duplicate IP address!! sent from ethernet address: ");
@@ -279,7 +284,8 @@ arpinput(ac, m)
        }
        ARPTAB_LOOK(at, isaddr.s_addr);
        if (at) {
        }
        ARPTAB_LOOK(at, isaddr.s_addr);
        if (at) {
-               bcopy(ea->arp_sha, at->at_enaddr, sizeof ea->arp_sha);
+               bcopy((caddr_t)ea->arp_sha, (caddr_t)at->at_enaddr,
+                  sizeof (ea->arp_sha));
                at->at_flags |= ATF_COM;
                if (at->at_hold) {
                        mhold = at->at_hold;
                at->at_flags |= ATF_COM;
                if (at->at_hold) {
                        mhold = at->at_hold;
@@ -294,19 +300,25 @@ arpinput(ac, m)
                goto out;       /* if I am not the target */
        if (at == 0) {          /* ensure we have a table entry */
                at = arptnew(&isaddr);
                goto out;       /* if I am not the target */
        if (at == 0) {          /* ensure we have a table entry */
                at = arptnew(&isaddr);
-               bcopy(ea->arp_sha, at->at_enaddr, sizeof ea->arp_sha);
+               bcopy((caddr_t)ea->arp_sha, (caddr_t)at->at_enaddr,
+                  sizeof (ea->arp_sha));
                at->at_flags |= ATF_COM;
        }
        if (ntohs(ea->arp_op) != ARPOP_REQUEST)
                goto out;
 reply:
                at->at_flags |= ATF_COM;
        }
        if (ntohs(ea->arp_op) != ARPOP_REQUEST)
                goto out;
 reply:
-       bcopy(ea->arp_sha, ea->arp_tha, sizeof ea->arp_sha);
-       bcopy(ea->arp_spa, ea->arp_tpa, sizeof ea->arp_spa);
-       bcopy(ac->ac_enaddr, ea->arp_sha, sizeof ea->arp_sha);
-       bcopy((caddr_t)&myaddr, ea->arp_spa, sizeof ea->arp_spa);
+       bcopy((caddr_t)ea->arp_sha, (caddr_t)ea->arp_tha,
+          sizeof (ea->arp_sha));
+       bcopy((caddr_t)ea->arp_spa, (caddr_t)ea->arp_tpa,
+          sizeof (ea->arp_spa));
+       bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->arp_sha,
+          sizeof (ea->arp_sha));
+       bcopy((caddr_t)&myaddr, (caddr_t)ea->arp_spa,
+          sizeof (ea->arp_spa));
        ea->arp_op = htons(ARPOP_REPLY);
        eh = (struct ether_header *)sa.sa_data;
        ea->arp_op = htons(ARPOP_REPLY);
        eh = (struct ether_header *)sa.sa_data;
-       bcopy(ea->arp_tha, eh->ether_dhost, sizeof eh->ether_dhost);
+       bcopy((caddr_t)ea->arp_tha, (caddr_t)eh->ether_dhost,
+          sizeof (eh->ether_dhost));
        eh->ether_type = ETHERPUP_ARPTYPE;
        sa.sa_family = AF_UNSPEC;
        (*ac->ac_if.if_output)(&ac->ac_if, m, &sa);
        eh->ether_type = ETHERPUP_ARPTYPE;
        sa.sa_family = AF_UNSPEC;
        (*ac->ac_if.if_output)(&ac->ac_if, m, &sa);
index 5f46b42..54c144c 100644 (file)
@@ -1,4 +1,4 @@
-/*     ip_icmp.c       4.31    83/05/01        */
+/*     ip_icmp.c       4.32    83/05/27        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -29,7 +29,7 @@ int   icmpprintfs = 0;
  */
 icmp_error(oip, type, code)
        struct ip *oip;
  */
 icmp_error(oip, type, code)
        struct ip *oip;
-       u_int type, code;
+       int type, code;
 {
        register unsigned oiplen = oip->ip_hl << 2;
        register struct icmp *icp;
 {
        register unsigned oiplen = oip->ip_hl << 2;
        register struct icmp *icp;
@@ -62,7 +62,7 @@ icmp_error(oip, type, code)
        m->m_len = oiplen + 8 + ICMP_MINLEN;
        m->m_off = MMAXOFF - m->m_len;
        icp = mtod(m, struct icmp *);
        m->m_len = oiplen + 8 + ICMP_MINLEN;
        m->m_off = MMAXOFF - m->m_len;
        icp = mtod(m, struct icmp *);
-       if (type > ICMP_IREQREPLY)
+       if ((u_int)type > ICMP_IREQREPLY)
                panic("icmp_error");
        icmpstat.icps_outhist[type]++;
        icp->icmp_type = type;
                panic("icmp_error");
        icmpstat.icps_outhist[type]++;
        icp->icmp_type = type;
index ab8a9b9..c89935d 100644 (file)
@@ -1,4 +1,4 @@
-/*     tcp_output.c    4.54    83/05/12        */
+/*     tcp_output.c    4.55    83/05/27        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -293,7 +293,8 @@ noopt:
        ((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
        ((struct ip *)ti)->ip_ttl = TCP_TTL;
        if (so->so_options & SO_DONTROUTE)
        ((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
        ((struct ip *)ti)->ip_ttl = TCP_TTL;
        if (so->so_options & SO_DONTROUTE)
-               error = ip_output(m, tp->t_ipopt, 0, IP_ROUTETOIF);
+               error =
+                  ip_output(m, tp->t_ipopt, (struct route *)0, IP_ROUTETOIF);
        else
                error = ip_output(m, tp->t_ipopt, &tp->t_inpcb->inp_route, 0);
        if (error)
        else
                error = ip_output(m, tp->t_ipopt, &tp->t_inpcb->inp_route, 0);
        if (error)
index 1b4a0a8..430b21e 100644 (file)
@@ -1,4 +1,4 @@
-/*     tcp_timer.c     4.31    83/02/10        */
+/*     tcp_timer.c     4.32    83/05/27        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -74,8 +74,7 @@ tcp_slowtimo()
                        if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
                                (void) tcp_usrreq(tp->t_inpcb->inp_socket,
                                    PRU_SLOWTIMO, (struct mbuf *)0,
                        if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
                                (void) tcp_usrreq(tp->t_inpcb->inp_socket,
                                    PRU_SLOWTIMO, (struct mbuf *)0,
-                                   (struct mbuf *)i,
-                                   (struct socketopt *)0);
+                                   (struct mbuf *)i, (struct mbuf *)0);
                                if (ipnxt->inp_prev != ip)
                                        goto tpgone;
                        }
                                if (ipnxt->inp_prev != ip)
                                        goto tpgone;
                        }