[<prev] [next>] [day] [month] [year] [list]
Message-ID: <9511f83e0905031637p73dbc673yb6eedce743c27269@mail.gmail.com>
Date: Sun, 3 May 2009 19:37:36 -0400
From: Rahul Murmuria <rahul@...muria.in>
To: netdev@...r.kernel.org
Cc: "J.R. Mauro" <jrm8005@...il.com>
Subject: Kernel crashes while calling sock->ops->connect()
Hi!
I have been writing a /net virtual filesystem for Linux Kernel[1].
Currently, I am just trying to wrap around BSD Socket in kernel-space.
That involves me using sock_create and sock->ops->connect. This
commit[2] shows pretty much everything that I am working with.
In the function int socknet_connect(), I am creating a socket and
connecting to the ip:port provided from a synthetic file. The problem
is with:
ret = sock->ops->connect(sock, (struct sockaddr *)&addr, sizeof(addr),
sock->file->f_flags);
If I comment the above line, all is fine, but as soon as I use this
function, the kernel crashes in run-time. i.e. in my case, when I say
echo "connect 92.243.0.230:80" > /net/tcp/0/ctl
I have checked ML Archives. Someone suggested checking if the char *ip
does not end in \n or \r. I have also checked for other
implementations in the kernel to see if I am setting the values for
"struct sockaddr_in addr" correctly. I put the sock_create and
ops->connect in the same function to try and avoid errors with struct
socket *sock not being passed around correctly. The problems still
prevail.
So far, no luck.
Can anyone suggest what other things could go wrong? Or maybe look
into my code if you would be kind enough!
[1] http://slashnet.wordpress.com/
[2] http://hg.glendix.org/glendix/rev/31c5adbe25aa
Best Regards,
--
Rahul Murmuria
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists