Results 1 to 2 of 2
Thread: bug in struct sock data member
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Sep 2004
bug in struct sock data member
i'm working with the linux kernel, version 2.6.7.
i added an index to struct sock and i'm incrementing it in the function
tcp_transmit_skb every time a packet is being send.
when i'm debugging this function (by printing to /var/log/messages), i see
that there are two processes that send packets. as long as one process is
working alone, the index value is as expected but when another process is
interfering by generate the tcp_accept function, it gets (the secondd process) the value '0' to the index, which is ok, but when the first process returns to run it gets the value of the second index that just stopped running.
for example, process number 2016 is running, it visits tcp_transmit_skb 4 times so sk->index = 4. while it's in the function tcp_rcv_established, process number 1632 starts to run by generating tcp_accept (its sk->index=0, as expected), it visits tcp_transmit_skb 2 times and its sk->index become 2. now process number 2016 returns to run, i would expect that its sk->index will be 4 but unfortunately it's 2.
i'm checking sk->sk_socket->inode->i_uid for both processes and it's different (500 and 0).
does someone have any idea what is my problem???
- Join Date
- Oct 2001
- Täby, Sweden
What is the reason for two processes to be accessing the sock? How are they related to each other?