Skip to contentSkip to conversation

EXPORT_SYMBOL missing in the kernel?

DISCUSSION Pierre Rondou 3 participants 7 messages May 24, 2011 – May 25, 2011 netfilter

lore
Share & tools
lore
#0 lore raw

Hello,

I'm a student at the University of Liege, currently developing a NAT64 (see RFC 6146) module for Netfilter.

In order to develop this module, I had to use some in-kernel function, such as icmp_send, ip6_output, ip_finish_output, ... and many more.

But many of those functions didn't have an "EXPORT_SYMBOL" allowing them to be reachable from outside the kernel.

So, to be able to use them, I had to copy paste about 1500 lines of kernel source code (those functions + related functions). This makes the module hardly updatable as all those functions are likely to be updated.

Is there a reason why those functions are not associated with an "EXPORT_SYMBOL"?

Regards,

Pierre Rondou

#1 lore raw
Quoted 11 lines · Pierre Rondou

Hello,

I'm a student at the University of Liege, currently developing a NAT64 (see RFC 6146) module for Netfilter.

In order to develop this module, I had to use some in-kernel function, such as icmp_send, ip6_output, ip_finish_output, ... and many more.

But many of those functions didn't have an "EXPORT_SYMBOL" allowing them to be reachable from outside the kernel.

Quoted 6 lines

So, to be able to use them, I had to copy paste about 1500 lines of kernel source code (those functions + related functions). This makes the module hardly updatable as all those functions are likely to be updated.

Is there a reason why those functions are not associated with an "EXPORT_SYMBOL"?

We dont export all possible symbols (each export has a memory cost)

We export one symbol when its needed from a module.

Dont copy/paste code, but add EXPORT_SYMBOL when/if needed.

icmp_send() is for sure already exported (needed in various netfilter modules)

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 20 lines · Eric Dumazet
Quoted 11 lines · Pierre Rondou

Hello,

I'm a student at the University of Liege, currently developing a NAT64 (see RFC 6146) module for Netfilter.

In order to develop this module, I had to use some in-kernel function, such as icmp_send, ip6_output, ip_finish_output, ... and many more.

But many of those functions didn't have an "EXPORT_SYMBOL" allowing them to be reachable from outside the kernel.

Quoted 7 lines

So, to be able to use them, I had to copy paste about 1500 lines of kernel source code (those functions + related functions). This makes the module hardly updatable as all those functions are likely to be updated.

Is there a reason why those functions are not associated with an "EXPORT_SYMBOL"?

Quoted 10 lines

We dont export all possible symbols (each export has a memory cost)

We export one symbol when its needed from a module.

Dont copy/paste code, but add EXPORT_SYMBOL when/if needed.

icmp_send() is for sure already exported (needed in various netfilter modules)

Ok, thanks for the info.

Though, my module doesn't need a kernel recompilations as its developed for Xtables, I'm not likely to develop a kernel patch to apply for each kernel my module could be connected.

Of course, the best way would be to patch the currently dev kernel (2.6.39 if I take your word from previous mail) to use my module.
But I'm not a kernel developper and my previously proposed module (NATIVI, which had the same problem) didn't seem to get interest from kernel or Xtables developers :( --
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 5 lines · Pierre Rondou

Of course, the best way would be to patch the currently dev kernel (2.6.39 if I take your word from previous mail) to use my module.
But I'm not a kernel developper and my previously proposed module (NATIVI, which had the same problem) didn't seem to get interest from kernel or Xtables developers :(

On the contrary. If there was no interest, I would not have written a reply. But you seem to have chosen to ignore that and went away with "it fixed itself".

http://www.spinics.net/lists/netfilter-devel/msg18073.html

#4 lore raw

Hello Jan,

I appreciate your help !

This problem is not related with the problem I had at this moment.

The "old" problem was about an output problem with ip6_local_out. I was at this time on an old debian testing (between lenny and squeeze) and the update to "complete" squeeze solved the problem, so I thought that it was a problem related to my OS situation.

Now that you say that, I have realized that ip6_local_out (which I don't use anymore, I use ip6_output) was creating kernel panic when asked to send an IPv6 packet with a size higher than the link mtu, should have talked about it earlier though.

The little complain about NATIVI (http://www.spinics.net/lists/netfilter-devel/msg18248.html) was that no kernel / Xtables developers told me they wanted the module inside the kernel/Xtables or even sent me a remark about it and therefore could take care about the missing "EXPORT_SYMBOL". This module is developed inside Xtables and therefore doesn't need to recompile a kernel.

While I'm sending you an e-mail, I may contribute to your very interesting "Writing Netfilter modules" ebook.
I had to deal with checksums changes/update in both IPv4 and IPv6 and may contribute to this section (5.7) if you still need someone to :-).

Regards,

Pierre

Quoted 9 lines · Jan Engelhardt
Quoted 6 lines · Pierre Rondou

Of course, the best way would be to patch the currently dev kernel (2.6.39 if I take your word from previous mail) to use my module.
But I'm not a kernel developper and my previously proposed module (NATIVI, which had the same problem) didn't seem to get interest from kernel or Xtables developers :(

Quoted 6 lines

On the contrary. If there was no interest, I would not have written a reply. But you seem to have chosen to ignore that and went away with "it fixed itself".

http://www.spinics.net/lists/netfilter-devel/msg18073.html

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 5 lines · Pierre Rondou

The little complain about NATIVI
(http://www.spinics.net/lists/netfilter-devel/msg18248.html) was that no kernel/Xtables developers told me they wanted the module inside the kernel/Xtables

But they did not say "don't want" either :)

Sorry, I must have skipped over that mail somehow. It's still in my inbox, so that means the topic had not been closed.

The only other "excuse" I can give is that, on a closer look now, the mail did not contain a merge request, just an offer for help. (Wording: "If you believe that this module can be included is the Linux Kernel or in the Xtables-addons framework, I'll be glad and will help you in this task.")

If you, or somebody else, wants to have it merged, in either the kernel or Xtables-addons, please send in a patch, and we will discuss it from there on.

Quoted 2 lines

While I'm sending you an e-mail, I may contribute to your very interesting "Writing Netfilter modules" ebook.

If you replace .pdf in the URL by .lyx, you can get at the source of the document and make a patch against that if you like. Other ways to convey your additions are also acceptable - it is not required to be diff.

#6 lore raw
Quoted 18 lines · Jan Engelhardt
Quoted 5 lines · Pierre Rondou

The little complain about NATIVI
(http://www.spinics.net/lists/netfilter-devel/msg18248.html) was that no kernel/Xtables developers told me they wanted the module inside the kernel/Xtables

But they did not say "don't want" either :)

Sorry, I must have skipped over that mail somehow. It's still in my inbox, so that means the topic had not been closed.

The only other "excuse" I can give is that, on a closer look now, the mail did not contain a merge request, just an offer for help. (Wording: "If you believe that this module can be included is the Linux Kernel or in the Xtables-addons framework, I'll be glad and will help you in this task.")

Quoted 4 lines

If you, or somebody else, wants to have it merged, in either the kernel or Xtables-addons, please send in a patch, and we will discuss it from there on.

Ok, I didn't know how adding kernel functionalities works actually...
I'll propose a patch to get it added on current dev kernel a bit later (gotta finish writing my thesis first).

Quoted 9 lines
Quoted 4 lines

While I'm sending you an e-mail, I may contribute to your very interesting "Writing Netfilter modules" ebook.

If you replace .pdf in the URL by .lyx, you can get at the source of the document and make a patch against that if you like. Other ways to convey your additions are also acceptable - it is not required to be diff.

Ok, I'll send you a patch or something like that after I finished the writing of my thesis.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html