[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALDO+SaAyNG0RfZPkA+hTYAx3P_JtJ5Ah3sj2GKE1oDjXnTLUw@mail.gmail.com>
Date: Thu, 17 Aug 2017 15:31:28 -0700
From: William Tu <u9012063@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Meenakshi Vohra <mvohra@...are.com>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>
Subject: Re: [PATCHv2 net-next iproute2] gre: add support for ERSPAN tunnel
>> + if (greinfo[IFLA_GRE_ERSPAN_INDEX])
>> + erspan_idx = rta_getattr_u32(greinfo[IFLA_GRE_ERSPAN_INDEX]);
>> }
>
> Are you missing a ntohl() here?
>
> It is encoded as htonl() when sending to kernel.
>
> addattr32(n, 1024, IFLA_GRE_FWMARK, fwmark);
> + addattr32(n, 1024, IFLA_GRE_ERSPAN_INDEX, htonl(erspan_idx));
Thanks for the feedbacks, and sorry for my late response.
Now I plan to not translate to network-byte order, but do it inside
the kernel. So kernel expects host order, ip route only sends
host-byte order.
>
> Is erspan_idx == 0 a reserved value?
ERSPAN spec does not say erspan_idx = 0 should be reserved or not. But
I assume at lease people will put some value, so I assume it is
reserved. And only when it is non-zero, then send to kernel.
> You should only send erspan_idx to kernel if it is given on command line.
Yes, I will resubmit next patch.
Regards,
William
Powered by blists - more mailing lists