Looking at the pfhooks design doc again, I see there are many cases where link layer is prepended to a hooked NI_PHYSICAL_OUT packet. So, my modified question is why can I not inject the packet as IPv4 and expect it to be output correctly.
Thanks again, Fred On 10/18/07, Fred Medlin <[EMAIL PROTECTED]> wrote: > > Can anyone point me in the right direction for approaching this problem > I'm having with pfhooks? I'm using snv_64a on Sparc hardware with hme > interfaces. > > Some traffic hooked by NI_PHYSICAL_OUT has a prepended ethernet header. > The two specific cases I've found so far are ftp and ssh. The only way I've > found to get these packets out on the wire is to return 0 from the hook > function. If an unencapsulated IP pkt is hooked, then there is no problem. > I'm doing the same logic with NI_PHYSICAL_IN with no problems. However, I > never see eth encapsulated packets on NI_PHYSICAL_IN. > > Here's the pseudo code of what's going on: > > begin hook_function_out(mblk) > mblk cmp = copymsg(mblk) > queue_pkt(cmp) > return 1; > end > > begin queue_pkt(mblk) > push(mblk) > end > > begin process_pkt > get mblk from queue > inject(mblk) > end > > Here are some variations I've tried along the way: > 1. Output with NI_QUEUE_OUT, NI_DIRECT_OUT and even ipfil_sendpkt > (with phy = 0) directly. Same behavior. No failure, but no output. Again, > unencapsulated packets work in each scenario. > 2. Bump mblk b_rptr by 14 to point at IP header to decapsulate > ethernet. Same behavior. I deduced that since hooked ip packets work > correctly, then the decapsulated packet should work as well. It doesn't. > > Thanks! > Fred >
_______________________________________________ networking-discuss mailing list [email protected]
