sax0406
sax0406

Reputation: 81

Send ip packet via kernel module

I'm writing a kernel module which creates an ip packet and sends it to the required destination. I'm using the function ip_forward() declared in <net/ip.h>. When I try to compile the code, I get an error:

"ip_forward" undefined!

Upvotes: 0

Views: 703

Answers (1)

ugoren
ugoren

Reputation: 16449

ip_forward isn't exported (no EXPORT_SYMBOL), so you can't use it from kernel modules.

It's also an internal function of the IP stack, not meant to be called directly. It may have all sorts of assumptions, which would give you trouble.

Perhaps try ip_queue_xmit, though I'm not 100% sure it's usable.

Upvotes: 1

Related Questions