@@ -307,6 +307,9 @@ struct net_route_entry *net_route_add(struct net_if *iface,
307
307
struct net_nbr * nbr , * nbr_nexthop , * tmp ;
308
308
struct net_route_nexthop * nexthop_route ;
309
309
struct net_route_entry * route ;
310
+ #if defined(CONFIG_NET_MGMT_EVENT_INFO )
311
+ struct net_event_ipv6_route info ;
312
+ #endif
310
313
311
314
NET_ASSERT (addr );
312
315
NET_ASSERT (iface );
@@ -411,7 +414,17 @@ struct net_route_entry *net_route_add(struct net_if *iface,
411
414
412
415
net_route_info ("Added" , route , addr );
413
416
417
+ #if defined(CONFIG_NET_MGMT_EVENT_INFO )
418
+ net_ipaddr_copy (& info .addr , addr );
419
+ net_ipaddr_copy (& info .nexthop , nexthop );
420
+ info .prefix_len = prefix_len ;
421
+
422
+ net_mgmt_event_notify_with_info (NET_EVENT_IPV6_ROUTE_ADD ,
423
+ iface , (void * ) & info ,
424
+ sizeof (struct net_event_ipv6_route ));
425
+ #else
414
426
net_mgmt_event_notify (NET_EVENT_IPV6_ROUTE_ADD , iface );
427
+ #endif
415
428
416
429
return route ;
417
430
}
@@ -420,11 +433,27 @@ int net_route_del(struct net_route_entry *route)
420
433
{
421
434
struct net_nbr * nbr ;
422
435
struct net_route_nexthop * nexthop_route ;
436
+ #if defined(CONFIG_NET_MGMT_EVENT_INFO )
437
+ struct net_event_ipv6_route info ;
438
+ #endif
423
439
424
440
if (!route ) {
425
441
return - EINVAL ;
426
442
}
427
443
444
+ #if defined(CONFIG_NET_MGMT_EVENT_INFO )
445
+ net_ipaddr_copy (& info .addr , & route -> addr );
446
+ info .prefix_len = route -> prefix_len ;
447
+ net_ipaddr_copy (& info .nexthop ,
448
+ net_route_get_nexthop (route ));
449
+
450
+ net_mgmt_event_notify_with_info (NET_EVENT_IPV6_ROUTE_DEL ,
451
+ route -> iface , (void * ) & info ,
452
+ sizeof (struct net_event_ipv6_route ));
453
+ #else
454
+ net_mgmt_event_notify (NET_EVENT_IPV6_ROUTE_DEL , route -> iface );
455
+ #endif
456
+
428
457
sys_slist_find_and_remove (& routes , & route -> node );
429
458
430
459
nbr = net_route_get_nbr (route );
@@ -434,8 +463,6 @@ int net_route_del(struct net_route_entry *route)
434
463
435
464
net_route_info ("Deleted" , route , & route -> addr );
436
465
437
- net_mgmt_event_notify (NET_EVENT_IPV6_ROUTE_DEL , nbr -> iface );
438
-
439
466
SYS_SLIST_FOR_EACH_CONTAINER (& route -> nexthop , nexthop_route , node ) {
440
467
if (!nexthop_route -> nbr ) {
441
468
continue ;
0 commit comments