netlink: implement nla_get_in_addr and nla_get_in6_addr
Those are counterparts to nla_put_in_addr and nla_put_in6_addr. 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
930345ea63
commit
67b61f6c13
@@ -2438,7 +2438,7 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
cfg->fc_nlinfo.nl_net = sock_net(skb->sk);
|
||||
|
||||
if (tb[RTA_GATEWAY]) {
|
||||
nla_memcpy(&cfg->fc_gateway, tb[RTA_GATEWAY], 16);
|
||||
cfg->fc_gateway = nla_get_in6_addr(tb[RTA_GATEWAY]);
|
||||
cfg->fc_flags |= RTF_GATEWAY;
|
||||
}
|
||||
|
||||
@@ -2461,7 +2461,7 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
}
|
||||
|
||||
if (tb[RTA_PREFSRC])
|
||||
nla_memcpy(&cfg->fc_prefsrc, tb[RTA_PREFSRC], 16);
|
||||
cfg->fc_prefsrc = nla_get_in6_addr(tb[RTA_PREFSRC]);
|
||||
|
||||
if (tb[RTA_OIF])
|
||||
cfg->fc_ifindex = nla_get_u32(tb[RTA_OIF]);
|
||||
@@ -2519,7 +2519,7 @@ beginning:
|
||||
|
||||
nla = nla_find(attrs, attrlen, RTA_GATEWAY);
|
||||
if (nla) {
|
||||
nla_memcpy(&r_cfg.fc_gateway, nla, 16);
|
||||
r_cfg.fc_gateway = nla_get_in6_addr(nla);
|
||||
r_cfg.fc_flags |= RTF_GATEWAY;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user