return NULL;
}
- /*
- * Seems to be issues on the file ptr for TCP_TIME_WAIT SKs.
- * http://kerneltrap.org/mailarchive/linux-netdev/2010/10/21/6287959
- * Not fixed in 3.0-r3 :(
- */
if (sk) {
MT_DEBUG("qtaguid: %p->sk_proto=%u "
"->sk_state=%d\n", sk, sk->sk_protocol, sk->sk_state);
+ /*
+ * When in TCP_TIME_WAIT the sk is not a "struct sock" but
+ * "struct inet_timewait_sock" which is missing fields.
+ */
if (sk->sk_state == TCP_TIME_WAIT) {
xt_socket_put_sk(sk);
sk = NULL;
}
sk = skb->sk;
+ /*
+ * When in TCP_TIME_WAIT the sk is not a "struct sock" but
+ * "struct inet_timewait_sock" which is missing fields.
+ * So we ignore it.
+ */
+ if (sk && sk->sk_state == TCP_TIME_WAIT)
+ sk = NULL;
if (sk == NULL) {
/*
* A missing sk->sk_socket happens when packets are in-flight