From: Yu Watanabe Date: Sun, 17 Mar 2024 04:27:08 +0000 (+0900) Subject: ndisc-option: introduce ndisc_option_remove() X-Git-Tag: v256-rc1~399^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24578ce63aac951124fcde2b88c37cf4018a7e43;p=thirdparty%2Fsystemd.git ndisc-option: introduce ndisc_option_remove() --- diff --git a/src/libsystemd-network/ndisc-option.h b/src/libsystemd-network/ndisc-option.h index 46783ebb3e8..7e7a702b809 100644 --- a/src/libsystemd-network/ndisc-option.h +++ b/src/libsystemd-network/ndisc-option.h @@ -117,6 +117,13 @@ static inline sd_ndisc_option* ndisc_option_get_by_type(Set *options, uint8_t ty } int ndisc_option_get_mac(Set *options, uint8_t type, struct ether_addr *ret); +static inline void ndisc_option_remove(Set *options, const sd_ndisc_option *p) { + ndisc_option_free(set_remove(options, ASSERT_PTR(p))); +} +static inline void ndisc_option_remove_by_type(Set *options, uint8_t type) { + ndisc_option_remove(options, &(const sd_ndisc_option) { .type = type }); +} + int ndisc_option_add_raw( Set **options, size_t offset,