summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-01-24 15:48:18 +0100
committerMaria Matejka <mq@ucw.cz>2022-02-03 10:30:33 +0100
commitd37513a372b0d5b133f59293af185ec831e2456f (patch)
treeef710a0adcc81bbf725b4a39e0fd3ae50df3117e /sysdep
parentc651cef737c7c7578c26bd787c0abd3c364bf4b8 (diff)
Neighbors: Locking and asynchronous notifications
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/bsd/krt-sock.c2
-rw-r--r--sysdep/linux/netlink.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index a0f6a7cb..923001bf 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -242,6 +242,7 @@ krt_send_route(struct krt_proto *p, int cmd, const rte *e)
*/
if (!i)
{
+ IFACE_LOCK;
WALK_LIST(j, global_iface_list)
{
if (j->flags & IF_LOOPBACK)
@@ -250,6 +251,7 @@ krt_send_route(struct krt_proto *p, int cmd, const rte *e)
break;
}
}
+ IFACE_UNLOCK;
if (!i)
{
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 9b7b502d..f52a796f 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -1147,6 +1147,7 @@ kif_do_scan(struct kif_proto *p UNUSED)
log(L_DEBUG "nl_scan_ifaces: Unknown packet received (type=%d)", h->nlmsg_type);
/* Re-resolve master interface for slaves */
+ IFACE_LEGACY_ACCESS;
struct iface *i;
WALK_LIST(i, global_iface_list)
if (i->master_index)