Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2011 12:17:16 +0200
From:      Monthadar Al Jaberi <monthadar@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Dynamic kernel module linking problem
Message-ID:  <CA%2BsBSoK5EyjfC7R-ud__ZQDOOs-erzcbt=dKOOsksMdaUjtvag@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I have written a dynamic loadable module using DECLARE_MODULE in
FreeBSD-Current.

And I want to iterate through the ifnet list using following code snippet:

extern struct ifnethead ifnet;
...
struct ifnet *ifp, *ifp_temp;
TAILQ_FOREACH_SAFE(ifp, &ifnet, if_link, ifp_temp) {
		printf("%s\n", ifp->if_dname);
}

Compilation is fine, but when I load the module I get the following error:

...
/sbin/kldload -v module.ko
link_elf: symbol ifnet undefined
...

What am I doing wrong? Shouldn't kernel be able to link it on its own?

Grateful for any advice.
-- 
//Monthadar Al Jaberi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BsBSoK5EyjfC7R-ud__ZQDOOs-erzcbt=dKOOsksMdaUjtvag>