From 8dde0d31b675bccbbc4233dec45eb8c66c6eebb6 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Thu, 25 Oct 2012 15:19:31 +0200 Subject: [PATCH] Pass transport type to time stamping initialization function. Signed-off-by: Richard Cochran Acked-by: Jacob Keller Tested-by: Jiri Benc --- raw.c | 2 +- sk.c | 3 ++- sk.h | 12 +++++++----- udp.c | 2 +- udp6.c | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/raw.c b/raw.c index 3fe04c1..5511582 100644 --- a/raw.c +++ b/raw.c @@ -206,7 +206,7 @@ static int raw_open(struct transport *t, char *name, if (gfd < 0) goto no_general; - if (sk_timestamping_init(efd, name, ts_type)) + if (sk_timestamping_init(efd, name, ts_type, TRANS_IEEE_802_3)) goto no_timestamping; fda->fd[FD_EVENT] = efd; diff --git a/sk.c b/sk.c index b006c57..cd9aa11 100644 --- a/sk.c +++ b/sk.c @@ -223,7 +223,8 @@ int sk_receive(int fd, void *buf, int buflen, return cnt; } -int sk_timestamping_init(int fd, char *device, enum timestamp_type type) +int sk_timestamping_init(int fd, char *device, enum timestamp_type type, + enum transport_type transport) { int flags; diff --git a/sk.h b/sk.h index b2787b2..b6ce88c 100644 --- a/sk.h +++ b/sk.h @@ -61,12 +61,14 @@ int sk_receive(int fd, void *buf, int buflen, /** * Enable time stamping on a given network interface. - * @param fd An open socket. - * @param device The name of the network interface to configure. - * @param type The requested flavor of time stamping. - * @return Zero on success, non-zero otherwise. + * @param fd An open socket. + * @param device The name of the network interface to configure. + * @param type The requested flavor of time stamping. + * @param transport The type of transport used. + * @return Zero on success, non-zero otherwise. */ -int sk_timestamping_init(int fd, char *device, enum timestamp_type type); +int sk_timestamping_init(int fd, char *device, enum timestamp_type type, + enum transport_type transport); /** * Limits the number of RECVMSG(2) calls when attempting to obtain a diff --git a/udp.c b/udp.c index b361ff4..d0aab6f 100644 --- a/udp.c +++ b/udp.c @@ -155,7 +155,7 @@ static int udp_open(struct transport *t, char *name, struct fdarray *fda, if (gfd < 0) goto no_general; - if (sk_timestamping_init(efd, name, ts_type)) + if (sk_timestamping_init(efd, name, ts_type, TRANS_UDP_IPV4)) goto no_timestamping; fda->fd[FD_EVENT] = efd; diff --git a/udp6.c b/udp6.c index 115cd83..e6023a6 100644 --- a/udp6.c +++ b/udp6.c @@ -154,7 +154,7 @@ static int udp6_open(struct transport *t, char *name, struct fdarray *fda, if (gfd < 0) goto no_general; - if (sk_timestamping_init(efd, name, ts_type)) + if (sk_timestamping_init(efd, name, ts_type, TRANS_UDP_IPV6)) goto no_timestamping; fda->fd[FD_EVENT] = efd;