problems with sk_buff implementation

Discussion in 'Linux Networking' started by Venu, Jun 24, 2004.

  1. Venu

    Venu Guest

    Hi all,

    I need to create sk_buff packets in my driver and send it up to the
    host that reads from a raw socket and does some processing. But when I
    do this - the kernel "Oops" crashes. in fact, it's somewhere in the
    free routines.

    my code snippet is below

    void fn(struct sk_buff ** sk)
    n = sizeof(assoc);
    *sk = dev_alloc_skb(n + 1);
    data = skb_put(*sk,n);
    memcpy(data, &assoc,n);
    (*sk)->len = n;
    ... <snip>

    the function takes in a sk_buf **, assoc is a char buffer that needs
    to be copied to the skb->data area.

    I see that the skb construction is fine, it passes all the way up the
    app routine, but then the kernel crashes (presumably in free routines,
    I checked with ksymoops)

    Anyone have an insight into what I could be doing wrong? am I missing
    something? Answers greatly appreciated. Direct responses are better -
    please mail to
    n e c r o m o n g e r AT g m a i l DOT c o m. (I don't check the yahoo
    acct - it's spam infested)

    thanks much!
    Venu, Jun 24, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.