[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[altq 1210] Re: local packets vs. forwarding in enqueue operation




>Martin Karsten wrote:
>> Is there a simple way to detect from within an 'xxx_enqueue' operation that
>> a packet has originated from the local machine, other than matching its
>> source address with all interface addresses? In 'ip_output', this is
>> expressed by the IP_FORWARDING flag, but no such indication seems to be
>> available during 'enqueue'.
>
>I think you can use
>
>	if (m->m_pkthdr.rcvif == NULL)
>		/* packet originated from the local machine */

	you can't.  depending on platforms, MGETHDR() does not initialize
	rcvif to NULL.

itojun