GCC cleanup.

Reviewed by:
Submitted by:
Obtained from:
This commit is contained in:
Poul-Henning Kamp 1994-10-02 17:48:58 +00:00
parent 51b713ac2b
commit 623ae52e4e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3311
24 changed files with 156 additions and 148 deletions

View File

@ -35,7 +35,7 @@
*
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
*
* $Id: fdesc_vnops.c,v 1.4 1994/09/09 13:24:26 davidg Exp $
* $Id: fdesc_vnops.c,v 1.5 1994/09/21 03:46:56 wollman Exp $
*/
/*
@ -58,6 +58,7 @@
#include <sys/namei.h>
#include <sys/buf.h>
#include <sys/dirent.h>
#include <sys/socketvar.h>
#include <miscfs/fdesc/fdesc.h>
#define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL)

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94
* $Id: fifo_vnops.c,v 1.4 1994/09/21 03:46:57 wollman Exp $
* $Id: fifo_vnops.c,v 1.5 1994/09/22 19:38:07 wollman Exp $
*/
#include <sys/param.h>
@ -153,20 +153,23 @@ fifo_open(ap)
if ((fip = vp->v_fifoinfo) == NULL) {
MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK);
vp->v_fifoinfo = fip;
if (error = socreate(AF_UNIX, &rso, SOCK_STREAM, 0)) {
error = socreate(AF_UNIX, &rso, SOCK_STREAM, 0);
if (error) {
free(fip, M_VNODE);
vp->v_fifoinfo = NULL;
return (error);
}
fip->fi_readsock = rso;
if (error = socreate(AF_UNIX, &wso, SOCK_STREAM, 0)) {
error = socreate(AF_UNIX, &wso, SOCK_STREAM, 0);
if (error) {
(void)soclose(rso);
free(fip, M_VNODE);
vp->v_fifoinfo = NULL;
return (error);
}
fip->fi_writesock = wso;
if (error = unp_connect2(wso, rso)) {
error = unp_connect2(wso, rso);
if (error) {
(void)soclose(wso);
(void)soclose(rso);
free(fip, M_VNODE);
@ -247,8 +250,8 @@ fifo_read(ap)
rso->so_state |= SS_NBIO;
startresid = uio->uio_resid;
VOP_UNLOCK(ap->a_vp);
error = soreceive(rso, (struct mbuf **)0, uio, (int *)0,
(struct mbuf **)0, (struct mbuf **)0);
error = soreceive(rso, (struct mbuf **)0, uio,
(struct mbuf **)0, (struct mbuf **)0, (int*)0);
VOP_LOCK(ap->a_vp);
/*
* Clear EOF indication after first such return.
@ -418,6 +421,21 @@ fifo_close(ap)
return (error2);
}
/*
* Print out internal contents of a fifo vnode.
*/
int
fifo_printinfo(vp)
struct vnode *vp;
{
register struct fifoinfo *fip = vp->v_fifoinfo;
printf(", fifo with %ld readers and %ld writers",
fip->fi_readers, fip->fi_writers);
return (0);
}
/*
* Print out the contents of a fifo vnode.
*/
@ -434,20 +452,6 @@ fifo_print(ap)
return (0);
}
/*
* Print out internal contents of a fifo vnode.
*/
int
fifo_printinfo(vp)
struct vnode *vp;
{
register struct fifoinfo *fip = vp->v_fifoinfo;
printf(", fifo with %d readers and %d writers",
fip->fi_readers, fip->fi_writers);
return (0);
}
/*
* Return POSIX pathconf information applicable to fifo's.
*/

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_vfsops.c,v 1.3 1994/09/21 03:47:16 wollman Exp $ */
/* $Id: msdosfs_vfsops.c,v 1.4 1994/09/27 20:42:54 phk Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */
/*-
@ -230,7 +230,7 @@ msdosfs_mount(mp, path, data, ndp, p)
pmp->pm_mask = args.mask;
(void) msdosfs_statfs(mp, &mp->mnt_stat, p);
#ifdef MSDOSFS_DEBUG
printf("msdosfs_mount(): mp %x, pmp %x, inusemap %x\n", mp, pmp, pmp->pm_inusemap);
printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap);
#endif
return 0;
}
@ -515,19 +515,6 @@ msdosfs_unmount(mp, mntflags, p)
if (error)
return error;
pmp->pm_devvp->v_specflags &= ~SI_MOUNTEDON;
#ifdef MSDOSFS_DEBUG
printf("msdosfs_umount(): just before calling VOP_CLOSE()\n");
printf("flag %08x, usecount %d, writecount %d, holdcnt %d\n",
vp->v_flag, vp->v_usecount, vp->v_writecount, vp->v_holdcnt);
printf("lastr %d, id %d, mount %08x, op %08x\n",
vp->v_lastr, vp->v_id, vp->v_mount, vp->v_op);
printf("freef %08x, freeb %08x, mountf %08x, mountb %08x\n",
vp->v_freef, vp->v_freeb, vp->v_mountf, vp->v_mountb);
printf("cleanblkhd %08x, dirtyblkhd %08x, numoutput %d, type %d\n",
vp->v_cleanblkhd, vp->v_dirtyblkhd, vp->v_numoutput, vp->v_type);
printf("union %08x, tag %d, data[0] %08x, data[1] %08x\n",
vp->v_socket, vp->v_tag, vp->v_data[0], vp->v_data[1]);
#endif
error = VOP_CLOSE(pmp->pm_devvp, pmp->pm_ronly ? FREAD : FREAD | FWRITE,
NOCRED, p);
vrele(pmp->pm_devvp);
@ -549,7 +536,7 @@ msdosfs_root(mp, vpp)
error = deget(pmp, MSDOSFSROOT, MSDOSFSROOT_OFS, NULL, &ndep);
#ifdef MSDOSFS_DEBUG
printf("msdosfs_root(); mp %08x, pmp %08x, ndep %08x, vp %08x\n",
printf("msdosfs_root(); mp %p, pmp %p, ndep %p, vp %p\n",
mp, pmp, ndep, DETOV(ndep));
#endif
if (error == 0)

View File

@ -35,7 +35,7 @@
*
* @(#)null_subr.c 8.4 (Berkeley) 1/21/94
*
* $Id: lofs_subr.c,v 1.11 1992/05/30 10:05:43 jsp Exp jsp $
* $Id: null_subr.c,v 1.2 1994/05/25 09:08:00 rgrimes Exp $
*/
#include <sys/param.h>
@ -153,7 +153,8 @@ null_node_alloc(mp, lowervp, vpp)
struct vnode *othervp, *vp;
int error;
if (error = getnewvnode(VT_NULL, mp, null_vnodeop_p, vpp))
error = getnewvnode(VT_NULL, mp, null_vnodeop_p, vpp);
if (error)
return (error);
vp = *vpp;
@ -167,7 +168,8 @@ null_node_alloc(mp, lowervp, vpp)
* check to see if someone else has beaten us to it.
* (We could have slept in MALLOC.)
*/
if (othervp = null_node_find(lowervp)) {
othervp = null_node_find(lowervp);
if (othervp) {
FREE(xp, M_TEMP);
vp->v_type = VBAD; /* node is discarded */
vp->v_usecount = 0; /* XXX */
@ -194,7 +196,8 @@ null_node_create(mp, lowervp, newvpp)
{
struct vnode *aliasvp;
if (aliasvp = null_node_find(mp, lowervp)) {
aliasvp = null_node_find(mp, lowervp);
if (aliasvp) {
/*
* null_node_find has taken another reference
* to the alias vnode.
@ -216,7 +219,8 @@ null_node_create(mp, lowervp, newvpp)
/*
* Make new vnode reference the null_node.
*/
if (error = null_node_alloc(mp, lowervp, &aliasvp))
error = null_node_alloc(mp, lowervp, &aliasvp);
if (error)
return error;
/*
@ -229,8 +233,8 @@ null_node_create(mp, lowervp, newvpp)
#ifdef DIAGNOSTIC
if (lowervp->v_usecount < 1) {
/* Should never happen... */
vprint ("null_node_create: alias ");
vprint ("null_node_create: lower ");
vprint ("null_node_create: alias ",aliasvp);
vprint ("null_node_create: lower ",lowervp);
printf ("null_node_create: lower has 0 usecount.\n");
panic ("null_node_create: lower has 0 usecount.");
};

View File

@ -35,7 +35,7 @@
*
* @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94
*
* $Id: fdesc_vnops.c,v 1.4 1994/09/09 13:24:26 davidg Exp $
* $Id: fdesc_vnops.c,v 1.5 1994/09/21 03:46:56 wollman Exp $
*/
/*
@ -58,6 +58,7 @@
#include <sys/namei.h>
#include <sys/buf.h>
#include <sys/dirent.h>
#include <sys/socketvar.h>
#include <miscfs/fdesc/fdesc.h>
#define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL)

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)fifo_vnops.c 8.2 (Berkeley) 1/4/94
* $Id: fifo_vnops.c,v 1.4 1994/09/21 03:46:57 wollman Exp $
* $Id: fifo_vnops.c,v 1.5 1994/09/22 19:38:07 wollman Exp $
*/
#include <sys/param.h>
@ -153,20 +153,23 @@ fifo_open(ap)
if ((fip = vp->v_fifoinfo) == NULL) {
MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK);
vp->v_fifoinfo = fip;
if (error = socreate(AF_UNIX, &rso, SOCK_STREAM, 0)) {
error = socreate(AF_UNIX, &rso, SOCK_STREAM, 0);
if (error) {
free(fip, M_VNODE);
vp->v_fifoinfo = NULL;
return (error);
}
fip->fi_readsock = rso;
if (error = socreate(AF_UNIX, &wso, SOCK_STREAM, 0)) {
error = socreate(AF_UNIX, &wso, SOCK_STREAM, 0);
if (error) {
(void)soclose(rso);
free(fip, M_VNODE);
vp->v_fifoinfo = NULL;
return (error);
}
fip->fi_writesock = wso;
if (error = unp_connect2(wso, rso)) {
error = unp_connect2(wso, rso);
if (error) {
(void)soclose(wso);
(void)soclose(rso);
free(fip, M_VNODE);
@ -247,8 +250,8 @@ fifo_read(ap)
rso->so_state |= SS_NBIO;
startresid = uio->uio_resid;
VOP_UNLOCK(ap->a_vp);
error = soreceive(rso, (struct mbuf **)0, uio, (int *)0,
(struct mbuf **)0, (struct mbuf **)0);
error = soreceive(rso, (struct mbuf **)0, uio,
(struct mbuf **)0, (struct mbuf **)0, (int*)0);
VOP_LOCK(ap->a_vp);
/*
* Clear EOF indication after first such return.
@ -418,6 +421,21 @@ fifo_close(ap)
return (error2);
}
/*
* Print out internal contents of a fifo vnode.
*/
int
fifo_printinfo(vp)
struct vnode *vp;
{
register struct fifoinfo *fip = vp->v_fifoinfo;
printf(", fifo with %ld readers and %ld writers",
fip->fi_readers, fip->fi_writers);
return (0);
}
/*
* Print out the contents of a fifo vnode.
*/
@ -434,20 +452,6 @@ fifo_print(ap)
return (0);
}
/*
* Print out internal contents of a fifo vnode.
*/
int
fifo_printinfo(vp)
struct vnode *vp;
{
register struct fifoinfo *fip = vp->v_fifoinfo;
printf(", fifo with %d readers and %d writers",
fip->fi_readers, fip->fi_writers);
return (0);
}
/*
* Return POSIX pathconf information applicable to fifo's.
*/

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vfsops.c 8.4 (Berkeley) 1/21/94
* $Id: kernfs_vfsops.c,v 1.4 1994/09/21 03:46:59 wollman Exp $
* $Id: kernfs_vfsops.c,v 1.5 1994/09/22 19:38:11 wollman Exp $
*/
/*
@ -78,7 +78,8 @@ cdevvp(dev, vpp)
}
vp = nvp;
vp->v_type = VCHR;
if (nvp = checkalias(vp, dev, (struct mount *)0)) {
nvp = checkalias(vp, dev, (struct mount *)0);
if (nvp) {
vput(vp);
vp = nvp;
}
@ -206,7 +207,8 @@ kernfs_unmount(mp, mntflags, p)
#ifdef KERNFS_DIAGNOSTIC
printf("kernfs_unmount: calling vflush\n");
#endif
if (error = vflush(mp, rootvp, flags))
error = vflush(mp, rootvp, flags);
if (error)
return (error);
#ifdef KERNFS_DIAGNOSTIC

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kernfs_vnops.c 8.6 (Berkeley) 2/10/94
* $Id: kernfs_vnops.c,v 1.4 1994/08/18 22:35:12 wollman Exp $
* $Id: kernfs_vnops.c,v 1.5 1994/09/21 03:47:00 wollman Exp $
*/
/*
@ -111,7 +111,7 @@ kernfs_xread(kt, buf, len, lenp)
case KTT_TIME: {
struct timeval tv;
microtime(&tv);
sprintf(buf, "%d %d\n", tv.tv_sec, tv.tv_usec);
sprintf(buf, "%ld %ld\n", tv.tv_sec, tv.tv_usec);
break;
}

View File

@ -35,7 +35,7 @@
*
* @(#)null_subr.c 8.4 (Berkeley) 1/21/94
*
* $Id: lofs_subr.c,v 1.11 1992/05/30 10:05:43 jsp Exp jsp $
* $Id: null_subr.c,v 1.2 1994/05/25 09:08:00 rgrimes Exp $
*/
#include <sys/param.h>
@ -153,7 +153,8 @@ null_node_alloc(mp, lowervp, vpp)
struct vnode *othervp, *vp;
int error;
if (error = getnewvnode(VT_NULL, mp, null_vnodeop_p, vpp))
error = getnewvnode(VT_NULL, mp, null_vnodeop_p, vpp);
if (error)
return (error);
vp = *vpp;
@ -167,7 +168,8 @@ null_node_alloc(mp, lowervp, vpp)
* check to see if someone else has beaten us to it.
* (We could have slept in MALLOC.)
*/
if (othervp = null_node_find(lowervp)) {
othervp = null_node_find(lowervp);
if (othervp) {
FREE(xp, M_TEMP);
vp->v_type = VBAD; /* node is discarded */
vp->v_usecount = 0; /* XXX */
@ -194,7 +196,8 @@ null_node_create(mp, lowervp, newvpp)
{
struct vnode *aliasvp;
if (aliasvp = null_node_find(mp, lowervp)) {
aliasvp = null_node_find(mp, lowervp);
if (aliasvp) {
/*
* null_node_find has taken another reference
* to the alias vnode.
@ -216,7 +219,8 @@ null_node_create(mp, lowervp, newvpp)
/*
* Make new vnode reference the null_node.
*/
if (error = null_node_alloc(mp, lowervp, &aliasvp))
error = null_node_alloc(mp, lowervp, &aliasvp);
if (error)
return error;
/*
@ -229,8 +233,8 @@ null_node_create(mp, lowervp, newvpp)
#ifdef DIAGNOSTIC
if (lowervp->v_usecount < 1) {
/* Should never happen... */
vprint ("null_node_create: alias ");
vprint ("null_node_create: lower ");
vprint ("null_node_create: alias ",aliasvp);
vprint ("null_node_create: lower ",lowervp);
printf ("null_node_create: lower has 0 usecount.\n");
panic ("null_node_create: lower has 0 usecount.");
};

View File

@ -1,4 +1,4 @@
/* $Id: msdosfs_vfsops.c,v 1.3 1994/09/21 03:47:16 wollman Exp $ */
/* $Id: msdosfs_vfsops.c,v 1.4 1994/09/27 20:42:54 phk Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */
/*-
@ -230,7 +230,7 @@ msdosfs_mount(mp, path, data, ndp, p)
pmp->pm_mask = args.mask;
(void) msdosfs_statfs(mp, &mp->mnt_stat, p);
#ifdef MSDOSFS_DEBUG
printf("msdosfs_mount(): mp %x, pmp %x, inusemap %x\n", mp, pmp, pmp->pm_inusemap);
printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap);
#endif
return 0;
}
@ -515,19 +515,6 @@ msdosfs_unmount(mp, mntflags, p)
if (error)
return error;
pmp->pm_devvp->v_specflags &= ~SI_MOUNTEDON;
#ifdef MSDOSFS_DEBUG
printf("msdosfs_umount(): just before calling VOP_CLOSE()\n");
printf("flag %08x, usecount %d, writecount %d, holdcnt %d\n",
vp->v_flag, vp->v_usecount, vp->v_writecount, vp->v_holdcnt);
printf("lastr %d, id %d, mount %08x, op %08x\n",
vp->v_lastr, vp->v_id, vp->v_mount, vp->v_op);
printf("freef %08x, freeb %08x, mountf %08x, mountb %08x\n",
vp->v_freef, vp->v_freeb, vp->v_mountf, vp->v_mountb);
printf("cleanblkhd %08x, dirtyblkhd %08x, numoutput %d, type %d\n",
vp->v_cleanblkhd, vp->v_dirtyblkhd, vp->v_numoutput, vp->v_type);
printf("union %08x, tag %d, data[0] %08x, data[1] %08x\n",
vp->v_socket, vp->v_tag, vp->v_data[0], vp->v_data[1]);
#endif
error = VOP_CLOSE(pmp->pm_devvp, pmp->pm_ronly ? FREAD : FREAD | FWRITE,
NOCRED, p);
vrele(pmp->pm_devvp);
@ -549,7 +536,7 @@ msdosfs_root(mp, vpp)
error = deget(pmp, MSDOSFSROOT, MSDOSFSROOT_OFS, NULL, &ndep);
#ifdef MSDOSFS_DEBUG
printf("msdosfs_root(); mp %08x, pmp %08x, ndep %08x, vp %08x\n",
printf("msdosfs_root(); mp %p, pmp %p, ndep %p, vp %p\n",
mp, pmp, ndep, DETOV(ndep));
#endif
if (error == 0)

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)route.c 8.2 (Berkeley) 11/15/93
* $Id: route.c,v 1.6 1994/09/08 00:17:22 wollman Exp $
* $Id: route.c,v 1.7 1994/09/14 03:10:05 wollman Exp $
*/
#include <sys/param.h>
@ -145,7 +145,7 @@ rtfree(rt)
panic ("rtfree 2");
rttrash--;
if (rt->rt_refcnt < 0) {
printf("rtfree: %x not freed (neg refs)\n", rt);
printf("rtfree: %p not freed (neg refs)\n", rt);
return;
}
ifa = rt->rt_ifa;
@ -273,9 +273,13 @@ rtioctl(req, data, p)
caddr_t data;
struct proc *p;
{
#ifdef INET
extern int (*mrt_ioctl)(int, caddr_t, struct proc *);
/* Multicast goop, grrr... */
return mrt_ioctl(req, data, p);
#else /* INET */
return ENXIO;
#endif /* INET */
}
struct ifaddr *
@ -500,7 +504,8 @@ rtinit(ifa, cmd, flags)
rt_maskedcopy(dst, deldst, ifa->ifa_netmask);
dst = deldst;
}
if (rt = rtalloc1(dst, 0)) {
rt = rtalloc1(dst, 0);
if (rt) {
rt->rt_refcnt--;
if (rt->rt_ifa != ifa) {
if (m)
@ -524,7 +529,7 @@ rtinit(ifa, cmd, flags)
if (cmd == RTM_ADD && error == 0 && (rt = nrt)) {
rt->rt_refcnt--;
if (rt->rt_ifa != ifa) {
printf("rtinit: wrong ifa (%x) was (%x)\n", ifa,
printf("rtinit: wrong ifa (%p) was (%p)\n", ifa,
rt->rt_ifa);
if (rt->rt_ifa->ifa_rtrequest)
rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, SA(0));

View File

@ -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) {

View File

@ -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;

View File

@ -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 @@ icmp_input(m, hlen)
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);
}

View File

@ -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 @@ ipintr()
}
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++;

View File

@ -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();

View File

@ -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

View File

@ -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 @@ tcp_input(m, iphlen)
* 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)

View File

@ -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 @@ tcp_input(m, iphlen)
* 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)

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -8,7 +8,7 @@
* file.
*
* Written by Julian Elischer (julian@dialix.oz.au)
* $Id: scsi_base.c,v 1.11 1994/08/27 16:14:33 davidg Exp $
* $Id: scsi_base.c,v 1.12 1994/08/31 06:17:44 davidg Exp $
*/
#define SPLSD splbio
@ -16,6 +16,7 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/buf.h>
#include <sys/uio.h>
#include <sys/malloc.h>

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)device_pager.c 8.1 (Berkeley) 6/11/93
* $Id$
* $Id: device_pager.c,v 1.3 1994/08/02 07:55:06 davidg Exp $
*/
/*
@ -48,6 +48,7 @@
#include <sys/conf.h>
#include <sys/mman.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@ -241,7 +242,7 @@ dev_pager_dealloc(pager)
/*
* Free up our fake pages.
*/
while (m=devp->devp_pglist.tqh_first) {
while ((m=devp->devp_pglist.tqh_first) != 0) {
TAILQ_REMOVE(&devp->devp_pglist, m, pageq);
dev_pager_putfake(m);
}