@@ -263,6 +263,8 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
263
263
struct nlmsghdr * nlh ;
264
264
struct nexthop * nh ;
265
265
struct ndmsg * ndm ;
266
+ int nh_family ;
267
+ u32 nh_id ;
266
268
267
269
nlh = nlmsg_put (skb , portid , seq , type , sizeof (* ndm ), flags );
268
270
if (nlh == NULL )
@@ -273,13 +275,20 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
273
275
274
276
send_eth = send_ip = true;
275
277
276
- nh = rcu_dereference_rtnl (fdb -> nh );
278
+ rcu_read_lock ();
279
+ nh = rcu_dereference (fdb -> nh );
280
+ if (nh ) {
281
+ nh_family = nexthop_get_family (nh );
282
+ nh_id = nh -> id ;
283
+ }
284
+ rcu_read_unlock ();
285
+
277
286
if (type == RTM_GETNEIGH ) {
278
287
if (rdst ) {
279
288
send_ip = !vxlan_addr_any (& rdst -> remote_ip );
280
289
ndm -> ndm_family = send_ip ? rdst -> remote_ip .sa .sa_family : AF_INET ;
281
290
} else if (nh ) {
282
- ndm -> ndm_family = nexthop_get_family ( nh ) ;
291
+ ndm -> ndm_family = nh_family ;
283
292
}
284
293
send_eth = !is_zero_ether_addr (fdb -> eth_addr );
285
294
} else
@@ -299,7 +308,7 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
299
308
if (send_eth && nla_put (skb , NDA_LLADDR , ETH_ALEN , & fdb -> eth_addr ))
300
309
goto nla_put_failure ;
301
310
if (nh ) {
302
- if (nla_put_u32 (skb , NDA_NH_ID , nh -> id ))
311
+ if (nla_put_u32 (skb , NDA_NH_ID , nh_id ))
303
312
goto nla_put_failure ;
304
313
} else if (rdst ) {
305
314
if (send_ip && vxlan_nla_put_addr (skb , NDA_DST ,
0 commit comments