From c60fe03ef7d09f98b2c91669e0ecbd880c72fa0e Mon Sep 17 00:00:00 2001 From: Vinit Agnihotri Date: Tue, 5 Mar 2024 02:32:23 -0800 Subject: [PATCH] lib-interface: Change API for interface 'options' Signed-off-by: Vinit Agnihotri Reviewed-by: Martin Schwenke Reviewed-by: Andrew Bartlett --- source3/lib/interface.c | 8 ++++---- source3/lib/interface.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source3/lib/interface.c b/source3/lib/interface.c index b8450316b67..032362b4da3 100644 --- a/source3/lib/interface.c +++ b/source3/lib/interface.c @@ -749,15 +749,15 @@ bool interfaces_changed(void) } /**************************************************************************** - Return True if interface exists for given interface index + Return True if interface exists for given interface index and options **************************************************************************/ -bool interface_ifindex_exists(int if_index) +bool interface_ifindex_exists_with_options(int if_index, uint32_t options) { - struct interface *i; + struct interface *i = NULL; for (i = local_interfaces; i != NULL; i = i->next) { - if (i->if_index == if_index) { + if ((i->if_index == if_index) && (i->options & options)) { return true; } } diff --git a/source3/lib/interface.h b/source3/lib/interface.h index d93e9094a33..828a7aa0bd9 100644 --- a/source3/lib/interface.h +++ b/source3/lib/interface.h @@ -45,6 +45,6 @@ bool iface_local(const struct sockaddr *ip); void load_interfaces(void); void gfree_interfaces(void); bool interfaces_changed(void); -bool interface_ifindex_exists(int if_index); +bool interface_ifindex_exists_with_options(int if_index, uint32_t options); #endif /* _INTERFACE_H */ -- 2.34.1