socket has several filter options e.g. ID-Masking / Errorframes.
To receive/send raw CAN messages, use AF_CAN with protocol CAN_RAW.
-config CAN_RAW_USER
- bool "Allow non-root users to access Raw CAN Protocol sockets"
- depends on CAN_RAW
- default N
- ---help---
- The Controller Area Network is a local field bus transmitting only
- broadcast messages without any routing and security concepts.
- In the majority of cases the user application has to deal with
- raw CAN frames. Therefore it might be reasonable NOT to restrict
- the CAN access only to the user root, as known from other networks.
- Since CAN_RAW sockets can only send and receive frames to/from CAN
- interfaces this does not affect security of others networks.
- Say Y here if you want non-root users to be able to access CAN_RAW
- sockets.
-
config CAN_BCM
tristate "Broadcast Manager CAN Protocol (with content filtering)"
depends on CAN
CAN messages are used on the bus (e.g. in automotive environments).
To use the Broadcast Manager, use AF_CAN with protocol CAN_BCM.
-config CAN_BCM_USER
- bool "Allow non-root users to access CAN broadcast manager sockets"
- depends on CAN_BCM
- default N
- ---help---
- The Controller Area Network is a local field bus transmitting only
- broadcast messages without any routing and security concepts.
- In the majority of cases the user application has to deal with
- raw CAN frames. Therefore it might be reasonable NOT to restrict
- the CAN access only to the user root, as known from other networks.
- Since CAN_BCM sockets can only send and receive frames to/from CAN
- interfaces this does not affect security of others networks.
- Say Y here if you want non-root users to be able to access CAN_BCM
- sockets.
-
config CAN_DEBUG_CORE
bool "CAN Core debugging messages"
depends on CAN
static struct proc_dir_entry *proc_dir;
-#ifdef CONFIG_CAN_BCM_USER
-#define BCM_CAP (-1)
-#else
-#define BCM_CAP CAP_NET_RAW
-#endif
+/* CAN BCM sockets capability needs */
+#define CAN_BCM_CAP CAN_CAP
struct bcm_sock {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
static struct can_proto bcm_can_proto __read_mostly = {
.type = SOCK_DGRAM,
.protocol = CAN_BCM,
- .capability = BCM_CAP,
+ .capability = CAN_BCM_CAP,
.ops = &bcm_ops,
.prot = &bcm_proto,
};
static struct can_proto bcm_can_proto __read_mostly = {
.type = SOCK_DGRAM,
.protocol = CAN_BCM,
- .capability = BCM_CAP,
+ .capability = CAN_BCM_CAP,
.ops = &bcm_ops,
.owner = THIS_MODULE,
.obj_size = sizeof(struct bcm_sock),
MODULE_PARM_DESC(debug, "debug print mask: 1:debug, 2:frames, 4:skbs");
#endif
-#ifdef CONFIG_CAN_RAW_USER
-#define RAW_CAP (-1)
-#else
-#define RAW_CAP CAP_NET_RAW
-#endif
+/* CAN RAW sockets capability needs */
+#define CAN_RAW_CAP CAN_CAP
#define MASK_ALL 0
static struct can_proto raw_can_proto __read_mostly = {
.type = SOCK_RAW,
.protocol = CAN_RAW,
- .capability = RAW_CAP,
+ .capability = CAN_RAW_CAP,
.ops = &raw_ops,
.prot = &raw_proto,
};
static struct can_proto raw_can_proto __read_mostly = {
.type = SOCK_RAW,
.protocol = CAN_RAW,
- .capability = RAW_CAP,
+ .capability = CAN_RAW_CAP,
.ops = &raw_ops,
.owner = THIS_MODULE,
.obj_size = sizeof(struct raw_sock),