git: 1377eb268a5a - main - netlink: add IPv4/IPv6 attribute writers using in[6]_addr instead of sockaddrs.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 19 May 2023 09:46:04 UTC
The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=1377eb268a5a8a5573bda33a651963259c43c3ed commit 1377eb268a5a8a5573bda33a651963259c43c3ed Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-05-19 09:44:21 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-05-19 09:45:49 +0000 netlink: add IPv4/IPv6 attribute writers using in[6]_addr instead of sockaddrs. MFC after: 2 weeks --- sys/netlink/netlink_snl_route.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/netlink/netlink_snl_route.h b/sys/netlink/netlink_snl_route.h index 95be0b588f69..619e769b1496 100644 --- a/sys/netlink/netlink_snl_route.h +++ b/sys/netlink/netlink_snl_route.h @@ -127,6 +127,18 @@ snl_attr_get_ipvia(struct snl_state *ss, struct nlattr *nla, return (false); } +static inline bool +snl_add_msg_attr_ip4(struct snl_writer *nw, int attrtype, const struct in_addr *addr) +{ + return (snl_add_msg_attr(nw, attrtype, 4, addr)); +} + +static inline bool +snl_add_msg_attr_ip6(struct snl_writer *nw, int attrtype, const struct in6_addr *addr) +{ + return (snl_add_msg_attr(nw, attrtype, 16, addr)); +} + static inline bool snl_add_msg_attr_ip(struct snl_writer *nw, int attrtype, const struct sockaddr *sa) {