An issue on one network development.
Subsystems (2)
Dear all,
HELP!
I am writing a DCCP code in Linux kernel 2.6.6, I met a problem, which bored me about two weeks. Hope you to give me some hints, thanks in advance. The problem is on structure sock in dccp_lookup_listen of dccp_lookup.
When dccp_rcv (similar to udp_rcv and TCP_*_rcv) called dccp_v4_lookup( similar to TCP_v4_lookup), the dccp_v4_lookup will call dccp_v4_lookup_listen. Running is dead when the 7th line is implemented, I checked, problem is from sk=__sk_head(head). And I also checked the printed value of __sk_head(head) is correct. The other way, I changed the first line as struct sock *sk; (remove "=NULL"), running is dead here. I doubt the problem belongs to memory.
My dccp_v4_lookup is so that:
static inline struct sock *dccp_v4_lookup_listen(u32 daddr, u16 dport,int dif) {
struct sock *sk = NULL;
struct hlist_head *head;
read_lock(&dccp_lhash_lock);
head = &dccp_hash[ntohs(dport) & (DCCP_HTABLE_SIZE - 1)];
if (!hlist_empty(head)) {
struct inet_opt *inet = inet_sk(sk = __sk_head(head));
if (inet->num == ntohs(dport) && !(sk->sk_node.next &&
(!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
(sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
!sk->sk_bound_dev_if)
goto sherry_cache;
printk("dccp_v4_lookup_listen: sk:%x\n",(__sk_head(head)));
//sk = __dccp_v4_lookup_listen(head, daddr, ntohs(dport), dif);
}
if (sk) {
sherry_cache:
sock_hold(sk); }
read_unlock(&dccp_lhash_lock);
return (sk);
}
Best regards,
Zhikui Chen
In stuttgart university.
Em Fri, Aug 20, 2004 at 07:17:57PM +0200, Zhikui Chen escreveu:
Quoted 8 lines
Dear all,
HELP!
I am writing a DCCP code in Linux kernel 2.6.6, I met a problem, which bored me about two weeks. Hope you to give me some hints, thanks in advance. The problem is on structure sock in
dccp_lookup_listenofdccp_lookup.
We should talk then, I'm doing the same 8)
I'll take a look at what you have if you point me to the right direction, my code is at bk://kernel.bkbits.net/acme/dccp-2.6, but is still in the TCPfication skeleton right now.
- Arnaldo
Em Fri, Aug 20, 2004 at 08:32:52PM -0300, Arnaldo Carvalho de Melo escreveu:
Quoted 10 lines
Em Fri, Aug 20, 2004 at 07:17:57PM +0200, Zhikui Chen escreveu:
Quoted 8 lines
Dear all,
HELP!
I am writing a DCCP code in Linux kernel 2.6.6, I met a problem, which bored me about two weeks. Hope you to give me some hints, thanks in advance. The problem is on structure sock in
dccp_lookup_listenofdccp_lookup.
Quoted 5 lines
We should talk then, I'm doing the same 8)
I'll take a look at what you have if you point me to the right direction, my code is at bk://kernel.bkbits.net/acme/dccp-2.6, but is still in the TCPfication skeleton right now.
Ah, I started this from the work done by Patrick McManus, but now I'm mostly rewriting it, this weekend I'll get back to it, I hope 8)
- Arnaldo