From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 26 10:45:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04CB9106564A for ; Fri, 26 Aug 2011 10:45:35 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id C00A18FC08 for ; Fri, 26 Aug 2011 10:45:34 +0000 (UTC) Received: by ywo32 with SMTP id 32so3217251ywo.13 for ; Fri, 26 Aug 2011 03:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=jj3f+mFCESUGksmSPvBnIHGBomDVCwyrx3SwdFWNicQ=; b=qhJFj07jFaS0DJnvQUWbe3T7pqCIzK+sTCGSbsctLMK034A4uYtdLyMTs56ux5l/Bl U3swRBaWSfjmFT/TvsV4WgtH8a/2QojQ/hZ3sErd8gREuJJVTfFBjqtp7uuIrH9lgc77 lu0MEMdMqqgkUS4JYHpvtLoIZkQieQUiK6Tf8= MIME-Version: 1.0 Received: by 10.150.166.3 with SMTP id o3mr2029955ybe.200.1314353836938; Fri, 26 Aug 2011 03:17:16 -0700 (PDT) Received: by 10.150.137.16 with HTTP; Fri, 26 Aug 2011 03:17:16 -0700 (PDT) Date: Fri, 26 Aug 2011 12:17:16 +0200 Message-ID: From: Monthadar Al Jaberi To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Dynamic kernel module linking problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2011 10:45:35 -0000 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