Pass transport type to time stamping initialization function.
Signed-off-by: Richard Cochran <richardcochran@gmail.com> Acked-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Jiri Benc <jbenc@redhat.com>master
parent
7894339cdd
commit
8dde0d31b6
2
raw.c
2
raw.c
|
@ -206,7 +206,7 @@ static int raw_open(struct transport *t, char *name,
|
||||||
if (gfd < 0)
|
if (gfd < 0)
|
||||||
goto no_general;
|
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;
|
goto no_timestamping;
|
||||||
|
|
||||||
fda->fd[FD_EVENT] = efd;
|
fda->fd[FD_EVENT] = efd;
|
||||||
|
|
3
sk.c
3
sk.c
|
@ -223,7 +223,8 @@ int sk_receive(int fd, void *buf, int buflen,
|
||||||
return cnt;
|
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;
|
int flags;
|
||||||
|
|
||||||
|
|
4
sk.h
4
sk.h
|
@ -64,9 +64,11 @@ int sk_receive(int fd, void *buf, int buflen,
|
||||||
* @param fd An open socket.
|
* @param fd An open socket.
|
||||||
* @param device The name of the network interface to configure.
|
* @param device The name of the network interface to configure.
|
||||||
* @param type The requested flavor of time stamping.
|
* @param type The requested flavor of time stamping.
|
||||||
|
* @param transport The type of transport used.
|
||||||
* @return Zero on success, non-zero otherwise.
|
* @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
|
* Limits the number of RECVMSG(2) calls when attempting to obtain a
|
||||||
|
|
2
udp.c
2
udp.c
|
@ -155,7 +155,7 @@ static int udp_open(struct transport *t, char *name, struct fdarray *fda,
|
||||||
if (gfd < 0)
|
if (gfd < 0)
|
||||||
goto no_general;
|
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;
|
goto no_timestamping;
|
||||||
|
|
||||||
fda->fd[FD_EVENT] = efd;
|
fda->fd[FD_EVENT] = efd;
|
||||||
|
|
2
udp6.c
2
udp6.c
|
@ -154,7 +154,7 @@ static int udp6_open(struct transport *t, char *name, struct fdarray *fda,
|
||||||
if (gfd < 0)
|
if (gfd < 0)
|
||||||
goto no_general;
|
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;
|
goto no_timestamping;
|
||||||
|
|
||||||
fda->fd[FD_EVENT] = efd;
|
fda->fd[FD_EVENT] = efd;
|
||||||
|
|
Loading…
Reference in New Issue