[BusyBox] Telnetd IPV6 patch

Jason Schoon floydpink at gmail.com
Mon May 16 00:19:17 UTC 2005


Yes, one way or the other. I just don't want to put ifdefs around every 
case, or create a great deal of extra code to fall back in a case that is 
essentially a mis-configuration. If someone enables IPv6, they really should 
know that their system supports it.

One of the products I work on we did have a similar issue though. We had 
common code that ran on two platforms, one supported IPv6 and the other did 
not. We made compatible types that were wrapped by ifdeffs to the 
appropriate types. This allowed everyone to simply use one type without 
ifdefs in the code, and they automatically got IPv6 support when it ran on 
the right platform.

I'll look into what the size difference would be to do something similar on 
Busybox.

On 5/15/05, Phil Blundell <pb at nexus.co.uk> wrote:
> 
> I'm not quite sure I understand what you're saying. Are you suggesting
> that there could be some kind of bb_ipv6_supported() function to check
> for AF_INET6 at runtime? I guess that would work, but it's not clear to
> me that it would be too much of a win.
> 
> That said, I guess there might be some mileage in pulling out the code
> to create a listening socket into a common function, so that applets
> like httpd and fakeidentd can share it. Then at least you'd only need
> to handle the compatibility stuff in one place.
> 
> p.
> 
> On Fri, 2005-05-13 at 17:05 -0500, Jason Schoon wrote:
> > This is something that should possibly be handled at a higher level in
> > busybox. The CONFIG_FEATURE_IPV6 could check for the existence of
> > AF_INET6. I don't know if I want to attempt that though.
> >
> > I plan on looking through some of the other net apps and updating
> > those that do not have IPv6 support yet.
> >
> > On 5/13/05, Phil Blundell <pb at nexus.co.uk> wrote:
> > On Tue, 2005-05-10 at 11:09 -0500, Jason Schoon wrote:
> > > I had previously submitted this to the list, but I think the
> > patch was
> > > mangled. This adds IPv6 support to the telnet daemon.
> > >
> > > Now that Rob is on the patch warpath (which I'm very
> > grateful for) I
> > > thought I would submit it again. This is a very unobtrusive
> > patch.
> >
> > > +#ifdef CONFIG_FEATURE_IPV6
> > > + master_fd = socket(AF_INET6, SOCK_STREAM, 0);
> > > +#else
> > > master_fd = socket(AF_INET, SOCK_STREAM, 0);
> > > +#endif
> >
> > This will mean that a busybox built with CONFIG_FEATURE_IPV6
> > won't work
> > if AF_INET6 is not available at run time (i.e. the kernel
> > lacks IPv6
> > support). Is that what you intended? Most other programs
> > tend to fall
> > back to AF_INET in that situation, though obviously that costs
> > a little
> > bit of extra code.
> >
> > It's good to see that someone is working on adding IPv6
> > support to more
> > of the busybox applets, though. Can I talk you into looking
> > at wget?
> >
> > p.
> >
> >
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20050515/5bc439d5/attachment-0001.htm 


More information about the busybox mailing list