lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1269857896.2164.10.camel@edumazet-laptop>
Date:	Mon, 29 Mar 2010 12:18:16 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	James Chapman <jchapman@...alix.com>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH v2 02/12] l2tp: Split pppol2tp patch into separate l2tp
 and ppp parts

Le lundi 29 mars 2010 à 10:56 +0100, James Chapman a écrit :

> +
> +/* Session hash list.
> + * The session_id SHOULD be random according to RFC2661, but several
> + * L2TP implementations (Cisco and Microsoft) use incrementing
> + * session_ids.  So we do a real hash on the session_id, rather than a
> + * simple bitmask.
> + */
> +static inline struct hlist_head *
> +l2tp_session_id_hash(struct l2tp_tunnel *tunnel, u32 session_id)
> +{
> +	unsigned long hash_val = (unsigned long) session_id;
> +	return &tunnel->session_hlist[hash_long(hash_val, L2TP_HASH_BITS)];
> +}

Please use hash_32() here, its better in this case on 64 bit arches (32
bits in session_id)

return &tunnel->session_hlist[hash_32(session_id, L2TP_HASH_BITS)];



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ