• Marcel Holtmann's avatar
    [Bluetooth] Fix resetting to default filters · 1317c324
    Marcel Holtmann authored
    The problem is that after a successful connection between the Windows
    Bluetooth stack and the Linux Bluez stack, no packets from the device
    ever reach the PC running Windows XP Service Pack 2. That is, a ping
    from the PC never receives a response, and a ping from BlueZ never
    reaches the PC. Linux packet statistics show that the PC packets are
    received, but all return traffic seems to be routed over the loopback
    interface.
    
    Immediately after creating the BNEP connection with BlueZ, the Windows
    Bluetooth stack sends a BNEP_FILTER_NET_TYPE_SET_MSG with an effective
    length of zero. BlueZ interprets this message to mean that no filter
    ranges should be allowed. The code zeros the first entry in the filter
    list, which is than interpreted as meaning that no ranges of acceptable
    packets are available. This interpretation is wrong and leads to all
    packets being rejected by BNEP.
    
    The Bluetooth BNEP specification clearly states the following:
    
    The length (in octets) of this message is 4+4*N, where N is the number
    of disjoint ranges of Networking protocol types that form the complete
    set. Note that N=0 (empty set) denotes a reset to default filters (if
    any) supported by the remote device.
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    1317c324
core.c 15.4 KB