@@ -385,6 +385,32 @@ static int br_del_slave(struct net_device *dev, struct net_device *slave_dev)
385385 return br_del_if (br , slave_dev );
386386}
387387
388+ static int br_fill_forward_path (struct net_device_path_ctx * ctx ,
389+ struct net_device_path * path )
390+ {
391+ struct net_bridge_fdb_entry * f ;
392+ struct net_bridge_port * dst ;
393+ struct net_bridge * br ;
394+
395+ if (netif_is_bridge_port (ctx -> dev ))
396+ return -1 ;
397+
398+ br = netdev_priv (ctx -> dev );
399+ f = br_fdb_find_rcu (br , ctx -> daddr , 0 );
400+ if (!f || !f -> dst )
401+ return -1 ;
402+
403+ dst = READ_ONCE (f -> dst );
404+ if (!dst )
405+ return -1 ;
406+
407+ path -> type = DEV_PATH_BRIDGE ;
408+ path -> dev = dst -> br -> dev ;
409+ ctx -> dev = dst -> dev ;
410+
411+ return 0 ;
412+ }
413+
388414static const struct ethtool_ops br_ethtool_ops = {
389415 .get_drvinfo = br_getinfo ,
390416 .get_link = ethtool_op_get_link ,
@@ -419,6 +445,7 @@ static const struct net_device_ops br_netdev_ops = {
419445 .ndo_bridge_setlink = br_setlink ,
420446 .ndo_bridge_dellink = br_dellink ,
421447 .ndo_features_check = passthru_features_check ,
448+ .ndo_fill_forward_path = br_fill_forward_path ,
422449};
423450
424451static struct device_type br_type = {
0 commit comments