* Fix binding to link level sockets. The bound type was constructed using the
sdl_e_type in network byte order, causing such a socket not to receive anything. When working around that by not using htons() on bind, sending would then fail on such a socket because the byte order is actually required to be swapped there. * Extend the comment for the B_NET_FRAME_TYPE macro to document that the input types are supposed to be in host byte order to avoid future confusion. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42357 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -77,7 +77,7 @@ typedef struct ancillary_data_container ancillary_data_container;
|
|||||||
|
|
||||||
#define B_NET_FRAME_TYPE(super, sub) (((int32)(super) << 16) | (sub))
|
#define B_NET_FRAME_TYPE(super, sub) (((int32)(super) << 16) | (sub))
|
||||||
// Use this when registering a device handler, see net/if_types.h for
|
// Use this when registering a device handler, see net/if_types.h for
|
||||||
// the possible "super" values.
|
// the possible "super" values. Input values are in host byte order.
|
||||||
|
|
||||||
|
|
||||||
// sub types
|
// sub types
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ LinkProtocol::Bind(const sockaddr* address)
|
|||||||
|
|
||||||
if (linkAddress.sdl_type != 0) {
|
if (linkAddress.sdl_type != 0) {
|
||||||
fBoundType = B_NET_FRAME_TYPE(linkAddress.sdl_type,
|
fBoundType = B_NET_FRAME_TYPE(linkAddress.sdl_type,
|
||||||
linkAddress.sdl_e_type);
|
ntohs(linkAddress.sdl_e_type));
|
||||||
// Bind to the type requested - this is needed in order to
|
// Bind to the type requested - this is needed in order to
|
||||||
// receive any buffers
|
// receive any buffers
|
||||||
// TODO: this could be easily changed by introducing catch all or rule
|
// TODO: this could be easily changed by introducing catch all or rule
|
||||||
|
|||||||
Reference in New Issue
Block a user