Why does the NetFilter rule have no effect on the raw socket?

Source: Internet
Author: User

Open source DHCP client code in which you want to set the DSCP to 0xc0, but found that the discovery package can be set successfully, but the renew packet is not able to view the code found that the discovery packet is running raw socket. However, renew is sent through the UDP socket to view the kernel code found that the raw socket does not pass the NetFilter rule, as follows:

Kernel/linux/net/packet/af_packet.c

Packet_sendmsg->dev_queue_xmit directly into the TC, and then send.

Udp_sendmsg->udp_push_pending_frames->ip_push_pending_frames->ip_local_out into NetFilter, So it can be intercepted or modified by netfilter rules.


Make a record, beware of forgetting, if there is a mistake, please understand.

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.