lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <AAF075CA-ECF9-440C-AF33-3845544A284D@oracle.com>
Date:	Mon, 24 Nov 2008 21:03:32 -0500
From:	Chuck Lever <chuck.lever@...cle.com>
To:	Julius Volz <julius.volz@...il.com>
Cc:	netdev@...r.kernel.org
Subject: Re: Is there any function similar to inet_ntoa() in Kernel or NetFilter ?

On Nov 21, 2008, at Nov 21, 2008, 6:08 PM, Julius Volz wrote:
> On Thu, Nov 20, 2008 at 10:34 AM, Roar Bjørgum Rotvik <roarbr@...lde.org 
> > wrote:
>> Kunsheng Chen wrote:
>>> I am doing a project similar to iptable using netfilter, currently  
>>> I want
>>> to convert a IP address from 'long int' back to dotted address.
>>>
>>> I don't know whether there is some functions inside kernel or  
>>> netfilter
>>> that could make that like using inet_ntoa() in <arpa/inet.h>
>>
>> How about NIPQUAD and NIPQUAD_FMT (for IPv4):
>> http://lxr.linux.no/linux+v2.6.27.6/include/linux/kernel.h#L324
>> http://lxr.linux.no/linux+v2.6.27.6/include/linux/kernel.h#L319
>
> In the latest tree, there are now "%pI4" and "%pI6" format options  
> for printk.
>
> For example:
>
> printk(KERN_DEBUG "Address: %pI4\n", &v4_addr);

I've been watching this with some interest.  Is this API stable now?

Is there a way to pass a pointer to a sockaddr and get printk() to  
figure out whether it's is an AF_INET or AF_INET6 address, and display  
it appropriately?

Does it handle IPv6 scope IDs correctly?

Does it convert IPv6 mapped IPv4 addresses to dotted quad automatically?

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ