diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-07-29 12:34:29 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-07-29 12:34:29 +0200 |
commit | 17bfc06e9c16851c42121357735996c12ca2f52b (patch) | |
tree | 579dd88e8db237134ac6ddbd6d39193b2d51dcab /src/modules/mavlink | |
parent | e3bc5571556d043ad5c8c4fcabd1f9b371599397 (diff) | |
parent | c439db421a6dc32c5e37cdd3841200a00c338d99 (diff) | |
download | px4-firmware-17bfc06e9c16851c42121357735996c12ca2f52b.tar.gz px4-firmware-17bfc06e9c16851c42121357735996c12ca2f52b.tar.bz2 px4-firmware-17bfc06e9c16851c42121357735996c12ca2f52b.zip |
Merge branch 'master' into mavlinkrates2
Diffstat (limited to 'src/modules/mavlink')
-rw-r--r-- | src/modules/mavlink/mavlink_main.cpp | 7 | ||||
-rw-r--r-- | src/modules/mavlink/mavlink_receiver.cpp | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 69beb9cc9..49781e8f8 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -383,7 +383,12 @@ Mavlink::forward_message(const mavlink_message_t *msg, Mavlink *self) Mavlink *inst; LL_FOREACH(_mavlink_instances, inst) { if (inst != self) { - inst->pass_message(msg); + + /* if not in normal mode, we are an onboard link + * onboard links should only pass on messages from the same system ID */ + if(!(self->_mode != MAVLINK_MODE_NORMAL && msg->sysid != mavlink_system.sysid)) { + inst->pass_message(msg); + } } } } diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 54c412ce7..69e3ef31d 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -241,7 +241,8 @@ MavlinkReceiver::handle_message_command_long(mavlink_message_t *msg) } else { if (msg->sysid == mavlink_system.sysid && msg->compid == mavlink_system.compid) { - warnx("ignoring CMD spoofed with same SYS/COMP ID"); + warnx("ignoring CMD spoofed with same SYS/COMP (%d/%d) ID", + mavlink_system.sysid, mavlink_system.compid); return; } |