[Click] minor bug report with NetBSD

Eddie Kohler kohler at cs.ucla.edu
Fri May 19 02:34:44 EDT 2006


Hi Vivek,

It looks like KernelTun needs to be altered to work on NetBSD.  If you look at 
the source, in elements/userlevel/kerneltun.{cc,hh}, you'll see that there are 
several cases built in to the code, for Apple, FreeBSD, Linux (ethertap and 
universal tun), OpenBSD.  Would you like to provide us with a patch for NetBSD 
support??  We'd love it...

E


Vivek raghunathan wrote:
> Eddie,
> 
> SIOCSIFMTU is supported. NetBSD's tun device has a max mtu of TUNMTU = 
> 1500.
> 
> Another minor bug in the userlevel/kerneltun.cc file: it seems like
> NetBSD does not preprend a 4 byte address family field in front of the
> IP header. Thus, in elements/kerneltun.cc:348 or so, the af field is
> in fact the first 4 bytes of the IP header, resulting in  (af !=
> AF_INET && af != AF_INET6) codepath being entered and userspace does
> not receive the packets.
> 
> Vivek
> 
> 
> On 5/17/06, Eddie Kohler <kohler at cs.ucla.edu> wrote:
>> Hi Vivek,
>>
>> So the point of SIOCSIFMTU is to set the MTU.  Are you saying the 
>> NetBSD's tun
>> device CANNOT have an MTU larger than 1500?  Or that the SIOCSIFMTU 
>> ioctl is
>> not supported?
>>
>> Eddie
>>
>>
>> Vivek raghunathan wrote:
>> > The mail was partially sent.
>> >
>> > With NetBSD, the conf/test-tun.click script doesn't work.
>> >
>> > bash-3.1$ sudo userlevel/click conf/test-tun.click
>> > conf/test-tun.click:19: While initializing 'tun :: KernelTun':
>> >   SIOCSIFMTU failed: Invalid argument
>> > Router could not be initialized!
>> >
>> > Reason:
>> > minor bug in userlevel/kerneltun.cc:
>> >>     268 ifr.ifr_mtu = _mtu_out;
>> >>     269     if (ioctl(s, SIOCSIFMTU, &ifr) != 0)
>> >>     270         return errh->error("SIOCSIFMTU failed: %s", 
>> strerror(errno));
>> >
>> > NetBSD's tun device has a default MTU of 1500. _mtu_out is set to 2048
>> > by default, and NetBSD returns EINVAL on the ioctl.
>> >
>> > Fix:
>> > set DEFAULT_MTU to <= 1500
>> >
>> > -Vivek
>> >
>> >
>> > On 5/17/06, Vivek raghunathan <vivek.raghunathan at gmail.com> wrote:
>> >> bug in userlevel/kerneltun.cc:
>> >> 268 ifr.ifr_mtu = _mtu_out;
>> >>     269     if (ioctl(s, SIOCSIFMTU, &ifr) != 0)
>> >>     270         return errh->error("SIOCSIFMTU failed: %s", 
>> strerror(errno));
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> *************************************
>> >> Vivek Raghunathan,
>> >> PhD student,
>> >> University of Illinois, Urbana-Champaign
>> >>
>> >> Contact Details:
>> >> 1012 W. Clark St #31,
>> >> Urbana IL 61801
>> >>
>> >> ph: 217-766-1868 (cell)
>> >>     217-333-7541 (off)
>> >>
>> >
>> >
>>
> 
> 


More information about the click mailing list