Date: Tue, 31 Jul 2001 14:11:27 +0530 From: "Anjali Kulkarni" <anjali@indranetworks.com> To: <tlambert2@mindspring.com> Cc: <freebsd-hackers@FreeBSD.ORG> Subject: Re: inet_aton Message-ID: <008701c1199c$98684f50$0a00a8c0@indranet> References: <002d01c11728$d34723b0$0a00a8c0@indranet> <3B6325B7.D6CBC67A@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <tlambert2@mindspring.com> To: Anjali Kulkarni <anjali@indranetworks.com> Cc: <freebsd-hackers@FreeBSD.ORG> 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?008701c1199c$98684f50$0a00a8c0>