pppol2tp_ioctl() has everything in place for handling PPPIOCGL2TPSTATS on session sockets. We just need to copy the stats and set ->session_id. As a side effect of sharing session and tunnel code, ->using_ipsec is properly set even when the request was made using a session socket.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -68,7 +68,7 @@ struct ppp_option_data { · 67 unmodified lines | ||
| 68 | 68 | struct pppol2tp_ioc_stats { |
| 69 | 69 | __u16 tunnel_id; /* redundant */ |
| 70 | 70 | __u16 session_id; /* if zero, get tunnel stats */ |
| 71 | − __u32 using_ipsec:1; /* valid only for session_id == 0 */ | |
| 71 | + __u32 using_ipsec:1; | |
| 72 | 72 | __aligned_u64 tx_packets; |
| 73 | 73 | __aligned_u64 tx_bytes; |
| 74 | 74 | __aligned_u64 tx_errors; |