Fix a number of issues found by the OpenSuse security team in networkhelper
ClosedPublic

Authored by ahiemstra on Oct 2 2019, 10:00 AM.

Diff Detail

Repository
R106 KSysguard
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahiemstra created this revision.Oct 2 2019, 10:00 AM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 2 2019, 10:00 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Oct 2 2019, 10:00 AM

Note that https://bugzilla.opensuse.org/show_bug.cgi?id=1152638 says pcap_breakloop() is unsupported when called from multiple threads. However, the actual libpcap documentation states:

Note also that, in a multi-threaded application, if one thread is blocked in pcap_dispatch(), pcap_loop(), pcap_next(3PCAP), or pcap_next_ex(3PCAP), a call to pcap_breakloop() in a different thread will not unblock that thread.

Which is a bit different, as it implies (to me) that the loop will still exit the next time the thread is woken up from its blocking call. Which is fine, the thread will be woken up when the next packet arrives and then exit.

maltek accepted this revision.Oct 9 2019, 3:46 PM
maltek added a subscriber: maltek.

Looks good to me. Thanks for the quick reaction (and sorry for my slow one!)

Which is a bit different, as it implies (to me) that the loop will still exit the next time the thread is woken up from its blocking call. Which is fine, the thread will be woken up when the next packet arrives and then exit.

Fair enough. Maybe I was a bit quick with my judgement there.

This revision is now accepted and ready to land.Oct 9 2019, 3:46 PM
This revision was automatically updated to reflect the committed changes.