Use local key/leaf definition instead of bpf_tunnel_key
authorBrenden Blanco <bblanco@plumgrid.com>
Mon, 2 May 2016 04:31:16 +0000 (21:31 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Mon, 2 May 2016 04:31:16 +0000 (21:31 -0700)
commit9911182c980332099c5e1d3442b663dae4cf62a6
tree3534fb5f9e73d457af7b0d3b343af625edb404a1
parente3e5ccdbe3349f5456eabecb8f6abcd2c31c9df2
Use local key/leaf definition instead of bpf_tunnel_key

Even after fixing the nested union issue in the preceding commits, this
example was failing. The reason was that the kernel was filling in all
bits of the bpf_tunnel_key, which in recent kernels includes non-zero
fields such as ttl. That non-zero field would break the lookup in the
tunkey2if table, which was populated assuming all extra bytes would be
zero.

Fix it by defining a simpler key structure, and copy the required fields
out from the local variable.

Fixes: #510
examples/networking/distributed_bridge/tunnel_mesh.c
examples/networking/distributed_bridge/tunnel_mesh.py