Fred Medlin wrote: > ... > 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.
So, *hpe_mp == hpe_mb and hpe_hdr points to the IPv4 header, yes? But "hpe_ip != hpe_mb->b_rptr"? Try adding in a "hpe_mb->b_rptr = hpe_hdr" before calling inject. > 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. So I've got to wonder what you're doing (or not doing) differently to what IPFilter does. Are you able to use dtrace to look more deeply into what's happening? Darren _______________________________________________ networking-discuss mailing list [email protected]
