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

Andrew Lunn
2012-03-23T06:41:28Z

> +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