diff options
| author | Ed Schouten <ed@il.fontys.nl> | 2004-10-19 18:40:45 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-19 18:40:45 -0700 |
| commit | fc29938dabf736b88f7f2ae3e18efbb01b1fbcb8 (patch) | |
| tree | f434f27e58f59d5f3c05bf02a86519525faf6f1b /fs/lockd/host.c | |
| parent | 47387472176f51d2f84548a353204029daf6cf91 (diff) | |
[PATCH] lockd: remove hardcoded maximum NLM cookie length
At the moment, the NLM cookie length is fixed to 8 bytes, while 1024 is the
theoretical maximum. FreeBSD uses 16 bytes, Mac OS X uses 20 bytes.
Therefore we need to make the length dynamic (which I set to 32 bytes).
This patch is based on an old patch for Linux 2.4.23-pre9, which I changed
to patch properly (also added some stylish NIPQUAD fixes).
From: Neil Brown <neilb@cse.unsw.edu.au>
Further lockd tidyups.
- NIPQUAD everywhere that is appropriate
- use XDR_QUADLEN in more places as appropriate
- discard QUADLEN which is a lockd-specific version of XDR_QUADLEN
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/lockd/host.c')
| -rw-r--r-- | fs/lockd/host.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index fc4f414a8c5f..54f25ae2ad64 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -104,11 +104,7 @@ nlm_lookup_host(int server, struct sockaddr_in *sin, memset(host, 0, sizeof(*host)); addr = sin->sin_addr.s_addr; - sprintf(host->h_name, "%d.%d.%d.%d", - (unsigned char) (ntohl(addr) >> 24), - (unsigned char) (ntohl(addr) >> 16), - (unsigned char) (ntohl(addr) >> 8), - (unsigned char) (ntohl(addr) >> 0)); + sprintf(host->h_name, "%u.%u.%u.%u", NIPQUAD(addr)); host->h_addr = *sin; host->h_addr.sin_port = 0; /* ouch! */ |
