title: SocketCAN read from socket only returns 11cobid
body: <p>I am trying to read from a socketCAN and the msg is always filtered for the 11bit identifier.
  This should be a problem fixable with setting the rpoper flags for the 29bit identifier but I can`t find where if anyone can help...</p>
  <pre><code>    struct can_frame message;
      struct sockaddr_can addr;
      struct ifreq ifr;
      int   fd = -1;                  // file descriptor (itÂ´s a socket)
  
      if((fd = socket(PF_CAN, SOCK_RAW, CAN_RAW)) &lt; 0)
      {
          LE_INFO(&quot;cannot open socket&quot;);
          return;
      }
      strcpy(ifr.ifr_name, &quot;can0&quot;);
      ioctl(fd, SIOCGIFINDEX, &amp;ifr);
      addr.can_family = AF_CAN;
      addr.can_ifindex = ifr.ifr_ifindex;
      if(bind(fd, (struct sockaddr *)&amp;addr, sizeof(addr)) &lt; 0)
      {
          printf(&quot;cannot bind socket\n&quot;);
          return;
      }
  
      uint8_t nbytes;
  
      message.can_id |= CAN_EFF_FLAG;
  
      while(1)
      {
          nbytes = read(fd, &amp;message, sizeof(struct can_frame));
  
          if (nbytes &lt; 0) {
                  perror(&quot;can raw socket read&quot;);
                  return;
          }
  
          /* paranoid check ... */
          if (nbytes &lt; sizeof(struct can_frame)) {
                  fprintf(stderr, &quot;read: incomplete CAN frame\n&quot;);
                  return;
          }
  
          printf(&quot;READ COB_ID:%x\n&quot;,message.can_id | CAN_EFF_FLAG);
          
      }
      return;
  </code></pre>
  <p>I am sending a CAN frame with idx x901 and this is what is printed:</p>
  <p>READ COB_ID:80000101</p>
  <p>READ COB_ID:80000101</p>
  <p>READ COB_ID:80000101</p>
  <p>I have troubleshooted this in many different ways and it seems that the C code is working as it should, but I suspect the problem to be with the kernel module for either mcp251x which is not correctly receiving the extended flag? Or it may be with some initialization I need to do before running the kernel module???</p>
  <p>Thank you in advance to anyone who can help.</p>