浏览代码

hsr/prp: return error to ip link if MAC address doesn't match for slaves

For offloaded case, if MAC address of the slaves does't match return
an error code to the user space instead of silently failing. Also
print an error message indicating the same.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Murali Karicheri 6 年之前
父节点
当前提交
2f6c576f17
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      net/hsr-prp/hsr_prp_device.c

+ 5 - 1
net/hsr-prp/hsr_prp_device.c

@@ -996,8 +996,12 @@ int hsr_prp_dev_finalize(struct net_device *hsr_prp_dev,
 	 */
 	if (priv->rx_offloaded &&
 	    !ether_addr_equal(slave[0]->dev_addr,
-			      slave[1]->dev_addr))
+			      slave[1]->dev_addr)) {
+		netdev_err(hsr_prp_dev,
+			   "Slave's MAC addr must be same. So change it\n");
+		res = -EINVAL;
 		goto fail;
+	}
 
 	res = hsr_prp_create_procfs(priv, hsr_prp_dev);
 	if (res)