2.1.51 diff to stabilize ip_fw.h and remove some warnings on 64-bit machines

a sun (asun@zoology.washington.edu)
Sat, 23 Aug 1997 09:33:16 -0700 (PDT)


here's a patch that does two things:
1) stabilizes struct ip_fw so that it's the same on all
machines.
2) removes unnecessary long casts in printk's to make the
alpha compile quiet down a little.

--- ./linux/fs/affs/inode.c.save Sat Aug 23 01:45:15 1997
+++ ./linux/fs/affs/inode.c Sat Aug 23 01:45:26 1997
@@ -531,7 +531,7 @@
if (bb) {
if (affs_checksum_block(s->s_blocksize,bb->b_data,NULL,NULL) &&
!(s->s_flags & MS_RDONLY)) {
- printk(KERN_WARNING "AFFS: Bitmap (%d,key=%lu) invalid - "
+ printk(KERN_WARNING "AFFS: Bitmap (%d,key=%u) invalid - "
"mounting %s read only.\n",mapidx,htonl(bm[i]),
kdevname(dev));
s->s_flags |= MS_RDONLY;
--- ./linux/fs/nfsd/nfssvc.c.save Sat Aug 23 01:40:43 1997
+++ ./linux/fs/nfsd/nfssvc.c Sat Aug 23 01:40:51 1997
@@ -135,7 +135,7 @@
rqstp->rq_client = exp_getclient(&rqstp->rq_addr);
if (!rqstp->rq_client) {
printk(KERN_WARNING "nfsd: unauthenticated request "
- "from (%08lx:%d)\n",
+ "from (%08x:%d)\n",
ntohl(rqstp->rq_addr.sin_addr.s_addr),
ntohs(rqstp->rq_addr.sin_port));
svc_drop(rqstp);
--- ./linux/fs/nfsd/nfsproc.c.save Sat Aug 23 01:41:00 1997
+++ ./linux/fs/nfsd/nfsproc.c Sat Aug 23 01:41:13 1997
@@ -138,7 +138,7 @@

if ((avail << 2) < argp->count) {
printk(KERN_NOTICE
- "oversized read request from %08lx:%d (%d bytes)\n",
+ "oversized read request from %08x:%d (%d bytes)\n",
ntohl(rqstp->rq_addr.sin_addr.s_addr),
ntohs(rqstp->rq_addr.sin_port),
argp->count);
--- ./linux/fs/nfsd/nfsfh.c.save Sat Aug 23 01:41:27 1997
+++ ./linux/fs/nfsd/nfsfh.c Sat Aug 23 01:42:32 1997
@@ -31,7 +31,7 @@
if(fhp->fh_dverified)
return 0;

- dprintk("nfsd: fh_lookup(exp %x/%ld fh %p)\n",
+ dprintk("nfsd: fh_lookup(exp %x/%d fh %p)\n",
fh->fh_xdev, fh->fh_xino, fh->fh_dentry);

/* Look up the export entry. */
@@ -44,7 +44,7 @@
/* Check if the request originated from a secure port. */
if (!rqstp->rq_secure && EX_SECURE(exp)) {
printk(KERN_WARNING
- "nfsd: request from insecure port (%08lx:%d)!\n",
+ "nfsd: request from insecure port (%08x:%d)!\n",
ntohl(rqstp->rq_addr.sin_addr.s_addr),
ntohs(rqstp->rq_addr.sin_port));
return nfserr_perm;
@@ -93,7 +93,7 @@
void
fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry)
{
- dprintk("nfsd: fh_compose(exp %x/%ld dentry %p)\n",
+ dprintk("nfsd: fh_compose(exp %x/%d dentry %p)\n",
exp->ex_dev, exp->ex_ino, dentry);

fh_init(fhp); /* initialize empty fh */
--- ./linux/fs/nfsd/vfs.c.save Sat Aug 23 01:42:43 1997
+++ ./linux/fs/nfsd/vfs.c Sat Aug 23 01:42:51 1997
@@ -943,7 +943,7 @@
*p++ = htonl(eof); /* end of directory */
*countp = (caddr_t) p - (caddr_t) buffer;

- dprintk("nfsd: readdir result %d bytes, eof %d offset %ld\n",
+ dprintk("nfsd: readdir result %d bytes, eof %d offset %d\n",
*countp, eof,
cd.offset? ntohl(*cd.offset) : -1);
return 0;
--- ./linux/fs/nfsd/export.c.save Sat Aug 23 01:42:59 1997
+++ ./linux/fs/nfsd/export.c Sat Aug 23 01:44:14 1997
@@ -145,7 +145,7 @@
!exp_verify_string(nxp->ex_client, NFSCLNT_IDMAX))
return -EINVAL;

- dprintk("exp_export called for %s:%s (%x/%ld fl %x).\n",
+ dprintk("exp_export called for %s:%s (%x/%d fl %x).\n",
nxp->ex_client, nxp->ex_path,
nxp->ex_dev, nxp->ex_ino, nxp->ex_flags);
dev = nxp->ex_dev;
@@ -360,7 +360,7 @@
struct dentry *dentry;
struct inode *inode;

- dprintk("nfsd: exp_rootfh(%s:%x/%ld)\n", clp->cl_ident, dev, ino);
+ dprintk("nfsd: exp_rootfh(%s:%x/%d)\n", clp->cl_ident, dev, ino);

if (!(exp = exp_get(clp, dev, ino)))
return -EPERM;
@@ -373,7 +373,7 @@
}
if(inode->i_dev != dev || inode->i_ino != ino) {
printk("exp_rootfh: Aieee, ino/dev mismatch\n");
- printk("exp_rootfh: arg[dev(%x):ino(%ld)] inode[dev(%x):ino(%ld)]\n",
+ printk("exp_rootfh: arg[dev(%x):ino(%d)] inode[dev(%x):ino(%ld)]\n",
dev, ino, inode->i_dev, inode->i_ino);
}

--- ./linux/fs/lockd/mon.c.save Sat Aug 23 01:38:48 1997
+++ ./linux/fs/lockd/mon.c Sat Aug 23 01:39:06 1997
@@ -129,7 +129,7 @@
char buffer[20];
u32 addr = ntohl(argp->addr);

- dprintk("nsm: xdr_encode_mon(%08lx, %ld, %ld, %ld)\n",
+ dprintk("nsm: xdr_encode_mon(%08x, %d, %d, %d)\n",
htonl(argp->addr), htonl(argp->proc),
htonl(argp->vers), htonl(argp->proc));

--- ./linux/fs/lockd/svcproc.c.save Sat Aug 23 01:37:30 1997
+++ ./linux/fs/lockd/svcproc.c Sat Aug 23 08:44:42 1997
@@ -43,7 +43,7 @@
/* Obtain handle for client host */
if (rqstp->rq_client == NULL) {
printk(KERN_NOTICE
- "lockd: unauthenticated request from (%08lx:%d)\n",
+ "lockd: unauthenticated request from (%08x:%d)\n",
ntohl(rqstp->rq_addr.sin_addr.s_addr),
ntohs(rqstp->rq_addr.sin_port));
return nlm_lck_denied_nolocks;
@@ -110,7 +110,7 @@
/* Now check for conflicting locks */
resp->status = nlmsvc_testlock(file, &argp->lock, &resp->lock);

- dprintk("lockd: TEST status %ld\n", ntohl(resp->status));
+ dprintk("lockd: TEST status %d\n", ntohl(resp->status));
nlm_release_host(host);
nlm_release_file(file);
return rpc_success;
@@ -153,7 +153,7 @@
resp->status = nlmsvc_lock(rqstp, file, &argp->lock,
argp->block, argp->cookie);

- dprintk("lockd: LOCK status %ld\n", ntohl(resp->status));
+ dprintk("lockd: LOCK status %d\n", ntohl(resp->status));
nlm_release_host(host);
nlm_release_file(file);
return rpc_success;
@@ -183,7 +183,7 @@
/* Try to cancel request. */
resp->status = nlmsvc_cancel_blocked(file, &argp->lock);

- dprintk("lockd: CANCEL status %ld\n", ntohl(resp->status));
+ dprintk("lockd: CANCEL status %d\n", ntohl(resp->status));
nlm_release_host(host);
nlm_release_file(file);
return rpc_success;
@@ -216,7 +216,7 @@
/* Now try to remove the lock */
resp->status = nlmsvc_unlock(file, &argp->lock);

- dprintk("lockd: UNLOCK status %ld\n", ntohl(resp->status));
+ dprintk("lockd: UNLOCK status %d\n", ntohl(resp->status));
nlm_release_host(host);
nlm_release_file(file);
return rpc_success;
@@ -234,7 +234,7 @@

dprintk("lockd: GRANTED called\n");
resp->status = nlmclnt_grant(&argp->lock);
- dprintk("lockd: GRANTED status %ld\n", ntohl(resp->status));
+ dprintk("lockd: GRANTED status %d\n", ntohl(resp->status));
return rpc_success;
}

@@ -340,7 +340,7 @@
/* Now try to create the share */
resp->status = nlmsvc_share_file(host, file, argp);

- dprintk("lockd: SHARE status %ld\n", ntohl(resp->status));
+ dprintk("lockd: SHARE status %d\n", ntohl(resp->status));
nlm_release_host(host);
nlm_release_file(file);
return rpc_success;
@@ -373,7 +373,7 @@
/* Now try to lock the file */
resp->status = nlmsvc_unshare_file(host, file, argp);

- dprintk("lockd: UNSHARE status %ld\n", ntohl(resp->status));
+ dprintk("lockd: UNSHARE status %d\n", ntohl(resp->status));
nlm_release_host(host);
nlm_release_file(file);
return rpc_success;
@@ -424,7 +424,7 @@
if (saddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)
|| ntohs(saddr.sin_port) >= 1024) {
printk(KERN_WARNING
- "lockd: rejected NSM callback from %08lx:%d\n",
+ "lockd: rejected NSM callback from %08x:%d\n",
ntohl(rqstp->rq_addr.sin_addr.s_addr),
ntohs(rqstp->rq_addr.sin_port));
return rpc_system_err;
--- ./linux/fs/lockd/svcsubs.c.save Sat Aug 23 08:44:50 1997
+++ ./linux/fs/lockd/svcsubs.c Sat Aug 23 08:44:59 1997
@@ -70,7 +70,7 @@
/* Open the file. Note that this must not sleep for too long, else
* we would lock up lockd:-) So no NFS re-exports, folks. */
if ((nfserr = nlmsvc_ops->fopen(rqstp, fh, &file->f_file)) != 0) {
- dprintk("lockd: open failed (nfserr %ld)\n", ntohl(nfserr));
+ dprintk("lockd: open failed (nfserr %d)\n", ntohl(nfserr));
kfree(file);
up(&nlm_file_sema);
return nlm_lck_denied;
--- ./linux/include/linux/ip_fw.h.save Sat Aug 23 00:35:01 1997
+++ ./linux/include/linux/ip_fw.h Sat Aug 23 00:36:49 1997
@@ -65,15 +65,15 @@
struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */
struct in_addr fw_via; /* IP address of interface "via" */
struct device *fw_viadev; /* device of interface "via" */
- unsigned short fw_flg; /* Flags word */
- unsigned short fw_nsp, fw_ndp; /* N'of src ports and # of dst ports */
+ __u16 fw_flg; /* Flags word */
+ __u16 fw_nsp, fw_ndp; /* N'of src ports and # of dst ports */
/* in ports array (dst ports follow */
/* src ports; max of 10 ports in all; */
/* count of 0 means match all ports) */
#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
- unsigned short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
- unsigned long fw_pcnt,fw_bcnt; /* Packet and byte counters */
- unsigned char fw_tosand, fw_tosxor; /* Revised packet priority */
+ __u16 fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
+ __u32 fw_pcnt,fw_bcnt; /* Packet and byte counters */
+ __u8 fw_tosand, fw_tosxor; /* Revised packet priority */
char fw_vianame[IFNAMSIZ]; /* name of interface "via" */
};

--- ./linux/net/ipv4/ip_input.c.save Sat Aug 23 00:41:06 1997
+++ ./linux/net/ipv4/ip_input.c Sat Aug 23 00:40:36 1997
@@ -426,7 +426,7 @@
if (opt->srr) {
if (!ipv4_config.source_route) {
if (ipv4_config.log_martians)
- printk(KERN_INFO "source route option %08lx -> %08lx\n",
+ printk(KERN_INFO "source route option %08x -> %08x\n",
ntohl(iph->saddr), ntohl(iph->daddr));
goto drop;
}
--- ./linux/net/ipv4/ip_masq.c.save Sat Aug 23 08:02:00 1997
+++ ./linux/net/ipv4/ip_masq.c Sat Aug 23 08:02:29 1997
@@ -973,7 +973,7 @@
timer_active = del_timer(&ms->timer);
if (!timer_active)
ms->timer.expires = jiffies;
- sprintf(temp,"%s %08lX:%04X %08lX:%04X %04X %08X %6d %6d %7lu",
+ sprintf(temp,"%s %08X:%04X %08X:%04X %04X %08X %6d %6d %7lu",
masq_proto_name(ms->protocol),
ntohl(ms->saddr), ntohs(ms->sport),
ntohl(ms->daddr), ntohs(ms->dport),
--- ./linux/net/ipv4/ip_fw.c.save Sat Aug 23 00:46:09 1997
+++ ./linux/net/ipv4/ip_fw.c Sat Aug 23 00:49:48 1997
@@ -133,7 +133,7 @@
#define dprintf4(a1,a2,a3,a4)
#endif

-#define print_ip(a) printk("%ld.%ld.%ld.%ld",(ntohl(a)>>24)&0xFF,\
+#define print_ip(a) printk("%d.%d.%d.%d",(ntohl(a)>>24)&0xFF,\
(ntohl(a)>>16)&0xFF,\
(ntohl(a)>>8)&0xFF,\
(ntohl(a))&0xFF);
@@ -1115,12 +1115,12 @@

while(i!=NULL)
{
- len+=sprintf(buffer+len,"%08lX/%08lX->%08lX/%08lX %.16s %08lX %X ",
+ len+=sprintf(buffer+len,"%08X/%08X->%08X/%08X %.16s %08X %X ",
ntohl(i->fw_src.s_addr),ntohl(i->fw_smsk.s_addr),
ntohl(i->fw_dst.s_addr),ntohl(i->fw_dmsk.s_addr),
(i->fw_vianame)[0] ? i->fw_vianame : "-",
ntohl(i->fw_via.s_addr),i->fw_flg);
- len+=sprintf(buffer+len,"%u %u %-9lu %-9lu",
+ len+=sprintf(buffer+len,"%u %u %-9u %-9u",
i->fw_nsp,i->fw_ndp, i->fw_pcnt,i->fw_bcnt);
for (p = 0; p < IP_FW_MAX_PORTS; p++)
len+=sprintf(buffer+len, " %u", i->fw_pts[p]);
--- ./linux/net/ipv4/fib.c.save Sat Aug 23 01:32:19 1997
+++ ./linux/net/ipv4/fib.c Sat Aug 23 01:29:37 1997
@@ -1179,7 +1179,7 @@

if (fi)
flags |= fi->fib_flags;
- sprintf(temp, "%s\t%08lX\t%08X\t%04X\t%d\t%u\t%d\t%08lX\t%d\t%lu\t%u\t%02x\t%02x",
+ sprintf(temp, "%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%lu\t%u\t%02x\t%02x",
fi && fi->fib_dev ? fi->fib_dev->name : "*", htonl(f->fib_key<<fz->fz_logmask), fi ? fi->fib_gateway : 0,
flags, 0, 0, f->fib_metric,
htonl(fz->fz_mask), fi ? (int)fi->fib_mtu : 0, fi ? fi->fib_window : 0, fi ? (int)fi->fib_irtt : 0, f->fib_tos, class->cl_id);
@@ -1264,7 +1264,7 @@

if (fi)
flags |= fi->fib_flags;
- sprintf(temp, "%s\t%08lX\t%08X\t%X\t%d\t%u\t%d\t%08lX\t%d\t%lu\t%u\t%02x\t%02x",
+ sprintf(temp, "%s\t%08X\t%08X\t%X\t%d\t%u\t%d\t%08X\t%d\t%lu\t%u\t%02x\t%02x",
fi && fi->fib_dev ? fi->fib_dev->name : "*",
htonl(f->fib_key<<fz->fz_logmask),
fi ? fi->fib_gateway : 0,
--- ./linux/net/ipv4/route.c.save Sat Aug 23 01:35:15 1997
+++ ./linux/net/ipv4/route.c Sat Aug 23 01:35:52 1997
@@ -570,8 +570,8 @@

reject_redirect:
if (ipv4_config.log_martians && net_ratelimit())
- printk(KERN_INFO "Redirect from %lX/%s to %lX ignored."
- "Path = %lX -> %lX, tos %02x\n",
+ printk(KERN_INFO "Redirect from %X/%s to %X ignored."
+ "Path = %X -> %X, tos %02x\n",
ntohl(old_gw), dev->name, ntohl(new_gw),
ntohl(saddr), ntohl(daddr), tos);
}
@@ -1010,7 +1010,7 @@
rth->rt_flags = flags;

if (log)
- printk(KERN_INFO "installing route %08lX -> %08lX\n", ntohl(rth->rt_src), ntohl(rth->rt_dst));
+ printk(KERN_INFO "installing route %08X -> %08X\n", ntohl(rth->rt_src), ntohl(rth->rt_dst));

if (flags&(RTF_LOCAL|RTF_MULTICAST|RTF_BROADCAST|RTF_REJECT)) {
skb->dst = (struct dst_entry*)rt_intern_hash(hash, rth, 0);
--- ./linux/net/ipv4/udp.c.save Sat Aug 23 01:36:05 1997
+++ ./linux/net/ipv4/udp.c Sat Aug 23 01:36:20 1997
@@ -1092,7 +1092,7 @@
/* RFC1122: OK. Discards the bad packet silently (as far as */
/* the network is concerned, anyway) as per 4.1.3.4 (MUST). */

- NETDEBUG(printk(KERN_DEBUG "UDP: bad checksum. From %08lX:%d to %08lX:%d ulen %d\n",
+ NETDEBUG(printk(KERN_DEBUG "UDP: bad checksum. From %08X:%d to %08X:%d ulen %d\n",
ntohl(saddr),ntohs(uh->source),
ntohl(daddr),ntohs(uh->dest),
ulen));
--- ./linux/net/ipv4/icmp.c.save Sat Aug 23 01:36:31 1997
+++ ./linux/net/ipv4/icmp.c Sat Aug 23 01:36:42 1997
@@ -982,7 +982,7 @@

mask = *(u32*)&icmph[1];
if (mask != dev->pa_mask)
- printk(KERN_INFO "Wrong address mask %08lX from %08lX/%s\n",
+ printk(KERN_INFO "Wrong address mask %08X from %08X/%s\n",
ntohl(mask), ntohl(rt->rt_src), dev->name);
kfree_skb(skb, FREE_READ);
}
--- ./linux/net/ipx/af_ipx.c.save Sat Aug 23 01:47:30 1997
+++ ./linux/net/ipx/af_ipx.c Sat Aug 23 01:47:42 1997
@@ -741,7 +741,7 @@
}
else
{
- printk(KERN_WARNING "IPX: Network number collision %lx\n %s %s and %s %s\n",
+ printk(KERN_WARNING "IPX: Network number collision %x\n %s %s and %s %s\n",
htonl(ipx->ipx_source.net),
ipx_device_name(i),
ipx_frame_name(i->if_dlink_type),
--- ./linux/net/ipv6/sit.c.save Sat Aug 23 01:46:38 1997
+++ ./linux/net/ipv6/sit.c Sat Aug 23 01:47:20 1997
@@ -338,7 +338,7 @@

minfo = sit_mtu_lookup(iph->daddr);

- printk(KERN_DEBUG "sit: %08lx pmtu = %ul\n", ntohl(iph->saddr),
+ printk(KERN_DEBUG "sit: %08x pmtu = %ul\n", ntohl(iph->saddr),
info);

if (minfo == NULL) {
--- ./linux/net/sunrpc/xprt.c.save Sat Aug 23 01:47:58 1997
+++ ./linux/net/sunrpc/xprt.c Sat Aug 23 01:48:06 1997
@@ -1278,7 +1278,7 @@
struct socket *sock;
int type, err;

- dprintk("RPC: xprt_create_socket(%08lx, %s %d)\n",
+ dprintk("RPC: xprt_create_socket(%08x, %s %d)\n",
sap? ntohl(sap->sin_addr.s_addr) : 0,
(proto == IPPROTO_UDP)? "udp" : "tcp", proto);

--- ./linux/net/sunrpc/svc.c.save Sat Aug 23 01:48:33 1997
+++ ./linux/net/sunrpc/svc.c Sat Aug 23 01:48:55 1997
@@ -254,7 +254,7 @@
}

if (auth_stat != rpc_auth_ok) {
- dprintk("svc: authentication failed (%ld)\n", ntohl(auth_stat));
+ dprintk("svc: authentication failed (%d)\n", ntohl(auth_stat));
serv->sv_stats->rpcbadauth++;
resp->buf[-1] = xdr_one; /* REJECT */
svc_putlong(resp, xdr_one); /* AUTH_ERROR */
--- ./linux/net/sunrpc/svcsock.c.save Sat Aug 23 01:49:03 1997
+++ ./linux/net/sunrpc/svcsock.c Sat Aug 23 01:49:54 1997
@@ -537,13 +537,13 @@
* we just punt connects from unprivileged ports. */
if (ntohs(sin.sin_port) >= 1024) {
printk(KERN_WARNING
- "%s: connect from unprivileged port: %08lx:%d",
+ "%s: connect from unprivileged port: %08x:%d",
serv->sv_name,
ntohl(sin.sin_addr.s_addr), ntohs(sin.sin_port));
goto failed;
}

- dprintk("%s: connect from %08lx:%04x\n", serv->sv_name,
+ dprintk("%s: connect from %08x:%04x\n", serv->sv_name,
ntohl(sin.sin_addr.s_addr), ntohs(sin.sin_port));

if (!(newsvsk = svc_setup_socket(serv, newsock, &err, 0)))
@@ -890,7 +890,7 @@
int error;
int type;

- dprintk("svc: svc_create_socket(%s, %d, %08lx:%d)\n",
+ dprintk("svc: svc_create_socket(%s, %d, %08x:%d)\n",
serv->sv_program->pg_name, protocol,
ntohl(sin->sin_addr.s_addr),
ntohs(sin->sin_port));