Skip to contentSkip to conversation

dn_neigh_table vs pneigh_lookup/pneigh_delete

DISCUSSION Pavel Emelyanov 2 participants 2 messages Dec 19, 2007 – Dec 20, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi

The pneigh_lookup/delete silently concerns, that the key_len of the table is more that 4 bytes. Look:

         u32 hash_val = *(u32 *)(pkey + key_len - 4);

The hash_val for the proxy neighbor entry is four last bytes from the pkey.

But the dn_neigh_tables' key_len is sizeof(__le16), that is 2, so setting (via netlink) the proxy neighbor entry for decnet will cause this entry to reside in arbitrary hash chain.

Is this too bad for decnet?

Thanks,
Pavel

#1 lore raw

Hi,

Quoted 10 lines · Pavel Emelyanov

Hi

The pneigh_lookup/delete silently concerns, that the key_len of the table is more that 4 bytes. Look:

         u32 hash_val = *(u32 *)(pkey + key_len - 4);

The hash_val for the proxy neighbor entry is four last bytes from the pkey.

Quoted 8 lines

But the dn_neigh_tables' key_len is sizeof(__le16), that is 2, so setting (via netlink) the proxy neighbor entry for decnet will cause this entry to reside in arbitrary hash chain.

Is this too bad for decnet?

Thanks,
Pavel

The pneigh code is never used in DECnet, we only use the "normal" part of the neigh code where the hash function was changed so that it can be defined for each protocol (and thus doesn't suffer from this problem)

Steve.