Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rtnetlink: skip metrics loop for dst_default_metrics

dst_default_metrics has all of the metrics initialized to 0, so nothing
will be added to the skb in rtnetlink_put_metrics. Avoid the loop if
metrics is from dst_default_metrics.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Ahern and committed by
David S. Miller
c22a133a 4191faa2

+4
+4
net/core/rtnetlink.c
··· 751 751 struct nlattr *mx; 752 752 int i, valid = 0; 753 753 754 + /* nothing is dumped for dst_default_metrics, so just skip the loop */ 755 + if (metrics == dst_default_metrics.metrics) 756 + return 0; 757 + 754 758 mx = nla_nest_start_noflag(skb, RTA_METRICS); 755 759 if (mx == NULL) 756 760 return -ENOBUFS;