I was working on creating a separate network stack and I'm using libpcap, or specifically, pcap_inject function to send packets directly to the link layer. However, when I look into the tc -s qdisc show dev eth0 command, I see that the packets I send are counting towards the packets sent from the queue. So my question is, does pcap_inject call the traffic control layer of linux to send packets? Or does it directly send to the device driver?
Thanks in advance
It does a
send()call on a PF_PACKET socket. By default, packets sent on those sockets go through the traffic control layer; to quote the PF_PACKET socket man page:libpcap does not turn that option on.