]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/vrf.c
net: vrf: do not allow table id 0
[linux.git] / drivers / net / vrf.c
index 0a067708aa39ab578b6a90d70b0fa7cab520eef2..454f907d419a7f87cc0ae1813f40c054726be7e8 100644 (file)
@@ -1252,6 +1252,8 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev,
                return -EINVAL;
 
        vrf->tb_id = nla_get_u32(data[IFLA_VRF_TABLE]);
+       if (vrf->tb_id == RT_TABLE_UNSPEC)
+               return -EINVAL;
 
        dev->priv_flags |= IFF_L3MDEV_MASTER;