tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Possible mermory corruption in if_msk.c?
Hi,
On Tue, Jul 15, 2008 at 11:07 PM, Anthony Mallet
<anthony.mallet%useless-ficus.net@localhost> wrote:
> I inspected a bit the if_msk.c code. Maybe I overlooked something but I
> have the feeling that there is an inconsistency between the declaration
> of :
>
> struct sk_chain_data in if_skvar.h:114:
>
> struct sk_chain_data {
> [...]
> void * sk_jslots[SK_JSLOTS];
> [...]
> };
>
> and initialization of this array in if_msk.c:601
>
> for (i = 0; i < MSK_JSLOTS; i++) {
> sc_if->sk_cdata.sk_jslots[i] = ptr;
>
> SK_JSLOTS is defined to 384 but MSK_JSLOTS is defined by a (magic?)
> formula that evaluates to 768.
Hmm... it's not using the definitions from if_skvar.h but rather from
if_mskvar.h which are defined as follows:
struct msk_chain_data {
[...]
void * sk_jslots[MSK_JSLOTS];
[...]
};
/* Softc for each logical interface */
struct sk_if_softc {
[...]
struct msk_chain_data sk_cdata;
struct msk_ring_data *sk_rdata;
[...]
};
So it looks correct to me.
Regards,
Marco
Home |
Main Index |
Thread Index |
Old Index