Bug 301699 - Default gateway undetected on FreeBSD
Summary: Default gateway undetected on FreeBSD
Status: RESOLVED UNMAINTAINED
Alias: None
Product: knemo
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: FreeBSD Ports FreeBSD
: NOR normal
Target Milestone: ---
Assignee: John Stamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 00:30 UTC by Alberto Villa
Modified: 2018-10-29 22:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fix to the issue. (332 bytes, patch)
2012-06-12 00:33 UTC, Alberto Villa
Details

Note You need to log in before you can comment on or make changes to this bug.
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.