Possible bug in nfs-utils source.
Subsystems (2)
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) ?
unsigned short nfs_getlocalport(const rpcprot_t program,
const rpcvers_t version, const unsigned short protocol)
{
struct sockaddr_storage address;
struct sockaddr *lb_addr = (struct sockaddr *)&address;
socklen_t lb_len = sizeof(lb_addr);
unsigned short port = 0;Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 4 lines · Ben Greear
I'm working on adding support to bind to local addresses, and I noticed this code in
nfs/getport.cI believe the sizeof should probably be
sizeof(*lb_addr)?
Yes. Can you submit a patch to Steve and copy the list?
Quoted 20 lines
unsigned short nfs_getlocalport(const
rpcprot_tprogram,
constrpcvers_tversion, const unsigned short protocol){ struct sockaddr_storage address; struct sockaddr *lb_addr = (struct sockaddr *)&address; socklen_t lb_len = sizeof(lb_addr); unsigned short port = 0;Thanks,
BenSignature · 7 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Chuck Lever chuck[dot]lever[at]oracle[dot]com
Quoted 7 lines · Chuck Lever
Quoted 4 lines · Ben Greear
I'm working on adding support to bind to local addresses, and I noticed this code in
nfs/getport.cI believe the sizeof should probably be
sizeof(*lb_addr)?Yes. Can you submit a patch to Steve and copy the list?
Sure, but will be a bit...I'm half through passing local_address everywhere so I can bind to local IP addresses explicitly on multi-homed devices....
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 7 lines · Chuck Lever
Quoted 4 lines · Ben Greear
I'm working on adding support to bind to local addresses, and I noticed this code in
nfs/getport.cI 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.
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
support/nfs/getport.c +1 -1
@@ -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
Quoted 5 lines · Ben Greear
Quoted 4 lines · Chuck Lever
Quoted 3 lines · Ben Greear
I'm working on adding support to bind to local addresses, and I noticed this code in
nfs/getport.c
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
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 <[email protected]>
Committed...
steved.