Re: dereferencing pointer to incomplete type error (was Re: Need Help)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think he should be including <net/sock.h>. <linux/sock.h> does not exist.

-Vishwas.



Ed L Cashin wrote:
Please try to use subjects that accurately reflect the subject of the
message. You need help, sure, but that's not what the email is
about.


Talib Alm <talibalm@hotmail.com> writes:


I am writting netfilter call back function (see in_packet function in
the attached file).

I am getting error

network.c:32: dereferencing pointer to incomplete type


If this is what I think it is, it's a C issue and not a kernel issue.
I think this is the error you get when the compiler needs to know the
definition of a struct but the struct isn't defined in the current
translation unit.


Cannot figure out why. Since  struct sk_buff **pskb points to sock
struct and sock struct has a field ny the name of family.

Please help

Usman
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>

#include <linux/errno.h>
#include <linux/types.h>

#include <linux/socket.h>


Try including linux/sock.h if you want to use the sk member of the
struct sk_buff.  Otherwise struct sock isn't defined.

...

struct sk_buff **pskb,

...


printk("sk->family = %x\n", (*pskb)->sk->family);




--
--
Vishwas Raman
Software Engineer, Eternal Systems, Inc,
5290 Overpass Rd, Bldg D, Santa Barbara. CA 93111
Email: vishwas@eternal-systems.com
Tel:   (805) 696-9051 x246
Fax:   (805) 696-9083
URL:   http://www.eternal-systems.com/

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux