Chuck Lever wrote:
On Jan 21, 2009, at Jan 21, 2009, 5:25 PM, Ben Greear wrote:
I'm working on adding support to bind to local addresses, and
I noticed this code in nfs/getport.c
I believe the sizeof should probably be sizeof(*lb_addr) ?
Yes. Can you submit a patch to Steve and copy the list?
The patch is attached.
Signed-Off-By: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Thanks,
Ben
--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc http://www.candelatech.com
diff --git a/support/nfs/getport.c b/support/nfs/getport.c
index 47824a2..f5f7049 100644
--- a/support/nfs/getport.c
+++ b/support/nfs/getport.c
@@ -836,7 +836,7 @@ unsigned short nfs_getlocalport(const rpcprot_t program,
{
struct sockaddr_storage address;
struct sockaddr *lb_addr = (struct sockaddr *)&address;
- socklen_t lb_len = sizeof(lb_addr);
+ socklen_t lb_len = sizeof(*lb_addr);
unsigned short port = 0;
#ifdef NFS_GP_LOCAL