Skip to content

Commit

Permalink
tunnels: Don't require remote endpoint or ID during creation.
Browse files Browse the repository at this point in the history
Before lightweight tunnels existed, it really didn't make sense to
create a tunnel that was not fully specified, such as without a
destination IP address - the resulting packets would go nowhere.
However, with lightweight tunnels, the opposite is true - it doesn't
make sense to require this information when it will be provided later
on by the route. This loosens the requirements for this information.

An alternative would be to allow the relaxed version only when
COLLECT_METADATA is enabled. However, since there are several
variations on this theme (such as NBMA tunnels in GRE), just dropping
the restrictions seems the most consistent across tunnels and with
the existing configuration.

CC: John Linville <linville@tuxdriver.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
jessegross authored and davem330 committed Oct 19, 2015
1 parent 740dbc2 commit e277de5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 6 additions & 6 deletions drivers/net/geneve.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,14 @@ static int geneve_newlink(struct net *net, struct net_device *dev,
__be16 dst_port = htons(GENEVE_UDP_PORT);
__u8 ttl = 0, tos = 0;
bool metadata = false;
__be32 rem_addr;
__u32 vni;
__be32 rem_addr = 0;
__u32 vni = 0;

if (!data[IFLA_GENEVE_ID] || !data[IFLA_GENEVE_REMOTE])
return -EINVAL;
if (data[IFLA_GENEVE_ID])
vni = nla_get_u32(data[IFLA_GENEVE_ID]);

vni = nla_get_u32(data[IFLA_GENEVE_ID]);
rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]);
if (data[IFLA_GENEVE_REMOTE])
rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]);

if (data[IFLA_GENEVE_TTL])
ttl = nla_get_u8(data[IFLA_GENEVE_TTL]);
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2745,11 +2745,10 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
struct vxlan_config conf;
int err;

if (!data[IFLA_VXLAN_ID])
return -EINVAL;

memset(&conf, 0, sizeof(conf));
conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]);

if (data[IFLA_VXLAN_ID])
conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]);

if (data[IFLA_VXLAN_GROUP]) {
conf.remote_ip.sin.sin_addr.s_addr = nla_get_in_addr(data[IFLA_VXLAN_GROUP]);
Expand Down

0 comments on commit e277de5

Please sign in to comment.