lkml.org 
[lkml]   [2006]   [Mar]   [25]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 25 Mar 2006 01:11:38 -0600
FromBenjamin <>
SubjectModify the sock Structure!!
Hello! I try to modify the sock Structure in sock.h in order to record 
some data!
I just add a unsigned short in the end of the structure. such as:

struct sock {
    /* Socket demultiplex comparisons on incoming packets. */
    __u32            daddr;        /* Foreign IPv4 addr            */
    __u32            rcv_saddr;    /* Bound local IPv4 addr        */
         ...................................................................
        ....................................................................


  void                    (*destruct)(struct sock *sk);
  unsigned short        data;                 /*I put the unsigned short 
here*/
};


 I re-complied the kernel.  The kernel and network functions work 
normally so far.
However, I am a new guy for the kernel programming. I just wonder this 
modification is
safe or not. Is there any side-effect? Or I need to add additional code 
to avoid some unexpected
situation?  Thank you very much!

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-25 08:14    [from the cache]
©2003-2008