Hi Dave

 

I found a problem with the net -s command. It concerns line 1451 in net.c

 

    struct_socket = inode - SIZE(socket);

 

As I understand it we have the type

  struct socket_alloc {

      struct socket socket;

      struct inode vfs_inode;

  }

and we have the address of the second field and want the address of the first. The calculation, using the size of the socket struct, used in net.c require that the second field is aligned directly after the first field. This is unfortunately not true in cases I have seen. By changing the line 1451 to:

 

    struct_socket = inode - MEMBER_OFFSET("socket_alloc", "vfs_inode");

 

things work better.

 

Is this something you would like to change in Crash? I assume you will move the offset calculation to somewhere else so it is only performed once.

 

Jan