mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 16:26:10 +00:00
lib: add sizing macro to ipaddr.h
Useful for getting the size of the relevant data in the `ip` field of struct ipaddr. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
0f1f98e837
commit
4f838de420
@ -56,6 +56,9 @@ struct ipaddr {
|
||||
#define SET_IPADDR_V4(p) (p)->ipa_type = IPADDR_V4
|
||||
#define SET_IPADDR_V6(p) (p)->ipa_type = IPADDR_V6
|
||||
|
||||
#define IPADDRSZ(p) \
|
||||
IS_IPADDR_V4((p)) ? sizeof(struct in_addr) : sizeof(struct in6_addr)
|
||||
|
||||
static inline int str2ipaddr(const char *str, struct ipaddr *ip)
|
||||
{
|
||||
int ret;
|
||||
|
Loading…
Reference in New Issue
Block a user