****************************************************************************/
static void pppol2tp_copy_stats(struct pppol2tp_ioc_stats *dest,
- struct l2tp_stats *stats)
+ const struct l2tp_stats *stats)
{
+ memset(dest, 0, sizeof(*dest));
+
dest->tx_packets = atomic_long_read(&stats->tx_packets);
dest->tx_bytes = atomic_long_read(&stats->tx_bytes);
dest->tx_errors = atomic_long_read(&stats->tx_errors);
struct l2tp_session *session;
if (!stats->session_id) {
- memset(stats, 0, sizeof(*stats));
pppol2tp_copy_stats(stats, &tunnel->stats);
return 0;
}
return -EBADR;
}
- memset(stats, 0, sizeof(*stats));
pppol2tp_copy_stats(stats, &session->stats);
l2tp_session_dec_refcount(session);
stats.session_id = session_id;
} else {
- memset(&stats, 0, sizeof(stats));
pppol2tp_copy_stats(&stats, &session->stats);
stats.session_id = session->session_id;
}