diff mbox

[v2] tipc: fix build issue when building without IPv6

Message ID 9df97f7f63e5c844ede07f1e6ec45c4e@propriete.com.br
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Marcelo Ricardo Leitner March 20, 2015, 12:35 p.m. UTC
On Fri, 20 Mar 2015 10:09:26 +0800, Ying Xue <ying.xue@windriver.com>
wrote:
> On 03/20/2015 04:06 AM, David Miller wrote:
>> From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
>> Date: Thu, 19 Mar 2015 16:47:58 -0300
>> 
>>> We can't directly call ipv6_sock_mc_join() but should use the stub
>>> instead and protect it around IS_ENABLED.
>>>
>>> Fixes: d0f91938bede ("tipc: add ip/udp media type")
>>> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
>> 
> 
> Sorry, this patch doesn't work at all especially when IPV6=m and TIPC=y.
> For
> example, when we use the combination of the kernel config options, error
> appears
> like:
> 
> net/built-in.o: In function `tipc_udp_send_msg':
>
/home/ying/work/tipc/tipc2.0/net-next-2.6-debug/net/tipc/udp_media.c:196:
> undefined reference to `ip6_dst_lookup'
> make: *** [vmlinux] Error 1
> 
> Instead, I ever tried to fix the issue several days ago. Please refer to
> the thread:
> 
> https://patchwork.ozlabs.org/patch/448836/
> 
> According to the suggestion David gave lastly, we should separate the
UDP
> media
> as an independent module, make TIPC_MEDIA_UDP depend on (IPV6 ||
IPV6=n),
> and
> mark TIPC_MEDIA_UDP tristate. Now I am busy doing this following the
> proposal.

I missed your work on the issue, Ying, sorry, otherwise I would have
replied
to that thread instead of posting the patch.

I think David and Willem suggestion were more about the dependencies
than fixing the build issue itself. I mean, if some part of TIPC really
needs IPv6 in order to work or something like that.

So if all we want to do if fix the build issue, I have another suggestion.
When we have IPV6=m and TIPC=y, just have to use the stub too.

(cut & pasted)
                        goto tx_error;
                ttl = ip6_dst_hoplimit(ndst);

then it builds fine here. That is, assuming that you can't reach this code
while
ipv6 module is unloaded.. (I didn't check that) what do you think?

Regards,
Marcelo

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ying Xue March 23, 2015, 3 a.m. UTC | #1
On 03/20/2015 08:35 PM, Marcelo wrote:
> I think David and Willem suggestion were more about the dependencies
> than fixing the build issue itself. I mean, if some part of TIPC really
> needs IPv6 in order to work or something like that.
> 
> So if all we want to do if fix the build issue, I have another suggestion.
> When we have IPV6=m and TIPC=y, just have to use the stub too.
> 
> (cut & pasted)
> --- a/net/tipc/udp_media.c
> +++ b/net/tipc/udp_media.c
> @@ -193,7 +193,7 @@ static int tipc_udp_send_msg(struct net *net, struct
> sk_buff *skb,
>                         .saddr = src->ipv6,
>                         .flowi6_proto = IPPROTO_UDP
>                 };
> -               err = ip6_dst_lookup(ub->ubsock->sk, &ndst, &fl6);
> +               err = ipv6_stub->ipv6_dst_lookup(ub->ubsock->sk, &ndst,
> &fl6);
>                 if (err)
>                         goto tx_error;
>                 ttl = ip6_dst_hoplimit(ndst);
> 
> then it builds fine here. That is, assuming that you can't reach this code
> while
> ipv6 module is unloaded.. (I didn't check that) what do you think?

It seems that your above change is useless to kill the error. For instance, when
I apply it into my project, below build error appears:

net/tipc/udp_media.c: In function ‘tipc_udp_send_msg’:
net/tipc/udp_media.c:196:18: error: ‘const struct ipv6_stub’ has no member named
‘ip6_dst_lookup’
make[2]: *** [net/tipc/udp_media.o] Error 1
make[1]: *** [net/tipc] Error 2
make: *** [net] Error 2

In my opinion, we have to follow David's suggestion dividing the udp_media.c as
an separate module.

Regards,
Ying

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marcelo Ricardo Leitner March 23, 2015, 11:33 a.m. UTC | #2
On 23-03-2015 00:00, Ying Xue wrote:
> On 03/20/2015 08:35 PM, Marcelo wrote:
>> I think David and Willem suggestion were more about the dependencies
>> than fixing the build issue itself. I mean, if some part of TIPC really
>> needs IPv6 in order to work or something like that.
>>
>> So if all we want to do if fix the build issue, I have another suggestion.
>> When we have IPV6=m and TIPC=y, just have to use the stub too.
>>
>> (cut & pasted)
>> --- a/net/tipc/udp_media.c
>> +++ b/net/tipc/udp_media.c
>> @@ -193,7 +193,7 @@ static int tipc_udp_send_msg(struct net *net, struct
>> sk_buff *skb,
>>                          .saddr = src->ipv6,
>>                          .flowi6_proto = IPPROTO_UDP
>>                  };
>> -               err = ip6_dst_lookup(ub->ubsock->sk, &ndst, &fl6);
>> +               err = ipv6_stub->ipv6_dst_lookup(ub->ubsock->sk, &ndst,
>> &fl6);
>>                  if (err)
>>                          goto tx_error;
>>                  ttl = ip6_dst_hoplimit(ndst);
>>
>> then it builds fine here. That is, assuming that you can't reach this code
>> while
>> ipv6 module is unloaded.. (I didn't check that) what do you think?
>
> It seems that your above change is useless to kill the error. For instance, when
> I apply it into my project, below build error appears:
>
> net/tipc/udp_media.c: In function ‘tipc_udp_send_msg’:
> net/tipc/udp_media.c:196:18: error: ‘const struct ipv6_stub’ has no member named
> ‘ip6_dst_lookup’
> make[2]: *** [net/tipc/udp_media.o] Error 1
> make[1]: *** [net/tipc] Error 2
> make: *** [net] Error 2
>
> In my opinion, we have to follow David's suggestion dividing the udp_media.c as
> an separate module.

If you had checked which members ipv6_stub has, you would have noticed 
the member name has an extra 'v' than the actual function name.
ip6_ -> ipv6_

How it goes then?

Regards,
Marcelo

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -193,7 +193,7 @@  static int tipc_udp_send_msg(struct net *net, struct
sk_buff *skb,
                        .saddr = src->ipv6,
                        .flowi6_proto = IPPROTO_UDP
                };
-               err = ip6_dst_lookup(ub->ubsock->sk, &ndst, &fl6);
+               err = ipv6_stub->ipv6_dst_lookup(ub->ubsock->sk, &ndst,
&fl6);
                if (err)