Question about getaddrinfo in Inet4AddressImpl.c

Chris Hegarty chris.hegarty at oracle.com
Mon Nov 14 06:15:04 PST 2011


I agree with Mikes comments, and here are a few of trivial ones of my own.

  - 'struct sockaddr_in6 him6' here is unused in getHostByAddr
  - caddr[16] - > caddr[4] in getHostByAddr

Thanks for making this change. It really cleans up this old code.

It is not your fault as the same is in Inet6AddressImpl, but I do see 
warnings building this:

"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 70: 
warning: declaration can not follow a statement
"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 71: 
warning: declaration can not follow a statement

If you have the time maybe you could resolve these?

Thanks,
-Chris.

On 14/11/2011 05:41, Charles Lee wrote:
> On 11/12/2011 04:07 AM, Mike Duigou wrote:
>> Some comments:
>>
>> Inet4AddressImpl.c:
>>
>> - why use bzero rather than posix memset?
>> - MAXHOSTNAMELEN is used. Shouldn't this be NI_MAXHOST as in the Inet6
>> version?
>>
>> Mike
>>
>>
>> On Nov 11 2011, at 06:53 , Neil Richards wrote:
>>
>>> On Wed, 2011-11-09 at 12:19 +0800, Charles Lee wrote:
>>>> On 11/09/2011 03:25 AM, Chris Hegarty wrote:
>>>>> Charles,
>>>>>
>>>>> Is it possible to fix up the style issues, etc that Neil pointed out,
>>>>> and have the webrev updated?
>>>>>
>>> <snip>
>>>> Hi Chris,
>>>>
>>>> Here it is. (attached)
>>>>
>>> And here it is, in webrev form [1].
>>>
>>> Regards, Neil
>>>
>>> [1] http://cr.openjdk.java.net/~ngmr/ojdk-229/webrev.01/
>>>
>>> --
>>> Unless stated above:
>>> IBM email: neil_richards at uk.ibm.com
>>> IBM United Kingdom Limited - Registered in England and Wales with
>>> number 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
>>> PO6 3AU
>>>
> I will change the patch:
> 1. bzero(&hints, sizeof(hints)) ---> memset(&hints, 0, sizeof(hints)) (2
> in Inet4AddressImpl, 2 in Inet6AddressImpl)
> 2. MAXHOSTNAMELEN in getaddrinfo in Inet4AddressImpl to NI_MAXHOST.
>
> Thanks for the review, Mike.
>



More information about the net-dev mailing list