Hi Terry,
Thanks for your response. I am new to kernel programming, and so cud u tell
me why it is a bad idea to pass strings to the kernel? Is it due to static
memory is used etc.?
Actually, I am not passing strings to the kernel, I am writing code in
kernel which has a remote server's ip-address string, and I need to connect
to the remote server, so I need to use inet_aton.....
Anjali
----- Original Message -----
From: Terry Lambert <[EMAIL PROTECTED]>
To: Anjali Kulkarni <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, July 29, 2001 2:21 AM
Subject: Re: inet_aton
> > Anjali Kulkarni wrote:
> >
> > Hi,
> >
> > I want to use the function inet_aton() in the kernel code.
> > However, I found no kernel equivalent of this function int
> > the freebsd sources. I could find inet_ntoa(), but not
> > inet_aton(). Is it named by some other name or how can I
> > locate it?
>
> The kernel is not linked against the resolver library,
> which is where the network address manipulation functions
> come from (in FreeBSD, the resolver library has been rolled
> into libc; this is traditional, but makes it very hard to
> upgrade to newer versions when needed. In FreeBSD, the
> kernel isn't linked against the C library, either).
>
> You should pass in sockaddr structures, not strings, to the
> kernel, if you wish to pass network addresses to the kernel.
>
> As a general policy issue, I think that passing strings into
> the kernel for any reason is a bad idea. We tolerate it
> where we must (path name lookups), but any place else that
> takes a string is bad news (e.g. we will eventually get
> around to fixing mount at some point in the future).
>
> -- Terry
>
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message