]> git.baikalelectronics.ru Git - kernel.git/commit
vxlan: clean up rx error path
authorJiri Benc <jbenc@redhat.com>
Tue, 16 Feb 2016 20:59:02 +0000 (21:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Feb 2016 04:52:12 +0000 (23:52 -0500)
commit93845b5cd25de190cfc62f801a1c15ddd006d094
treebccef0ef9096aa53ae264e37bd329b24dcd5b381
parent0897c67d75c97455bc4c6fe35dd6ea9d5c2b00ef
vxlan: clean up rx error path

When there are unrecognized flags present in the vxlan header, it doesn't
make much sense to return the packet for further UDP processing, especially
considering that for other invalid flag combinations we drop the packet
because of previous checks.

This means we return positive value only at the beginning of the function
where tun_dst is not yet allocated. This allows us to get rid of the
bad_flags and error jump labels.

When we're dropping packet, we need to free tun_dst now.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c