* Possible bug in nfs-utils source.
@ 2009-01-21 22:25 Ben Greear
2009-01-21 22:37 ` Chuck Lever
0 siblings, 1 reply; 5+ messages in thread
From: Ben Greear @ 2009-01-21 22:25 UTC (permalink / raw)
To: linux-nfs
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
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Possible bug in nfs-utils source.
2009-01-21 22:25 Possible bug in nfs-utils source Ben Greear
@ 2009-01-21 22:37 ` Chuck Lever
2009-01-21 22:53 ` Ben Greear
2009-01-22 0:00 ` Ben Greear
0 siblings, 2 replies; 5+ messages in thread
From: Chuck Lever @ 2009-01-21 22:37 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-nfs
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?
> 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
>
> --
> Ben Greear <greearb@candelatech.com>
> 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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Possible bug in nfs-utils source.
2009-01-21 22:37 ` Chuck Lever
@ 2009-01-21 22:53 ` Ben Greear
2009-01-22 0:00 ` Ben Greear
1 sibling, 0 replies; 5+ messages in thread
From: Ben Greear @ 2009-01-21 22:53 UTC (permalink / raw)
To: Chuck Lever; +Cc: linux-nfs
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?
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
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Possible bug in nfs-utils source.
2009-01-21 22:37 ` Chuck Lever
2009-01-21 22:53 ` Ben Greear
@ 2009-01-22 0:00 ` Ben Greear
2009-03-04 22:59 ` Steve Dickson
1 sibling, 1 reply; 5+ messages in thread
From: Ben Greear @ 2009-01-22 0:00 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
[-- Attachment #1: Type: text/plain, Size: 502 bytes --]
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@candelatech.com>
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
[-- Attachment #2: nfs_sizeof.patch --]
[-- Type: text/x-patch, Size: 445 bytes --]
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: Possible bug in nfs-utils source.
2009-01-22 0:00 ` Ben Greear
@ 2009-03-04 22:59 ` Steve Dickson
0 siblings, 0 replies; 5+ messages in thread
From: Steve Dickson @ 2009-03-04 22:59 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-nfs
Ben Greear wrote:
> 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@candelatech.com>
Committed...
steved.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-03-04 23:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 22:25 Possible bug in nfs-utils source Ben Greear
2009-01-21 22:37 ` Chuck Lever
2009-01-21 22:53 ` Ben Greear
2009-01-22 0:00 ` Ben Greear
2009-03-04 22:59 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox