On Wed, Jun 16, 2010 at 7:46 PM, Stuart Henderson <[email protected]>
wrote:
> On 2010/06/16 18:36, Patrick Coleman wrote:
>>       /*
>>        * If packet is unicast and we're in promiscuous mode, make sure it
>>        * is for us.  Drop otherwise.
>> +      *
>> +      * Check ifp and ifp_orig, to catch promiscuous members of a
>> +      * non-promiscuous trunk.
>>        */
>>       if ((m->m_flags & (M_BCAST|M_MCAST)) == 0 &&
>> -         (ifp->if_flags & IFF_PROMISC)) {
>> +         ((ifp->if_flags & IFF_PROMISC) ||
>> +         (ifp_orig->if_flags & IFF_PROMISC))) {
>> +
>>               if (bcmp(ac->ac_enaddr, (caddr_t)eh->ether_dhost,
>>                   ETHER_ADDR_LEN)) {
>>                       m_freem(m);
>>
>
> trunk(4) places trunkports into promiscuous mode anyway,
> so would it make more sense just to skip the IFF_PROMISC
> check here? in which case, there would be no need to
> preserve ifp_orig.

That makes sense. I wasn't sure if that promiscuous check was there
for another reason, so I erred on the side of leaving it in.

>> +              * Has been set to the trunk interface. ifp_orig preserves
the physical
>
> it's not mentioned explicitly in style(9) but wrapping to
> 80 columns is preferred.

Updated patch at
http://patrick.ld.net.au/20100616-fix-gratuitous-reset-nopromisc.patch.
I've also created bug 6404/kernel.

Cheers,

Patrick

--
http://www.labyrinthdata.net.au - WA Backup, Web and VPS Hosting

Reply via email to