Thank you for solving this, Amit.

BR
///jon

> -----Original Message-----
> From: Amit Jain <[email protected]>
> Sent: 12-Nov-18 09:37
> To: [email protected]
> Cc: [email protected]
> Subject: Re: [tipc-discussion] Compilation error
> 
> Hi Andy,
> We also faced this issue when upgrading to RHEL 7.5 .
> Below is the diff, which solved the issue for us. Please check if it helps.
> 
> diff --git a/tipc/netlink.c b/tipc/netlink.c index a96575f..16ddd40 100644
> --- a/tipc/netlink.c
> +++ b/tipc/netlink.c
> @@ -68,14 +68,6 @@ static int handle_cmd(struct sk_buff *skb, struct
> genl_info *info)
>         return 0;
>  }
> 
> -static struct genl_family tipc_genl_family = {
> -       .id             = GENL_ID_GENERATE,
> -       .name           = TIPC_GENL_NAME,
> -       .version        = TIPC_GENL_VERSION,
> -       .hdrsize        = TIPC_GENL_HDRLEN,
> -       .maxattr        = 0,
> -};
> -
>  static struct genl_ops tipc_genl_ops[] = {
>      {
>          .cmd           = TIPC_GENL_CMD,
> @@ -83,14 +75,23 @@ static struct genl_ops tipc_genl_ops[] = {
>      }
>  };
> 
> +
> +static struct genl_family tipc_genl_family = {
> +       .name           = TIPC_GENL_NAME,
> +       .version        = TIPC_GENL_VERSION,
> +       .hdrsize        = TIPC_GENL_HDRLEN,
> +       .maxattr        = 0,
> +       .ops            = tipc_genl_ops,
> +       .n_ops          = ARRAY_SIZE(tipc_genl_ops),
> +};
> +
>  static int tipc_genl_family_registered;
> 
>  int tipc_netlink_start(void)
>  {
>         int res;
> 
> -       res = genl_register_family_with_ops(&tipc_genl_family,
> -               tipc_genl_ops);
> +       res = genl_register_family(&tipc_genl_family);
>         if (res) {
>                 pr_err("Failed to register netlink interface\n");
>                 return res;
> 
> 
> Amit
> 
> 
> On Tue, Nov 6, 2018 at 9:56 AM Andy Stec <[email protected]> wrote:
> 
> > We are trying to compile an older version of tipc with the RHEL 7.5
> > kernel (3.10.0.862.14.4).  We are getting the following error:
> >
> > /root/rpmbuild/BUILD/tipc/tipc/netlink.c: In function 'tipc_netlink_start':
> > /root/rpmbuild/BUILD/tipc/tipc/netlink.c:90:2: error: implicit
> > declaration of function 'genl_register_family_with_ops'
> > [-Werror=implicit-function-declaration]
> >   res = genl_register_family_with_ops(&tipc_genl_family,
> >
> > This code compiled fine with RHEL 7.4.  Based on what we found on the
> > internet it seems that genl_register_family_with_ops function has been
> > removed and we're supposed to use genl_register_family instead.
> > However, the details of what needs to be passed to the function,
> specifically the
> > contents of the tipc_genl_family struct are unclear.   This issue has been
> > resolved in the tipc version that corresponds to the 4.10 kernel,
> > however there is a big delta in the code between that version and the
> version we
> > are using.   Below is the snippet of code in question, we would appreciate
> > any input as what to needs to change in this code:
> >
> > static struct genl_family tipc_genl_family = {
> >         .id             = GENL_ID_GENERATE,
> >        .name           = TIPC_GENL_NAME,
> >         .version        = TIPC_GENL_VERSION,
> >         .hdrsize        = TIPC_GENL_HDRLEN,
> >         .maxattr        = 0,
> > };
> >
> > static struct genl_ops tipc_genl_ops = {
> >         .cmd            = TIPC_GENL_CMD,
> >         .doit           = handle_cmd,
> > };
> >
> > static int tipc_genl_family_registered;
> >
> > int tipc_netlink_start(void)
> > {
> >         int res;
> >
> >         res = genl_register_family_with_ops(&tipc_genl_family,
> >                 &tipc_genl_ops, 1);
> >         if (res) {
> >                 pr_err("Failed to register netlink interface\n");
> >                 return res;
> >         }
> >
> >         tipc_genl_family_registered = 1;
> >         return 0;
> > }
> > This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION
> intended
> > solely for the use of the addressee(s). If you are not the intended
> > recipient, please notify so to the sender by e-mail and delete the
> > original message. In such cases, please notify us immediately at
> > [email protected] <mailto:[email protected]> . Further, you are not to
> > copy, disclose, or distribute this e-mail or its contents to any
> > unauthorized person(s). Any such actions are considered unlawful. This e-
> mail may contain viruses.
> > Infinite has taken every reasonable precaution to minimize this risk,
> > but is not liable for any damage you may sustain as a result of any
> > virus in this e-mail. You should carry out your own virus checks
> > before opening the e-mail or attachments. Infinite reserves the right
> > to monitor and review the content of all messages sent to or from this
> > e-mail address. Messages sent to or from this e-mail address may be
> > stored on the Infinite e-mail system.
> >
> >
> >
> > ***INFINITE******** End of Disclaimer********INFINITE********
> >
> > _______________________________________________
> > tipc-discussion mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/tipc-discussion
> >
> 
> _______________________________________________
> tipc-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tipc-discussion


_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to