Bug 301699

Summary: Default gateway undetected on FreeBSD
Product: [Applications] knemo Reporter: Alberto Villa <avilla>
Component: generalAssignee: John Stamp <jstamp>
Status: RESOLVED UNMAINTAINED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: FreeBSD Ports   
OS: FreeBSD   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Fix to the issue.

Description Alberto Villa 2012-06-12 00:30:06 UTC
The default gateway entry is empty.
It happens because the cycle iterating through returned socket addresses makes the assumption that they all have the same length, and uses...

cp += sizeof( struct sockaddr );

...to move to each next entry.

Reproducible: Always
Comment 1 Alberto Villa 2012-06-12 00:33:57 UTC
Created attachment 71749 [details]
Fix to the issue.

The attached patch replaces the incriminated code with the SA_SIZE() macro, which calculates the correct size of given sockaddr structure (be it a sockaddr_in or sockaddr_in6).
Comment 2 John Stamp 2012-06-12 02:23:02 UTC
SVN commit 1299929 by jstamp:

Fix default gateway detection on FreeBSD

Thanks to Alberto Villa for the patch.


 M  +1 -1      utils.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1299929
Comment 3 Andrew Crouthamel 2018-10-29 22:08:46 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I will be closing this bug.