diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-12 07:18:01 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-13 00:16:06 +0100 |
commit | 5bfee718d2f7118c94264acb3638e6b54d93e57b (patch) | |
tree | fbe3123f73da3c4afa050f92830e668a9be2122d /src/libsystemd | |
parent | sd-netlink: clear previous flags or state by _set_flags() or _set_state() (diff) | |
download | systemd-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.c | 14 |
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; |