Question about mac addresses in IP hook.,
Quoted 11 lines
Quoted 10 lines
Thanks for the response.
On theNF_IP_PRE_ROUTINGI can get the mac header without a problem (what a relief! Thanks for the help, it really helped a lot) Basically, it's always 14 bytes before the data pointer or on the .mac union. However, the outbound hook, the mac address pointer is still randomly NULL and pointing to strange data! I can't understand it. The code looks something like this<in
NF_IP_LOCAL_OUToutboundhook>
Quoted 7 lines
Stop right there. For outbound packets, all the way through to
POST_ROUTING, there is NO WAY the outbound ethernet header could already be in place for all cases. Think about sending to a station which is not yet in the local ARP cache. Before the kernel can be sure of the destination MAC address, it keeps back the original outgoing packet, makes an ARP broadcast, and only when it hears back, can it send on the packet on its journey.
Really? How can this be? So, you're telling me that if the mac address is not in the arp cache table it *queues* the packets? Who designed this? Is it going to queue all my packets should there be no reply to the arp? Nahh, I think you are mistaken. Most likely, it probably drops the packet should there be no arp cache. Then the TCP/IP restart would allow enough time to see if the machine can find the destination. (i think windows does this)
Quoted 7 lines
If what you naively expect, must be implemented, then all filtering action has to be postponed to the moment where the outgoing header is completely determined - doing so would need an almost complete rearrangement of the output path of iptables (and probably much meddling with the network stack itself). Furthermore, it would open the possibility for to-be-blocked traffic to neccessiate traffic, namely the ARP request/reply.
It's not as difficult as you may think (see above.)
Quoted 8 lines
Can you see why things are the way they are, now?
(There is a small chance, that I'm wrong for thePOST_ROUTINGhook. Somebody please correct me if that hook guarantees L2 header availability. I haven't looked closely at the code, so far.)best regards
Patrick
_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail. http://www.hotmail.com