Age | Commit message (Collapse) | Author | Files | Lines |
|
The intial request is kept through the snep_data and
snep_core_process_request no longer relies on the last read frame to
build an answer but only on the snep_data pointer.
Without this fix, each fragment from a fragmented PUT was handled as
a complete SNEP frame (header included) which caused process_request
to get completely confused about how to handle fragments.
Now that snep_core_read is fixed, the fragmentation SNEP unit test can
be fixed as well.
|
|
When send or sendto fails the SDU still needs to be freed.
|
|
GetNDEF does not return any dictionary, it takes one as a parameter.
|
|
4a and 4b tags follow the same specs: the type 4 one from the NFC
Forum.
|
|
When receiving a 14443-B protocol mask, we should set the tag type to
NFC-B.
|
|
Display the right string depending ont the direction.
|
|
Due to a kernel bug, trying to connect through a non blocking socket
may fail and return POLLHUP. In that case the connection procedure falls
back to using blocking sockets and this needs to be delayed until the
kernel sends a DM to the peer.
This is slightly hackish but this code path should get obsolete once
neard runs on top of 3.10 or later kernels.
|
|
The p2p client connection used to be a blocking one, which can be quite
harmful when for some reason the peer does not reply to a connection
request.
The client socket is non blocking now and the actual push is handled
by a GLib watch callback.
|
|
The connect() call should not block forever. The 8 seconds timeout makes
it for approximately 3 times the maximum LTO and that seems to be plenty
of time for a peer to reply to an LLCP connection.
|
|
If the show_timestamp option is disabled, the string needs to be properly
terminated.
|
|
with --poll, --enable is now implicit
|
|
--enable (-1 for short) turns the specified device on
--disable (-0) turns it off
If both are specified, only --enable is applied
|
|
From D-Bus documentation for dbus_connection_send_with_reply():
"Warning: if the connection is disconnected or you try to send Unix file
descriptors on a connection that does not support them, the
DBusPendingCall will be set to NULL, so be careful with this."
Fix these errors when killing D-Bus daemon with the client still
running:
process 5712: arguments to dbus_pending_call_set_notify() were
incorrect, assertion "pending != NULL" failed in file
../../dbus/dbus-pending-call.c line 596.
This is normally a bug in some application using the D-Bus library.
process 5712: arguments to dbus_pending_call_unref() were incorrect,
assertion "pending != NULL" failed in file
../../dbus/dbus-pending-call.c line 572.
This is normally a bug in some application using the D-Bus library.
|
|
Fix this crash if D-Bus exits while the client is still connected to it:
==5570== Invalid read of size 1
==5570== at 0x402D28E: strcmp (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==5570== by 0x4070E22: g_str_equal (ghash.c:1704)
==5570== by 0x8055F61: message_filter (client.c:1123)
==5570== by 0x4141500: dbus_connection_dispatch (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==5570== by 0x80506F7: message_dispatch (mainloop.c:76)
==5570== by 0x4081A7E: g_timeout_dispatch (gmain.c:3882)
==5570== by 0x4080D85: g_main_context_dispatch (gmain.c:2539)
==5570== by 0x4081124: g_main_context_iterate.isra.21 (gmain.c:3146)
==5570== by 0x408156A: g_main_loop_run (gmain.c:3340)
==5570== by 0x41BF4D2: (below main) (libc-start.c:226)
==5570== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5570==
==5570==
|
|
Calling g_dbus_client_new followed by g_dbus_client_set_proxy_handlers
cause two calls to GetManagedObjects in a row as GetNameOwner reply is
asyncronously it triggers the second call because the handlers have
been set by g_dbus_client_set_proxy_handlers.
|
|
This adds support for decoding NDEF records embedded in SNEP packets
|
|
If we display less than 0xFFFF bytes (which will be the case 99.999%
of the time) the offset value is truncated and the 2 first zero bytes
are not displayed.
|
|
This will print SNEP decoding errors in bold red
|
|
|
|
snep_printf_msg already contains one.
|
|
|
|
And prepare for more colors...
|
|
SNEP decoding is colored now, for a more readable output.
|
|
Take an indentation length instead of a generic prefix, as this is
what's only used anyway.
|
|
SNEP stands for Simple NDEF Exchange Protocol, not Messaging Protocol.
|
|
This adds support for decoding Simple NDF Message Protocol. The SNEP decoder
supports aggregation of fragmented messages.
|
|
In the LLCP header of a received frame, dsap is the local port and ssap is the
remote port. ssap and dsap fields of the sniffer_packet structure have been
renamed to local_sap and remote_sap to avoid confusion.
|
|
Raw socket header (direction and adapter index) and LLCP info are now stored
into the same struct (sniffer_packet). This structure is then passed to PDU
specific decoding functions.
|
|
The handlers hash table was not freed
|
|
Otherwise the callback function may be call twice and
write_msg is unreferenced twice:
process 1868: arguments to dbus_message_unref() were incorrect,
assertion "message != NULL" failed in file dbus-message.c line 1616
0 0xb7fe1424 in __kernel_vsyscall ()
1 0xb7bcfcc1 in raise () from /lib/libc.so.6
2 0xb7bd30ee in abort () from /lib/libc.so.6
3 0xb7da5045 in _dbus_abort () from /usr/lib/libdbus-1.so.3
4 0xb7d99f86 in _dbus_warn_check_failed () from /usr/lib/libdbus-1.so.3
5 0xb7d8856e in dbus_message_unref () from /usr/lib/libdbus-1.so.3
6 0x08062a63 in tag_read_cb (adapter_idx=0, target_idx=6, status=0)
at src/tag.c:240
7 0x08063277 in near_tag_add_records (tag=0x8081a30, records=0x8080270,
cb=0x8062a30 <tag_read_cb>, status=0) at src/tag.c:814
|
|
We need to get name value from var instead of the container iter
else it may also cause neard crash:
process 1044: type variant 118 not a basic type
0 0xb7fe1424 in __kernel_vsyscall ()
1 0xb7bcfcc1 in raise () from /lib/libc.so.6
2 0xb7bd30ee in abort () from /lib/libc.so.6
3 0xb7da5045 in _dbus_abort () from /usr/lib/libdbus-1.so.3
4 0xb7d99f86 in _dbus_warn_check_failed () from /usr/lib/libdbus-1.so.3
5 0xb7d9bc9c in _dbus_marshal_read_basic () from /usr/lib/libdbus-1.so.3
6 0xb7d84e0f in _dbus_type_reader_read_basic () from /usr/lib/libdbus-1.so.3
7 0xb7d89f0b in dbus_message_iter_get_basic () from /usr/lib/libdbus-1.so.3
8 0x0806b638 in bt_adapter_property_changed (conn=0x80814c8,
message=0x8081870, user_data=0x0) at src/bluetooth.c:445
|
|
|
|
In "crash-1" loop, the snep_data was added to the slist, but not removed
because of a specific exit condition. This fix swaps the test condition
and the action on slist, in order to add the fragment only when the length
test passed.
|
|
An uint can't be less than 0...
|
|
snap_len now really limits sniffer output.
|
|
This fixes the size of the recv buffer for the sniffer. Frames can be
up to 7ff+128+(llcp, seq, and raw headers) bytes.
|
|
DefaultPowered is a boolean and will force neard into turning any detected
adapter on when set to TRUE.
|
|
g_atomic_* end up using G_STATIC_ASSERT, causing gcc 4.8 to yell due to
-Wunused-local-typedefs.
gdbus/client.c: In function ‘g_dbus_client_ref’:
/usr/include/glib-2.0/glib/gmacros.h:162:53: error: typedef ‘_GStaticAssertCompileTimeAssertion_2’ locally defined but not used [-Werror=unused-local-typedefs]
#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1]
|
|
In case a property did not appear by the time proxy_added was called
property_changed has to be called if it appear latter otherwise the
application will be unaware of it.
|
|
This llcp validation server follows NFC Forum requirements and scenarios
and supports the initial list of 9 test cases.
Most of these tests rely on sending frames to an echo server, using
connection less or connection oriented modes.
|
|
Some validation tests are done in connection less mode. near_p2p_driver
now handles not only stream socket but also datagram socket.
|
|
Added test cases to test WSC MIME type NDEF build.
|
|
Added api to prepare MIME type WSC record for unit tests.
|
|
Removed unnecessary debug statement which is added with
56a275c8841352a9c8a60bdcb3e63ba69fe783c6 commit.
|
|
|
|
|
|
If sending the fragment fails, server should remove all
the remaining fragments.
|
|
Added test script to write mime type on tag. Currently it
supports application/vnd.wfa.wsc mime type.
|
|
Implemented mime type record building upon dbus request.
Currently it supports application/vnd.wfa.wsc.
|
|
|