[Click] Patchless click 2.0.1 on CentOS 6.0 (was: prepend net_device namespace for NETREG_REGISTERED)

Cliff Frey cliff at meraki.com
Fri Oct 21 15:56:38 EDT 2011


You could try adding --disable-linux-symbols to the configure command...
not sure if it'll fix the issue for you or not though.

(this will break click packages... so if you need to use those, then this
isn't the right fix)

If that does fix it, then my guess is that the bug is in click-buildtool
ksyms... but again, I'm not sure.

Cliff

On Fri, Oct 21, 2011 at 9:17 AM, Walter Cerroni <walter.cerroni at unibo.it>wrote:

> Hi all,
>
> we were trying to install click 2.0.1 patchless on a CentOS 6.0 (kernel
> version 2.6.32-71)  and we got several instances of thefollowing error:
>
> click-2.0.1/include/click-linuxmodule/include0/linux/netdevice.h:2080:
> error: ‘NETREG_REGISTERED’ was not declared in this scope
>
> This is something that was already discussed and solved in the list (see
> below). However, it seems that the patch suggested by Eddie was not
> implemented in click 2.0.1 (could not even find it applied in github). So
> we tried to apply the suggested changes and the compilation phase completed
> successfully (you can find the relevant patch at the bottom of this
> message, if you are interested).
>
> However, during the linking phase we got the following error:
>
> -----------------------------------------------------------
> make[1]: Entering directory `/root/click-2.0.1/userlevel'
> make[1]: Nothing to be done for `all'.
> make[1]: Leaving directory `/root/click-2.0.1/userlevel'
> make[1]: Entering directory `/root/click-2.0.1/linuxmodule'
> make -C /lib/modules/2.6.32-71.el6.i686/build
> M=/root/click-2.0.1/linuxmodule  modules
> make[2]: Entering directory `/usr/src/kernels/2.6.32-71.el6.i686'
>   Building modules, stage 2.
>   MODPOST 2 modules
>   LD [M]  /root/click-2.0.1/linuxmodule/click.ko.unsigned
> `__pcpu_unique_click_device_unreceivable_sk_buff' referenced in section
> `__ksymtab' of /root/click-2.0.1/linuxmodule/click.o: defined in discarded
> section `.discard' of /root/click-2.0.1/linuxmodule/click.o
> `__pcpu_scope_click_device_unreceivable_sk_buff' referenced in section
> `__ksymtab' of /root/click-2.0.1/linuxmodule/click.o: defined in discarded
> section `.discard' of /root/click-2.0.1/linuxmodule/click.o
> make[3]: *** [/root/click-2.0.1/linuxmodule/click.ko.unsigned] Error 1
> make[2]: *** [modules] Error 2
> make[2]: Leaving directory `/usr/src/kernels/2.6.32-71.el6.i686'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/root/click-2.0.1/linuxmodule'
> make: *** [linuxmodule] Error 2
> -----------------------------------------------------------
>
> Any clue about what the problem could be? Any suggestion on how to
> proceed? (Either try and solve this one or just forget about it and use a
> different kernel/distribution?)
>
>
> Thank you.
>
>
> Walter
>
>
>
> on 01/16/2011 11:36 PM Eddie Kohler wrote:
> > My patch for this will shift the enum definitions out of the net_device
> > scope, so the constants are still global.
> >
> > THANKS AGAIN!!
> > Eddie
> >
> >
> > On 10/3/10 8:09 PM, Joonwoo Park wrote:
> >> Hi Eddie,
> >>
> >> I believe we cannot put beginning and end of line markers.
> >> Please see netdev_name() from include/linux/netdevice.h.  (presumably
> >> only in 2.6.35+?)
> >>
> >> --
> >> static inline const char *netdev_name(const struct net_device *dev)
> >> {
> >>           if (dev->reg_state != NETREG_REGISTERED)
> >>                   return "(unregistered net_device)";
> >>           return dev->name;
> >> }
> >> --
> >>
> >> Thanks,
> >> Joonwoo
> >>
> >> On Wed, Sep 29, 2010 at 4:06 PM, Eddie Kohler<kohler at cs.ucla.edu>
> wrote:
> >>> Should the before portion of the s{} have beginning-of-line and
> end-of-line
> >>> markers?  And can you include in the message an example of an offending
> >>> line?
> >>>
> >>> Eddie
> >>>
> >>>
> >>> On 09/25/2010 10:29 PM, Joonwoo Park wrote:
> >>>>
> >>>> eliminate syntax error below:
> >>>> error: ‘NETREG_REGISTERED’ was not declared in this scope
> >>>>
> >>>> Signed-off-by: Joonwoo Park<joonwpark81 at gmail.com>
> >>>> ---
> >>>>    linuxmodule/fixincludes.pl |    3 +++
> >>>>    1 files changed, 3 insertions(+), 0 deletions(-)
> >>>>
> >>>> diff --git a/linuxmodule/fixincludes.pl b/linuxmodule/fixincludes.pl
> >>>> index 5553d9a..4088643 100755
> >>>> --- a/linuxmodule/fixincludes.pl
> >>>> +++ b/linuxmodule/fixincludes.pl
> >>>> @@ -211,6 +211,9 @@ sub one_includeroot ($$) {
> >>>>              if ($d eq "kobject.h") {
> >>>>                  s{(^\#include \<linux\/sysfs.h\>(.*\n)*)(^enum
> >>>>
> kobj_ns_type\s\{\n([^\}].*\n)*\}\;)((.*\n)*)}{"$3\n$1\/*\n$3\n*\/$5"}emg;
> >>>>              }
> >>>> +           if ($d eq "netdevice.h") {
> >>>> +               s{(.*)(\(.*\b)(NETREG_.+)(\b\))}{#ifdef
> >>>> __cplusplus\n$1$2net_device::$3$4\n#else\n$1$2$3$4\n#endif}g;
> >>>> +           }
> >>>>
> >>>>              # unquote.
> >>>>              $_ = sunprotect($_);
> >>>
> >
> > _______________________________________________
> > click mailing list
> > click at amsterdam.lcs.mit.edu
> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >
>
> ------------------------------------------------------------------
>
> Working dir: include/click-linuxmodule/include0/linux
>
>
> --- a/netdevice.h       2011-10-21 16:28:31.793904000 +0200
> +++ b/netdevice.h       2011-10-21 16:28:39.772087167 +0200
> @@ -698,6 +698,14 @@
>   *     moves out.
>   */
>
> +enum netreg_dev_state { NETREG_UNINITIALIZED=0,
> +       NETREG_REGISTERED,      /* completed register_netdevice */
> +       NETREG_UNREGISTERING,   /* called unregister_netdevice */
> +       NETREG_UNREGISTERED,    /* completed unregister todo */
> +       NETREG_RELEASED,                /* called free_netdev */
> +       NETREG_DUMMY,           /* dummy device for NAPI poll */
> +};
> +
>  struct net_device
>  {
>
> @@ -913,13 +921,7 @@
>         struct net_device       *link_watch_next;
>
>         /* register/unregister state machine */
> -       enum { NETREG_UNINITIALIZED=0,
> -              NETREG_REGISTERED,       /* completed register_netdevice */
> -              NETREG_UNREGISTERING,    /* called unregister_netdevice */
> -              NETREG_UNREGISTERED,     /* completed unregister todo */
> -              NETREG_RELEASED,         /* called free_netdev */
> -              NETREG_DUMMY,            /* dummy device for NAPI poll */
> -       } reg_state;
> +       enum netreg_dev_state reg_state;
>
>         /* Called from unregister, can be used to call free_netdev */
>         void (*destructor)(struct net_device *dev);
>
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list