summaryrefslogtreecommitdiffstats
path: root/src/libsystemd
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-11-12 07:18:01 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-11-13 00:16:06 +0100
commit5bfee718d2f7118c94264acb3638e6b54d93e57b (patch)
treefbe3123f73da3c4afa050f92830e668a9be2122d /src/libsystemd
parentsd-netlink: clear previous flags or state by _set_flags() or _set_state() (diff)
downloadsystemd-5bfee718d2f7118c94264acb3638e6b54d93e57b.tar.xz
systemd-5bfee718d2f7118c94264acb3638e6b54d93e57b.zip
sd-netlink: introduce sd_rtnl_message_nexthop_get_flags()
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-netlink/netlink-message-rtnl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message-rtnl.c b/src/libsystemd/sd-netlink/netlink-message-rtnl.c
index 9e8ec397e9..d15ca06aa8 100644
--- a/src/libsystemd/sd-netlink/netlink-message-rtnl.c
+++ b/src/libsystemd/sd-netlink/netlink-message-rtnl.c
@@ -321,6 +321,20 @@ int sd_rtnl_message_nexthop_set_flags(sd_netlink_message *m, uint8_t flags) {
return 0;
}
+int sd_rtnl_message_nexthop_get_flags(sd_netlink_message *m, uint8_t *ret) {
+ struct nhmsg *nhm;
+
+ assert_return(m, -EINVAL);
+ assert_return(m->hdr, -EINVAL);
+ assert_return(rtnl_message_type_is_nexthop(m->hdr->nlmsg_type), -EINVAL);
+ assert_return(ret, -EINVAL);
+
+ nhm = NLMSG_DATA(m->hdr);
+ *ret = nhm->nh_flags;
+
+ return 0;
+}
+
int sd_rtnl_message_nexthop_get_family(sd_netlink_message *m, uint8_t *family) {
struct nhmsg *nhm;