Applying patch by Atis Elsts:

* fix connecting to INADDR_ANY work for tcp (effectively will
  connect to INADDR_LOOPBACK)
* add same behaviour to udp
* move some ipv4-specific code out of tcp into ipv4 address module
* bind() and connect() now reject addresses from non-matching 
  families
* myself: minor cleanup in udp.cpp with respect to 80 chars limit
Closes #5716 - many thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36192 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2010-04-12 18:39:34 +00:00
parent 5608589f03
commit 56f097ebd9
10 changed files with 309 additions and 19 deletions
+3
View File
@@ -113,6 +113,7 @@ struct net_address_module_info {
bool (*equal_masked_addresses)(const sockaddr *a, const sockaddr *b,
const sockaddr *mask);
bool (*is_empty_address)(const sockaddr *address, bool checkPort);
bool (*is_same_family)(const sockaddr *address);
int32 (*first_mask_bit)(const sockaddr *mask);
@@ -142,6 +143,8 @@ struct net_address_module_info {
bool (*matches_broadcast_address)(const sockaddr *address,
const sockaddr *mask, const sockaddr *broadcastAddr);
void (*get_loopback_address)(sockaddr *result);
};
#endif // NET_DATALINK_H