You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
netlink: implement nla_put_in_addr and nla_put_in6_addr
IP addresses are often stored in netlink attributes. Add generic functions to do that. For nla_put_in_addr, it would be nicer to pass struct in_addr but this is not used universally throughout the kernel, in way too many places __be32 is used to store IPv4 address. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
15e318bdc6
commit
930345ea63
@@ -483,7 +483,7 @@ static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr)
|
||||
|
||||
if (!__nested)
|
||||
return -EMSGSIZE;
|
||||
ret = nla_put_net32(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr);
|
||||
ret = nla_put_in_addr(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr);
|
||||
if (!ret)
|
||||
ipset_nest_end(skb, __nested);
|
||||
return ret;
|
||||
@@ -497,8 +497,7 @@ static inline int nla_put_ipaddr6(struct sk_buff *skb, int type,
|
||||
|
||||
if (!__nested)
|
||||
return -EMSGSIZE;
|
||||
ret = nla_put(skb, IPSET_ATTR_IPADDR_IPV6,
|
||||
sizeof(struct in6_addr), ipaddrptr);
|
||||
ret = nla_put_in6_addr(skb, IPSET_ATTR_IPADDR_IPV6, ipaddrptr);
|
||||
if (!ret)
|
||||
ipset_nest_end(skb, __nested);
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user