Hello,

On Mon, 13 Jun 2016, Hannes Frederic Sowa wrote:

> -     flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
> -                        protocol, flow_flags, dst, src, dport, sport);
> +     fl4->flowi4_oif = oif;
> +     fl4->flowi4_iif = LOOPBACK_IFINDEX;
> +     fl4->flowi4_mark = sk->sk_mark;
> +     fl4->flowi4_tos = tos;
> +     fl4->flowi4_scope = RT_SCOPE_UNIVERSE;
> +     fl4->flowi4_proto = protocol;
> +     fl4->flowi4_flags = flow_flags;
> +     fl4->flowi4_secid = 0;
> +     fl4->flowi4_tun_key.tun_id = 0;
> +     fl4->daddr = dst;
> +     fl4->saddr = src;
> +     fl4->fl4_dport = dport;
> +     fl4->fl4_sport = sport;

        The way you initialize the fields adds new risks
when new field is added, it is difficult to track all such
places. If they are missed, the lookup will use random
value for the new field. I'm not sure what will compile,
may be something likes this?:

        *fl4 = (struct flowi4) {
                .flowi4_oif = oif,
                ...
        };

Regards

--
Julian Anastasov <j...@ssi.bg>

Reply via email to