diff --git a/raw.c b/raw.c index 5511582..8e22be4 100644 --- a/raw.c +++ b/raw.c @@ -286,7 +286,7 @@ static int raw_send(struct transport *t, struct fdarray *fda, int event, int pee /* * Get the time stamp right away. */ - return event ? sk_receive(fd, pkt, len, hwts, MSG_ERRQUEUE) : cnt; + return event == TRANS_EVENT ? sk_receive(fd, pkt, len, hwts, MSG_ERRQUEUE) : cnt; } static void raw_release(struct transport *t) diff --git a/transport.h b/transport.h index caa07a3..bfdff3d 100644 --- a/transport.h +++ b/transport.h @@ -34,6 +34,16 @@ enum transport_type { TRANS_UDS, }; +/** + * Values for the 'event' parameter in transport_send() and + * transport_peer(). + */ +enum transport_event { + TRANS_GENERAL, + TRANS_EVENT, + TRANS_ONESTEP, +}; + enum timestamp_type { TS_SOFTWARE, TS_HARDWARE, diff --git a/udp.c b/udp.c index ea92794..e16030d 100644 --- a/udp.c +++ b/udp.c @@ -198,7 +198,7 @@ static int udp_send(struct transport *t, struct fdarray *fda, int event, int pee /* * Get the time stamp right away. */ - return event ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt; + return event == TRANS_EVENT ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt; } static void udp_release(struct transport *t) diff --git a/udp6.c b/udp6.c index 9e68574..490a780 100644 --- a/udp6.c +++ b/udp6.c @@ -224,7 +224,7 @@ static int udp6_send(struct transport *t, struct fdarray *fda, int event, int pe /* * Get the time stamp right away. */ - return event ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt; + return event == TRANS_EVENT ? sk_receive(fd, junk, len, hwts, MSG_ERRQUEUE) : cnt; } static void udp6_release(struct transport *t)