How to copy and forward data in the Linux Kernel

Source: Internet
Author: User
How to copy and forward data in the Linux kernel-Linux general technology-Linux programming and kernel information. The original idea was to use the hook function to capture the package, clone its skb structure, modify the target mac address, and then use dev_queue_xmit to send several cloned skbs to different addresses, later I found out that this idea was wrong. After each clone and then dev_queue_xmit the skb structure, it not sent the package immediately, but put it in a queue, in this way, if you modify the skb of the second clone, you will find that the mac address to be sent by the skb of the first clone is changed... Of course, it is okay to change clone to copy, but it feels that the overhead is too large.

Is there a way to let dev_queue_xmit () be cloned and called immediately? Or is there any other way? Can we follow the multicast practices? (After reading the source code, multicast uses clone, but it has a cache that records Multicast Route information and calls ipmr_queue_xmit)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.