Commit Graph

14 Commits (3ff62648fa75f9649a4dd8fa45d42f42c48adf56)

Author SHA1 Message Date
Richard Cochran 9d4d68e667 Add missing release method to the UDPv4 transport.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-17 17:30:21 +01:00
Richard Cochran 319aae1403 Move some sharable socket code into its own source file.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-17 17:30:21 +01:00
Richard Cochran 29463cd306 Make the transport layer more opaque.
Although the UDP/IPv4 layer does not need any state per instance (other
than the two file descriptors), the raw Ethernet layer will need this.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-13 08:28:37 +01:00
Richard Cochran a9e88a0a49 Fix segfault after missing transmit time stamp.
If the networking stack fails to provide a transmit time stamp, then we
might feed uninitialized stack data to the CMSG(3) macros. This can result
in a segfault or other badness.

The fix is to simply clear the control buffer in advance.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-11 09:45:23 +01:00
Richard Cochran 150da0cba9 Remove silly and incorrect error message.
Commit 32133050 introduced a bug that gives a bogus error message on
every 'general' (non-event) PTP packet. If we want to catch missing
time stamps, then it has to occur at the port level.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-04 11:33:22 +01:00
Richard Cochran 321330501f Be more verbose about errors on the receive path.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-03-04 08:23:40 +01:00
Richard Cochran 347b42b7d5 udp: Use the bind to device socket option.
Without this Linux specific option, multicast packets arrive on one
interface are delivered by the kernel to all others.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:54 +01:00
Richard Cochran 95d5c36c0f udp: turn off multicast loop back.
This option is on by default, but we don't want or need it.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:54 +01:00
Richard Cochran 5555a2f029 udp: Use the IP_ADD_MEMBERSHIP socket option.
For some reason, MCAST_JOIN_GROUP is not working under uClinux. We can
just stick with the more traditional method.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2012-01-07 08:07:53 +01:00
Richard Cochran 447d4d442c udp: bring a warning or error if the driver changes our hwtstamp options.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-12-18 09:35:41 +01:00
Richard Cochran b0d547cac4 udp: use the message logging facility instead of stdio.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-12-18 08:21:47 +01:00
Richard Cochran cecc20a307 udp: wait longer for transmit time stamps
Some hardware is a bit pokey. We now wait forever on EINTR and just a
little bit on EAGAIN.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-12-13 05:28:54 +01:00
Richard Cochran 5f7facdc63 Bind transmitted packets to the port's network interface.
Even though the MCAST_JOIN_GROUP socket option includes the interface
index, this applies to the received packets only. To bind the outgoing
packets to a particular interface, the IP_MULTICAST_IF option is needed.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-20 18:31:33 +01:00
Richard Cochran 60f3a85463 Add transport over UDP IPv4.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-06 08:16:19 +01:00