소스 검색

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)