Skip to content

Commit

Permalink
Pass transport type to time stamping initialization function.
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Cochran <[email protected]>
Acked-by: Jacob Keller <[email protected]>
Tested-by: Jiri Benc <[email protected]>
  • Loading branch information
richardcochran committed Oct 29, 2012
1 parent 7894339 commit 8dde0d3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion sk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 7 additions & 5 deletions sk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion udp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8dde0d3

Please sign in to comment.