#
fce7f3a7 |
|
09-Dec-2020 |
X512 <danger_mail@list.ru> |
integrate AutoDeleter's into pointers Change-Id: I6c3925a7aec4d0647c76c2a03aad7b08985d7166 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3490 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: waddlesplash <waddlesplash@gmail.com>
|
#
00cbe4cc |
|
08-Aug-2018 |
Murai Takashi <tmurai01@gmail.com> |
Replace strncpy with strlcpy Since destination size equals number of characters to copy. Pointed out by gcc8. [-Werror=stringop-truncation] Change-Id: I8f2118129ec2324bb1f93857f5abfdf121c864f0 Reviewed-on: https://review.haiku-os.org/450 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com> Reviewed-by: Skipp_OSX <jscipione@gmail.com>
|
#
3b7b927d |
|
12-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
libbnetapi: Add BNetworkRoute to replace use of route_entry. The BNetworkRoute class manages a route_entry and the sockaddr's associated with it. It replaces the direct use of route_entry in the BNetworkInterface API. Using route_entry is fragile and inconvenient as it only holds pointers to the sockaddr's. When getting a list of routes from the kernel, each route_entry is set up so that its pointers point into the single flat buffer that is passed around. Creating a copy of the route_entry and then deleting the flat buffer makes the pointers in the copy stale. Returning these route entries therefore always lead to a use-after-free when they were eventually used. BNetworkRoute also takes over the code and functionallity of getting routes from RouteSupport. The corresponding method in BNetworkRoster is replaced by a static method in BNetworkRoute. Also distinguish between the default route and gateway of an interface. GetDefaultRoute() now gets the default BNetworkRoute for the interface while GetDefaultGateway() gets the associated gateway address within that default route. Adjust network preferences panel to this change. Note that we currently only seem to have per interface default routes and not an actual global default route. This was already the case before these changes and I did not further investigate what this means.
|
#
0bc61543 |
|
18-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Style fixes. Style fixes pointed out by Axel. I'm rusty, and it shows. Hope I got it right. Also moved get_route() into BPrivate.
|
#
41d42066 |
|
18-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Added family parameter to the GetRoutes() API. Moved common code to a private file.
|
#
905f910e |
|
16-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Network route API: Second try (WIP). Implement BNetworkRoster::GetRoutes() and BNetworkInterface::GetRoutes(). Also implement BNetworkInterface::GetDefaultGateway(). There is code duplication at the moment, and the api only supports IPV4.
|
#
0074cea3 |
|
15-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Implement BNetworkRoster::GetNextRoute() Implement BNetworkRoster::GetNextRoute() and used it in Network preflet.
|
#
4ab260da |
|
21-Apr-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Don't leak the socket. BNetworkRoster::AddInterface and RemoveInterface did not close the socket.
|
#
7d7b9632 |
|
09-Oct-2011 |
Michael Lotz <mmlr@mlotz.ch> |
* Remove the BNetworkDevice::AddPersistentNetwork() again and instead introduce BNetworkRoster::{Count|GetNext|Add|Remove}PersistentNetwork() as it fits better (thanks Philippe for the heads up). * Implement the backend for these functions in the net_server and also move conversion of the wireless_network based format into the settings based format there. * Implement removal of a network from the settings and make adding a new network with the same name replace the old one instead of just adding multiple ones. Might need to change this in the future depending on how we want to handle multiple networks with the same name (i.e. distinguish based on BSSID or similar). * Fix apparent oversight that caused configured networks _not_ to be used in the auto join attempt. * Remove auto joining open networks. I've been bitten by that more than once now because we happen to have an open network in the neighbourhood that I now accidentally used to transfer quite a bit of (unencrypted) stuff before noticing... In the future, one will instead have to explicitly join an open network once and store that config. Note that the driver will actually still auto-associate with open networks due to how things are set up currently. Note also that the auto join will fire join requests whenever there's a disassociation event, so you might see spurious join dialogs when the wpa_supplicant actually just re-establishes the connection. * Make join requests async again. Instead of waiting for a synchronous reply of the wpa_supplicant we instead return success when the request has been sent. While the API call might still be made synchronous again in the future, the net_server should really not block on an external application. In the case of the wpa_supplicant we would otherwise deadlock when using the new *PersistentNetwork() API after a successful join, and in other cases we might just unacceptably delay other calls. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42816 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
2977e788 |
|
23-Nov-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Added alternatives to AddInterface()/RemoveInterface() that take the name of the interface instead. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39591 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
530f5483 |
|
12-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Implemented AddInterface(), and RemoveInterface(). * Added comment explaining why using AF_INET is not really a good idea. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38057 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
cb7ce9a3 |
|
09-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Renamed DescriptorCloser to FileDescriptorCloser as suggested by Ingo. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37995 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
f65256c2 |
|
09-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Fixed a bug in BNetworkRoster::GetNextInterface() that caused an endless loop and always returned the first interface. * Fixed bug #6436 by using the new BNetworkRoster functionality. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37994 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c2808ea7 |
|
09-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Adapted API as needed, and implemented most of the C++ API - it's completely untested at this point, though. * Will port ifconfig, NetworkStatus, and the Network preferences application later in order to test the API. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37988 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
bf58f252 |
|
06-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Adapted headers after Stippi's suggestions - I won't add the const until I know how I implement that function :-) * Cleaned up libbnetapi.so Jamfile, removed non-Haiku target code. * Added empty files to the build to see that the headers are compiling. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37942 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
3b7b927dd01fc96efcda618430851e691ebdb313 |
|
12-Apr-2015 |
Michael Lotz <mmlr@mlotz.ch> |
libbnetapi: Add BNetworkRoute to replace use of route_entry. The BNetworkRoute class manages a route_entry and the sockaddr's associated with it. It replaces the direct use of route_entry in the BNetworkInterface API. Using route_entry is fragile and inconvenient as it only holds pointers to the sockaddr's. When getting a list of routes from the kernel, each route_entry is set up so that its pointers point into the single flat buffer that is passed around. Creating a copy of the route_entry and then deleting the flat buffer makes the pointers in the copy stale. Returning these route entries therefore always lead to a use-after-free when they were eventually used. BNetworkRoute also takes over the code and functionallity of getting routes from RouteSupport. The corresponding method in BNetworkRoster is replaced by a static method in BNetworkRoute. Also distinguish between the default route and gateway of an interface. GetDefaultRoute() now gets the default BNetworkRoute for the interface while GetDefaultGateway() gets the associated gateway address within that default route. Adjust network preferences panel to this change. Note that we currently only seem to have per interface default routes and not an actual global default route. This was already the case before these changes and I did not further investigate what this means.
|
#
0bc615438a8914183d02f7941b60cf025ff2a110 |
|
18-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Style fixes. Style fixes pointed out by Axel. I'm rusty, and it shows. Hope I got it right. Also moved get_route() into BPrivate.
|
#
41d4206692bec4352e7ea02ddb0222eab6b71884 |
|
18-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Added family parameter to the GetRoutes() API. Moved common code to a private file.
|
#
905f910e5364ca9b0e0ca98fe9e35fa6cffe42ed |
|
16-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Network route API: Second try (WIP). Implement BNetworkRoster::GetRoutes() and BNetworkInterface::GetRoutes(). Also implement BNetworkInterface::GetDefaultGateway(). There is code duplication at the moment, and the api only supports IPV4.
|
#
0074cea3988073da94edcc4879cebce67e0fa163 |
|
15-Nov-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Implement BNetworkRoster::GetNextRoute() Implement BNetworkRoster::GetNextRoute() and used it in Network preflet.
|
#
4ab260da8074c272e95f13258ee2826fcab1867a |
|
21-Apr-2013 |
Stefano Ceccherini <stefano.ceccherini@gmail.com> |
Don't leak the socket. BNetworkRoster::AddInterface and RemoveInterface did not close the socket.
|
#
7d7b9632250246bc3a60ae5c343f79c0236a9f02 |
|
09-Oct-2011 |
Michael Lotz <mmlr@mlotz.ch> |
* Remove the BNetworkDevice::AddPersistentNetwork() again and instead introduce BNetworkRoster::{Count|GetNext|Add|Remove}PersistentNetwork() as it fits better (thanks Philippe for the heads up). * Implement the backend for these functions in the net_server and also move conversion of the wireless_network based format into the settings based format there. * Implement removal of a network from the settings and make adding a new network with the same name replace the old one instead of just adding multiple ones. Might need to change this in the future depending on how we want to handle multiple networks with the same name (i.e. distinguish based on BSSID or similar). * Fix apparent oversight that caused configured networks _not_ to be used in the auto join attempt. * Remove auto joining open networks. I've been bitten by that more than once now because we happen to have an open network in the neighbourhood that I now accidentally used to transfer quite a bit of (unencrypted) stuff before noticing... In the future, one will instead have to explicitly join an open network once and store that config. Note that the driver will actually still auto-associate with open networks due to how things are set up currently. Note also that the auto join will fire join requests whenever there's a disassociation event, so you might see spurious join dialogs when the wpa_supplicant actually just re-establishes the connection. * Make join requests async again. Instead of waiting for a synchronous reply of the wpa_supplicant we instead return success when the request has been sent. While the API call might still be made synchronous again in the future, the net_server should really not block on an external application. In the case of the wpa_supplicant we would otherwise deadlock when using the new *PersistentNetwork() API after a successful join, and in other cases we might just unacceptably delay other calls. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42816 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
2977e7888fc13aa311106ad995e6665e82c73762 |
|
23-Nov-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Added alternatives to AddInterface()/RemoveInterface() that take the name of the interface instead. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39591 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
530f5483207d094a8ce31cdbb5fa0ab137469692 |
|
12-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Implemented AddInterface(), and RemoveInterface(). * Added comment explaining why using AF_INET is not really a good idea. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38057 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
cb7ce9a32f228cd69fd910424a7f2b405e2e22e4 |
|
09-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Renamed DescriptorCloser to FileDescriptorCloser as suggested by Ingo. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37995 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
f65256c2e7c311046ef89838d066d96a51688dd0 |
|
09-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Fixed a bug in BNetworkRoster::GetNextInterface() that caused an endless loop and always returned the first interface. * Fixed bug #6436 by using the new BNetworkRoster functionality. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37994 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
c2808ea7b2da2e03373962bc413c3c1c73a70e59 |
|
09-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Adapted API as needed, and implemented most of the C++ API - it's completely untested at this point, though. * Will port ifconfig, NetworkStatus, and the Network preferences application later in order to test the API. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37988 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
bf58f252deedcb8b22e8f9a92ed9a1663f67a58d |
|
06-Aug-2010 |
Axel Dörfler <axeld@pinc-software.de> |
* Adapted headers after Stippi's suggestions - I won't add the const until I know how I implement that function :-) * Cleaned up libbnetapi.so Jamfile, removed non-Haiku target code. * Added empty files to the build to see that the headers are compiling. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37942 a95241bf-73f2-0310-859d-f6bbb57e9c96
|