[B.A.T.M.A.N.] [RFC 1/5] batman-adv: ELP - adding basic infrastructure

Andrew Lunn andrew at lunn.ch
Fri Mar 23 07:41:28 CET 2012


> +static int bat_v_elp_iface_enable(struct hard_iface *hard_iface)
> +{
> +	struct batman_elp_packet *elp_packet;
> +	unsigned long random_seqno;

...

> +	/* randomize initial seqno to avoid collision */
> +	get_random_bytes(&random_seqno, sizeof(unsigned long));
> +	atomic_set(&hard_iface->elp_seqno, (uint32_t)random_seqno);

Hi Marek

Why not just make random_seqno a uint32_t and avoid the cast?

    Andrew


More information about the B.A.T.M.A.N mailing list