[Click] patchless click patches

Eddie Kohler kohler at cs.ucla.edu
Mon Jan 17 14:15:16 EST 2011


Hi Joonwoo,

Late response to this question.  The point of a TYPE IP FromHost module 
is that the device has NO mac header.  It expects unencapsulated IP 
packets.  This has worked in the past, at least.  Since it emits 
unencapsulated IP packets, there is no point in setting its MAC address.

Eddie


On 11/14/10 2:32 PM, Joonwoo Park wrote:
> Hi,
>
> Thanks for testing.  Can you try this patch once again?
> It seems to me linuxmodule FromHost never allowed to set ethernet
> address by it's argument if type is IP.
> It has been clearing ethernet address with 0 always after parsing argument.
>
> Eddie,
> Would you mind to shed on me why FromHost is doing that?
>
> Thanks,
> Joonwoo
>
> ---
> diff --git a/elements/linuxmodule/fromhost.cc b/elements/linuxmodule/fromhost.cc
> index 8b76672..6bde049 100644
> --- a/elements/linuxmodule/fromhost.cc
> +++ b/elements/linuxmodule/fromhost.cc
> @@ -205,9 +205,7 @@ FromHost::configure(Vector<String>  &conf,
> ErrorHandler *errh)
>       }
>
>       // set type
> -    if (type == "IP")
> -       _macaddr = EtherAddress();
> -    else if (type != "ETHER"&&  type != "")
> +    if (type != "ETHER"&&  type != "IP")
>          return errh->error("bad TYPE");
>
>       // set up queue
> ---
>
> On Sun, Nov 14, 2010 at 2:37 AM, Sascha Alexander Jopen
> <jopen at informatik.uni-bonn.de>  wrote:
>> Hey,
>>
>> thank you for the patch, Joonwoo.
>> Now i can start the click instance without further crashes.
>> I have problems setting the encap type and mac address of the fake
>> device, though. Although i specified a mac address in the click script,
>> the encap type of the tun/tap interface is UNSPEC with no mac address set.
>> Is it possible to set these parameters manually after the click kernel
>> module is installed? Will click detect those changes?
>> Not being able to set the fake interfaces ip address shouldn'z be that
>> much of a problem, i think. Is this due to missing ioctl's in newer
>> kernels or what is the problem here?
>>
>> Thanks,
>> Sascha
>>
>> Am 14.11.2010 07:34, schrieb Joonwoo Park:
>>> Hello,
>>>
>>> Can you please try attached patch to see if it works for you?
>>> You have to revert patch 07/12 if you applied already to apply attached patch.
>>>
>>> p.s I couldn't find a nice way to set ip address from kernel module
>>> without patching kernel therefore you have to set ip address of your
>>> device after configuring FromHost. (You won't be able to set it by
>>> FromHost argument)
>>> Setting ethernet address by FromHost argument should be still working.
>>>
>>> Joonwoo.
>>>
>>> On Tue, Nov 9, 2010 at 9:25 PM, Joonwoo Park<joonwpark81 at gmail.com>  wrote:
>>>> Hi,
>>>>
>>>> Thanks for call trace and simplified config.
>>>> I should have allocated netdev_ops and assign it to dev->netdev_ops.
>>>> It seem to me dev->netdev_ops is NULL.
>>>> My bad.  I'll fix and submit new patch as soon as I have chance.
>>>>
>>>> Joonwoo
>>>>
>>>> On Tue, Nov 9, 2010 at 3:30 PM, Sascha Alexander Jopen
>>>> <jopen at informatik.uni-bonn.de>  wrote:
>>>>> Hi,
>>>>>
>>>>> i finally removed the mentioned 'false' requirement and the element was
>>>>> compiled and integrated into the kernel module. When installing the
>>>>> module with a click script using click-install, the module crashes with
>>>>> a null pointer dereference, however. I didn't have the time to do
>>>>> further tests with simpler click scripts. I will check this within the
>>>>> next days.
>>>>> Attached you will find the kernel call trace for this null pointer
>>>>> dereference. The corresponding click part:
>>>>>
>>>>> AddressInfo(localDevice DEVNAME:ip/24 DEVNAME:eth);
>>>>> FromHost(fake0, localDevice:ipnet, ETHER localDevice:eth, TYPE IP) ->  ...
>>>>>
>>>>> DEVNAME will be replaced by an existing network device.
>>>>> Maybe this is sufficient for someone to detect the problem.
>>>>>
>>>>> Sascha
>>>>>
>>>>> Am 09.11.2010 22:27, schrieb Sascha Alexander Jopen:
>>>>>> Hello,
>>>>>>
>>>>>> the FromHost element simply does not exist after compiling. ToHost,
>>>>>> ToHostSniffers and ToDevice, as well as FromDevice, are compiled,
>>>>>> FromHost not.
>>>>>> When feeding a click script to click-install the following error is emitted:
>>>>>> <stdin>:144: unknown element class 'FromHost'
>>>>>>
>>>>>> fromhost.cc contains
>>>>>> ELEMENT_REQUIRES(AnyDevice linuxmodule false)
>>>>>> The 'false' requirement, may be this prevents compiling this element?
>>>>>>
>>>>>> Sascha
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 09.11.2010 22:06, schrieb Joonwoo Park:
>>>>>>> Hi Sascha,
>>>>>>>
>>>>>>> I guess I'm not quite following FromHost issue here.
>>>>>>>
>>>>>>> Are you having build failure or any other problem?
>>>>>>> When I submitted patchless patches, I also built and fixes FromHost
>>>>>>> element and confirmed it's building.  I haven't tested element though.
>>>>>>> Did you apply '07/12 FromHost: netdev_ops for linux 2.6.33+'?
>>>>>>> http://www.mail-archive.com/click@amsterdam.lcs.mit.edu/msg04242.html
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Joonwoo
>>>>>>>
>>>>>>> On Tue, Nov 9, 2010 at 11:42 AM, Sascha Alexander Jopen
>>>>>>> <jopen at informatik.uni-bonn.de>  wrote:
>>>>>>>> Hey,
>>>>>>>>
>>>>>>>> i compiled for a recent kernel from ubuntu, namely 2.6.35-22-generic. I
>>>>>>>> didn't apply your NETREG_REGISTERED patch, but it seems, everything
>>>>>>>> compiled fine.
>>>>>>>> I think this patch part is included in Joonwoos "[PATCH 04/12]
>>>>>>>> Configury: prepend net_device namespace for NETREG_REGISTERED"
>>>>>>>> As the enum in question is part of the net_device struct, everything
>>>>>>>> should work as expected. Applying your patch leads to compiler errors on
>>>>>>>> my system.
>>>>>>>>
>>>>>>>> So basically i am right, that FromHost is completely missing, currently?
>>>>>>>> It would be nice, if someone could point me to the right direction. What
>>>>>>>> is the problematic part in implementing this element?
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Sascha
>>>>>>>>
>>>>>>>> Am 09.11.2010 19:35, schrieb Roman Chertov:
>>>>>>>>> Sascha,
>>>>>>>>>
>>>>>>>>> What kernel version did you use?  It appears that for 2.6.35 and above the
>>>>>>>>> NETREG_REGISTERED fix is required as well.  If you start on updating FromHost, I
>>>>>>>>> will be glad to give you a hand.
>>>>>>>>>
>>>>>>>>> Roman
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, 05 Nov 2010 20:02:38 +0100 Sascha Alexander Jopen
>>>>>>>>> <jopen at informatik.uni-bonn.de>  wrote
>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> i tried click patchless today. I used those patches from Joonwoo, which
>>>>>>>>>> didn't make it into the repository till now. Especially the patches to
>>>>>>>>>> fixincludes and the configure scripts were necessary.
>>>>>>>>>>
>>>>>>>>>> It seems the FromHost element is not included during build. I know this
>>>>>>>>>> was the last element which had to be done, but is it really still not
>>>>>>>>>> finished? What are the missing parts for this element to work?
>>>>>>>>>>
>>>>>>>>>> We are using click userlevel and kernel level isn't really necessary but
>>>>>>>>>> still nice to have. So maybe i could use some spare time to finish the
>>>>>>>>>> FromHost element, if there isn't that much missing.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>> Sascha Jopen
>>>>>>>>>>
>>>>>>>>>> On 11/03/10 17:42, Roman Chertov wrote:
>>>>>>>>>>> This will also require Joonwoo's PATCH1/12.  It removes #include
>>>>>>>>>>> <linux/autoconf.h>    from configure.in
>>>>>>>>>>>
>>>>>>>>>>> On Tue, 02 Nov 2010 18:44:32 -0700 "Roman Chertov"<rchertov at cs.ucsb.edu>
>>>>>>>>>>> wrote
>>>>>>>>>>>
>>>>>>>>>>>> Hello,
>>>>>>>>>>>>
>>>>>>>>>>>> This works on Fedora 13 running 2.6.35.8 SMP kernel.  The second patch is
>>>>>>>>>>>> based
>>>>>>>>>>>> on patches 2/12 and 3/12 that Joonwoo released.  I had to add the
>>>>>>>>>>>> NETREG_REGISTERED patch due to scoping issues when an enum declared in
>>>>>>>>>>>> net_device is used.  Otherwise, the code is same as in github master
>>>>>>>>>>>> branch.
>>>>>>>>>>>> I
>>>>>>>>>>>> am not sure if there is a more elegant way to solve that issue.
>>>>>>>>>>>>
>>>>>>>>>>>> Roman
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> click mailing list
>>>>>>>>>>> click at amsterdam.lcs.mit.edu
>>>>>>>>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> click mailing list
>>>>>>>>>> click at amsterdam.lcs.mit.edu
>>>>>>>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> click mailing list
>>>>>>>> click at amsterdam.lcs.mit.edu
>>>>>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> click mailing list
>>>>>> click at amsterdam.lcs.mit.edu
>>>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> click mailing list
>>>>> click at amsterdam.lcs.mit.edu
>>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>>>
>>>>>
>>>>
>>
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list