]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - ugw/ugw.c
New tests
[can-benchmark.git] / ugw / ugw.c
index e2c04ef7f7e9581d86fc70cff41b41f06190dc9a..243fc5a3c562f891d7c74b7cc7273b8758796e4e 100644 (file)
--- a/ugw/ugw.c
+++ b/ugw/ugw.c
@@ -93,7 +93,7 @@ enum in2out in_read(struct in_ctx *ctx, struct can_frame *cf)
                perror("read");
                exit(1);
        }
                perror("read");
                exit(1);
        }
-       return SEND;
+       return STORE_ONLY;
 }
 
 void init_read(struct in_ctx *ctx)
 }
 
 void init_read(struct in_ctx *ctx)
@@ -234,8 +234,10 @@ int out_packet_tx(struct out_ctx *ctx, struct can_frame *cf)
 {
        volatile struct tpacket2_hdr *hdr = ctx->ptr + ctx->current*FRAME_SIZE;
 
 {
        volatile struct tpacket2_hdr *hdr = ctx->ptr + ctx->current*FRAME_SIZE;
 
-       if (ctx->from_in == NOP)
+       if (ctx->from_in == NOP) {
+               CHECK(send(ctx->s, NULL, 0, 0));
                return 0;
                return 0;
+       }
 
        while (hdr->tp_status != TP_STATUS_AVAILABLE) {
                CHECK(send(ctx->s, NULL, 0, 0));
 
        while (hdr->tp_status != TP_STATUS_AVAILABLE) {
                CHECK(send(ctx->s, NULL, 0, 0));