diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2017-06-19 10:03:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-20 19:37:01 +0200 |
commit | a985343ba90635cda3f3704f71021254c91cebbd (patch) | |
tree | 6b409f87fb8a1602d88a75187a467a7ee4d07cfe /include/net | |
parent | Merge branch 'net-more-skb_put-work' (diff) | |
download | linux-a985343ba90635cda3f3704f71021254c91cebbd.tar.xz linux-a985343ba90635cda3f3704f71021254c91cebbd.zip |
vxlan: refactor verification and application of configuration
The vxlan_dev_configure function was mixing validation and application of
the vxlan configuration; this could easily lead to bugs with the changelink
operation, as it was hard to see if the function wcould return an error
after parts of the configuration had already been applied.
This commit splits validation and application out of vxlan_dev_configure as
separate functions to make it clearer where error returns are allowed and
where the vxlan_dev or net_device may be configured. Log messages in these
functions are removed, as it is generally unexpected to find error output
for netlink requests in the kernel log. Userspace should be able to handle
errors based on the error codes returned via netlink just fine.
In addition, some validation and initialization is moved to vxlan_validate
and vxlan_setup respectively to improve grouping of similar settings.
Finally, this also fixes two actual bugs:
* if set, conf->mtu would overwrite dev->mtu in each changelink operation,
reverting other changes of dev->mtu
* the "if (!conf->dst_port)" branch would never be run, as conf->dst_port
was set in vxlan_setup before. This caused VXLAN-GPE to use the same
default port as other VXLAN sockets instead of the intended IANA-assigned
4790.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
0 files changed, 0 insertions, 0 deletions