Commit 8823a3ac authored by Maciej Żenczykowski's avatar Maciej Żenczykowski Committed by David S. Miller

net: rtmsg_to_fib6_config() - use new style struct initializer instead of memset

(allows for better compiler optimization)
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dc92095d
...@@ -3604,23 +3604,23 @@ static void rtmsg_to_fib6_config(struct net *net, ...@@ -3604,23 +3604,23 @@ static void rtmsg_to_fib6_config(struct net *net,
struct in6_rtmsg *rtmsg, struct in6_rtmsg *rtmsg,
struct fib6_config *cfg) struct fib6_config *cfg)
{ {
memset(cfg, 0, sizeof(*cfg)); *cfg = (struct fib6_config){
.fc_table = l3mdev_fib_table_by_index(net, rtmsg->rtmsg_ifindex) ?
: RT6_TABLE_MAIN,
.fc_ifindex = rtmsg->rtmsg_ifindex,
.fc_metric = rtmsg->rtmsg_metric,
.fc_expires = rtmsg->rtmsg_info,
.fc_dst_len = rtmsg->rtmsg_dst_len,
.fc_src_len = rtmsg->rtmsg_src_len,
.fc_flags = rtmsg->rtmsg_flags,
.fc_type = rtmsg->rtmsg_type,
.fc_nlinfo.nl_net = net,
cfg->fc_table = l3mdev_fib_table_by_index(net, rtmsg->rtmsg_ifindex) ? .fc_dst = rtmsg->rtmsg_dst,
: RT6_TABLE_MAIN; .fc_src = rtmsg->rtmsg_src,
cfg->fc_ifindex = rtmsg->rtmsg_ifindex; .fc_gateway = rtmsg->rtmsg_gateway,
cfg->fc_metric = rtmsg->rtmsg_metric; };
cfg->fc_expires = rtmsg->rtmsg_info;
cfg->fc_dst_len = rtmsg->rtmsg_dst_len;
cfg->fc_src_len = rtmsg->rtmsg_src_len;
cfg->fc_flags = rtmsg->rtmsg_flags;
cfg->fc_type = rtmsg->rtmsg_type;
cfg->fc_nlinfo.nl_net = net;
cfg->fc_dst = rtmsg->rtmsg_dst;
cfg->fc_src = rtmsg->rtmsg_src;
cfg->fc_gateway = rtmsg->rtmsg_gateway;
} }
int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg) int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment