Messages in this thread | | | Date | Tue, 26 Oct 1999 14:53:31 -0400 | From | Richard Guy Briggs <> | Subject | Re: calling skb_queue_purge() causes oops when called from FreeS/WAN under 2.2.x |
| |
On Tue, Oct 26, 1999 at 09:58:15PM +0400, kuznet@ms2.inr.ac.ru wrote: > Hello! > > > Can you quote the lines or tell me what version of the file you are > > pfkey_v2.c, pfkey_upmsg(): > > if(!(skb = alloc_skb(pfkey_msg->sadb_msg_len, GFP_ATOMIC) )) { > return -ENOBUFS; > } > > skb->h.raw = skb_put(skb, pfkey_msg->sadb_msg_len); > memcpy(skb->h.raw, pfkey_msg, pfkey_msg->sadb_msg_len * IPSEC_PFKEYv2_ALIGN); > ^!!!!!!!!!
What is wrong with this? The pfkey_msg->sadb_msg_len contains the size of the message extension in long-long's, in other words 64-bit blocks, not octets. Other than that, is there something I am missing?
I am in the process of fixing the userland code that should actually try to empty the queue as well, but it should not depend on that.
> > choice if we are to continue to support more than one kernel version. > > Look at ethernet drivers, f.e. drivers/net/tulip.c. They compile > for any kernel, including really ancient ones and contain not so > much of ifdefs. F.e. look at macro DEV_ALLOC_SKB(). You could use > the same approach. Now it is just unparsable.
I will have a look at the tulip driver. It is a little more parsable now, but pfkey_destroy_socket is still a huge mess because I am still trying lots of different things to try to understand the problem. If you cannot parse it, perhaps you are not investing enough effort! (just kidding, a reference to some of your previous comments about the Linux network code ;-)
I have checked in an update.
> Alexey
slainte mhath, RGB -- Richard Guy Briggs -- PGP key available Auto-Free Ottawa! Canada <http://www.conscoop.ottawa.on.ca/rgb/> </www.flora.org/afo/> Prevent Internet Wiretapping! -- FreeS/WAN:<www.xs4all.nl/~freeswan> Thanks for voting Green! -- <green.ca> Marillion:<www.marillion.co.uk> [unhandled content-type:application/pgp-signature] | |