+ /* check for filter configuration commands */
+ if (rxcmd == 'm' || rxcmd == 'M') {
+ rxbuf[9] = 0; /* terminate filter string */
+
+ if (rxcmd == 'm') {
+ fi.can_id = strtoul(rxbuf+1,NULL,16);
+ fi.can_id &= CAN_EFF_MASK;
+ } else {
+ fi.can_mask = strtoul(rxbuf+1,NULL,16);
+ fi.can_mask &= CAN_EFF_MASK;
+ }
+
+ /* set only when both values are defined */
+ if (fi.can_id != CAN_ERR_FLAG &&
+ fi.can_mask != CAN_ERR_FLAG)
+ setsockopt(s, SOL_CAN_RAW,
+ CAN_RAW_FILTER, &fi,
+ sizeof(struct can_filter));
+ }
+