Skip to contentSkip to conversation

tcp_sock variable initialization

DISCUSSION Armin Abfalterer 1 participant 1 message Sep 18, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi!

I need a control variable (ecnn_flags) in tcp_sock that should be set properly after the 3-way-handshake in tcp_create_openreq_child(). If I set the variable in its value is always 0 afterwards.

struct sock *tcp_create_openreq_child( ... )

{
	struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC);

	if (newsk != NULL) {
		struct tcp_sock *newtp;

		newtp = tcp_sk(newsk);
		newtp->ecnn_flags |= TCP_ECN_NONCE_OK;
	}
}

When I read the variable for the next outgoing segment the values is not set.

static int tcp_transmit_skb( ... )

{
	struct tcp_sock *tp;

	
	if (tp->ecnn_flags & TCP_ECN_NONCE_OK) {
		/*
		* never entered!!!!
		*/
	}
}

I'm quite sure that it has to do with the creation of the big socket when the connection enters TCP_ESTABLISHED but searching for hours didn't help to find the right place where my variable is re-initialized.

Any hint in the right direction would greatly appreciated!!! Thanks!

Armin