]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
Do not handle packets shorter that sizeof(struct can_frame)
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 20 Dec 2012 15:11:47 +0000 (16:11 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 20 Dec 2012 15:11:47 +0000 (16:11 +0100)
net/can/canethgw.c

index c1dac0fd20ddc0118ec390699b7e20aadcfb4511..6dda6f36dcdda7e0fbc53cf68870c9eb0a883b05 100644 (file)
@@ -141,7 +141,7 @@ static int cegw_can2udp(void* data)
 
                ret = kernel_recvmsg(can_sock, &mh, &vec, 1,
                                     sizeof(cf), 0);
-               if (ret < 1)
+               if (ret != sizeof(cf))
                        break;
 
                cf.can_id = cpu_to_be32(cf.can_id);