lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <17cd85320908260807k78a0353ha82da7f8dbc34ec@mail.gmail.com>
Date:	Wed, 26 Aug 2009 10:07:59 -0500
From:	Chris Ross <chris@...pilednetworks.com>
To:	netdev@...r.kernel.org
Subject: skb_copy/clone question

I have a driver that generate N packets to send for every 1 it
receives, similar to a bridge in functionality. I need to insert a
slightly different header for each output packet. My current approach
which is causing some issues is ..

send_packet(struct sk_buff* skb)
{
  if (skb_cow_head(skb, some_val) < 0)
    goto error_condition;

  .. insert header ..

  .. set skb->dst, and ident ..

  ip_local_out(skb)
}

// main section
for each egress packet
{
  // skb->len is always > 0 here
  if ((tskb = pskb_copy(skb, GFP_ATOMIC)) == NULL)
    goto error_condition;

  // tskb->len seems to be 0 here
  send_packet(tskb)
}

I've played with both pskb_copy and skb_copy and both seem to result
in a packet with len of 0. I was expecting skb->len to be equivalent
to tskb->len. I am running 2.6.29, any pointers would be appreciated.

thanks,

-chris
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ