This is a warning coming up on Android (ARM) platform.
Clang 4.x creates a false positive here: the can_id is the first
(and aligned) value in the packed struct modattr, so it's always
aligned if the struct itself is aligned.
Similar to referencing iptables rules by their line number this UID allows to
reference created routing jobs, e.g. to alter configured data modifications.
The UID is an optional non-zero value which can be provided at routing job
creation time. When the UID is set the UID replaces the data modification
configuration as job identification attribute e.g. at job removal time.
The UID option is provided by mainline Linux 4.2+
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Usually the received CAN frames can be processed/routed as much as 'max_hops'
times (which is given at module load time of the can-gw module).
Introduce a new configuration option ( -l <hops> ) to reduce the number of
possible hops for a specific gateway rule to a value smaller then max_hops.
Mainline upstream commit:
http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=391ac1282dd7ff1cb8245cccc5262e8e4173edc4
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
A configured inverse filter e.g.
cangw -A -s can0 -d can1 -e -f 123~7FF
has been displayed with 'cangw -L' like this:
cangw -A -s can0 -d can1 -e -f 20000123:7FF # 0 handled 0 dropped 0 deleted
While 0x20000000 was the value of CAN_INV_FILTER.
This patch fixes the output to the expected display:
cangw -A -s can0 -d can1 -e -f 123~7FF # 0 handled 0 dropped 0 deleted
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Added new option '-i' for can-gw rules to allow to route CAN frames back to the
originating/incoming CAN interface (which is disabled by default).
CAN frames that are deleted due to the violation of the max_hops limit are now
printed when displaying the configured rules with 'cangw -L'.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
The options to for adding checksums (-c or -x) can only be used in conjunction
with modifications (-m) applied to the routed CAN frames.
Signed-off-by: Andre Naujoks <nautsch2@googlemail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
On 64bit systems a 'long' is a 64bit value but the target values of scanf()
are always 32bit in the affected code - which means just an 'unsigned int'.
Unsigned int is fine on 32 and 64 bit systems.
Thanks to Andre Naujoks for reporting this issue.
Major changes:
- rework internal structures to prepare routings and modifications of CAN traffic also to non-CAN interfaces
- fix reading of netlink messages in cangw.c (added RTCAN_RTA / RTCAN_PAYLOAD macros)
- rework reading of gw-job lists in cgw_dump_jobs()
- rename of functions and API definitions to have a common namespace cgw_
- added infrastructure to perform crc8 and xor checksums in CAN frame data[]
TODO:
- add and test functionality for crc8 and xor checksums in CAN frame data[]
- add help text for crc8 and xor checksums in CAN frame data[]
TODO (in both cangw and can-gw.ko) : Support removal and listing of rules.
So far the gateway jobs are only removed on can-gw.ko module unload or when
the used CAN netdevices disappear.