Thread (3 messages) 3 messages, 2 authors, 2017-08-17

Re: [PATCHv2 net-next iproute2] gre: add support for ERSPAN tunnel

flat view

From: William Tu <hidden>
Date: 2017-08-17 22:32:09

quoted
+             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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help