Răsfoiți Sursa

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 ani în urmă
părinte
comite
2f6c576f17
1 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  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)