Ok, so I've been reading through the sample driver at
<http://techpubs.sgi.com/library/tpl/...I_Developer/bo
oks/DevDriver_PG/sgi_html/ch17.html#LE63121-PARENT>, and I'm puzzling over the
sk_input function.

Near the top of the function, the following code appears:


/*
* If it is a broadcast or multicast frame,
* get rid of imperfectly filtered multicasts.
*/
if (SK_ISGROUP(sib->sib_skh.sh_dhost.sk_vec)) {
if (SK_ISBROAD(sib->sib_skh.sh_dhost.sk_vec))
m->m_flags |= M_BCAST;
else {
if (((si->si_ac.ac_if.if_flags & IFF_ALLMULTI) == 0)
&& !mfethermatch(&si->si_filter,
sib->sib_skh.sh_dhost.sk_vec, 0)) {
if (RAWIF_SNOOPING(&si->si_rawif)
&& snoop_match(&si->si_rawif,
(caddr_t) &sib->sib_skh, totlen))
snoopflags = SN_PROMISC;
else {
m_freem(m);
return;
}
m->m_flags |= M_MCAST;
}
}
si->si_if.if_imcasts++;
} else {
if (RAWIF_SNOOPING(&si->si_rawif)
&& snoop_match(&si->si_rawif,
(caddr_t) &sib->sib_skh,
totlen))
snoopflags = SN_PROMISC;
else {
m_freem(m);
return;
}
}

First off, 'm->m_flags |= M_MCAST;' seems to be a line early. Could someone
explain to me if this is a typo or not?

Second, the else clause from the SK_ISGROUP() test would seem to eat any
non-multicast/non-broadcast traffic that isn't claimed by the snoop interface.
Surely that can't be right??

Also, just above this code is a comment that I should set 'snoopflags' and
'if_ierrors', but the information to set these flags is only available in the
intr function, not the input function. How exactly am I expected to pass this
information? (an extra function parameter? a slot in the mbuf?)

I should take this opportunity to complain that the network driver interface and
the documentation thereof are rather lacking. I should hope that at some time in
the future both of these will be severely renovated. (especially considering the
current documentation has no mention of IPv6)


Cheers - Tony 'Nicoya' Mantler

--
Tony 'Nicoya' Mantler -- Master of Code-fu -- nicoya@ubb.ca
-- http://nicoya.feline.pp.se/ -- http://www.ubb.ca/ --