diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b71a5b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +SOURCES/clknetsim-8b4842.tar.gz +SOURCES/linuxptp-2.0.tgz +SOURCES/linuxptp-testsuite-a7f6e1.tar.gz diff --git a/.linuxptp.metadata b/.linuxptp.metadata new file mode 100644 index 0000000..03e8cd2 --- /dev/null +++ b/.linuxptp.metadata @@ -0,0 +1,3 @@ +b674017c26433870107fb18e160c7d88d7d2eb86 SOURCES/clknetsim-8b4842.tar.gz +592ca42c6146a79c1fcabed7c19fa7af4803d4f6 SOURCES/linuxptp-2.0.tgz +2b8edc55e4967660a0c4a3892c817c0e8f55c3bc SOURCES/linuxptp-testsuite-a7f6e1.tar.gz diff --git a/SOURCES/linuxptp-addreq.patch b/SOURCES/linuxptp-addreq.patch new file mode 100644 index 0000000..284f7ee --- /dev/null +++ b/SOURCES/linuxptp-addreq.patch @@ -0,0 +1,12 @@ +diff -up linuxptp-2.0/util.c.addreq linuxptp-2.0/util.c +--- linuxptp-2.0/util.c.addreq 2019-03-25 11:43:55.878146767 +0100 ++++ linuxptp-2.0/util.c 2019-03-25 11:44:38.215244483 +0100 +@@ -78,7 +78,7 @@ int addreq(enum transport_type type, str + case TRANS_UDP_IPV4: + bufa = &a->sin.sin_addr; + bufb = &b->sin.sin_addr; +- len = sizeof(a->sin); ++ len = sizeof(a->sin.sin_addr); + break; + case TRANS_IEEE_802_3: + bufa = &a->sll.sll_addr; diff --git a/SOURCES/linuxptp-headers.patch b/SOURCES/linuxptp-headers.patch new file mode 100644 index 0000000..c1aca97 --- /dev/null +++ b/SOURCES/linuxptp-headers.patch @@ -0,0 +1,51 @@ +commit d663a483c40939bad58301c256d86da1f3da6cc0 +Author: Miroslav Lichvar +Date: Tue Nov 13 13:16:08 2018 +0100 + + Fix building with new kernel headers. + + net_tstamp.h in recent kernel versions requires time.h for clockid_t. + + Signed-off-by: Miroslav Lichvar + +diff --git a/clock.c b/clock.c +index 9c493c3..8533b39 100644 +--- a/clock.c ++++ b/clock.c +@@ -17,11 +17,11 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include ++#include + #include + #include + #include + #include +-#include + #include + + #include "address.h" +diff --git a/sk.c b/sk.c +index e2b1f28..30162eb 100644 +--- a/sk.c ++++ b/sk.c +@@ -18,6 +18,7 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include ++#include + #include + #include + #include +diff --git a/timemaster.c b/timemaster.c +index 058678f..00db59f 100644 +--- a/timemaster.c ++++ b/timemaster.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/SOURCES/linuxptp-msgput.patch b/SOURCES/linuxptp-msgput.patch new file mode 100644 index 0000000..0fab821 --- /dev/null +++ b/SOURCES/linuxptp-msgput.patch @@ -0,0 +1,20 @@ +commit 86723cfc6a7ac1d9b1bff5e90b7f4696d6460a0e +Author: Miroslav Lichvar +Date: Thu Mar 21 17:12:03 2019 +0100 + + pmc: Don't leak memory when msg_tlv_append() fails. + + Signed-off-by: Miroslav Lichvar + +diff --git a/pmc_common.c b/pmc_common.c +index 4a160f6..4d48e3a 100644 +--- a/pmc_common.c ++++ b/pmc_common.c +@@ -546,6 +546,7 @@ int pmc_send_set_action(struct pmc *pmc, int id, void *data, int datasize) + } + extra = msg_tlv_append(msg, sizeof(*mgt) + datasize); + if (!extra) { ++ msg_put(msg); + return -ENOMEM; + } + mgt = (struct management_tlv *) extra->tlv; diff --git a/SOURCES/linuxptp-sysoff.patch b/SOURCES/linuxptp-sysoff.patch new file mode 100644 index 0000000..9f84f80 --- /dev/null +++ b/SOURCES/linuxptp-sysoff.patch @@ -0,0 +1,403 @@ +commit c0e49c708814ec783726fe92202371847703c5ed +Author: Miroslav Lichvar +Date: Mon Nov 12 17:27:58 2018 +0100 + + sysoff: Initialize data for ioctl(PTP_SYS_OFFSET). + + This fixes valgrind errors. + + Signed-off-by: Miroslav Lichvar + +diff --git a/sysoff.c b/sysoff.c +index f7b6240..407a01c 100644 +--- a/sysoff.c ++++ b/sysoff.c +@@ -18,6 +18,7 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include ++#include + #include + #include + +@@ -76,6 +77,7 @@ int sysoff_measure(int fd, int n_samples, + int64_t *result, uint64_t *ts, int64_t *delay) + { + struct ptp_sys_offset pso; ++ memset(&pso, 0, sizeof(pso)); + pso.n_samples = n_samples; + if (ioctl(fd, PTP_SYS_OFFSET, &pso)) { + perror("ioctl PTP_SYS_OFFSET"); + +commit 93baf34adb81046a5e1c3b9a3e685029f2046993 +Author: Miroslav Lichvar +Date: Mon Nov 12 17:27:59 2018 +0100 + + sysoff: Extend API for different sysoff methods. + + The kernel supports different PTP_SYS_OFFSET* ioctls. Use the sysoff + enum to allow selecting between them in sysoff_measure(). + + Signed-off-by: Miroslav Lichvar + +diff --git a/phc2sys.c b/phc2sys.c +index 15f8d75..2cd477a 100644 +--- a/phc2sys.c ++++ b/phc2sys.c +@@ -74,7 +74,7 @@ struct clock { + LIST_ENTRY(clock) dst_list; + clockid_t clkid; + int phc_index; +- int sysoff_supported; ++ int sysoff_method; + int is_utc; + int dest_only; + int state; +@@ -255,9 +255,8 @@ static struct clock *clock_add(struct node *node, char *device) + c->servo = servo_add(node, c); + + if (clkid != CLOCK_INVALID && clkid != CLOCK_REALTIME) +- c->sysoff_supported = (SYSOFF_SUPPORTED == +- sysoff_probe(CLOCKID_TO_FD(clkid), +- node->phc_readings)); ++ c->sysoff_method = sysoff_probe(CLOCKID_TO_FD(clkid), ++ node->phc_readings); + + LIST_INSERT_HEAD(&node->clocks, c, list); + return c; +@@ -784,11 +783,12 @@ static int do_loop(struct node *node, int subscriptions) + continue; + + if (clock->clkid == CLOCK_REALTIME && +- node->master->sysoff_supported) { ++ node->master->sysoff_method >= 0) { + /* use sysoff */ + if (sysoff_measure(CLOCKID_TO_FD(node->master->clkid), ++ node->master->sysoff_method, + node->phc_readings, +- &offset, &ts, &delay)) ++ &offset, &ts, &delay) < 0) + return -1; + } else { + /* use phc */ +diff --git a/phc_ctl.c b/phc_ctl.c +index 4a78a19..b9a9cf4 100644 +--- a/phc_ctl.c ++++ b/phc_ctl.c +@@ -367,10 +367,12 @@ static int do_cmp(clockid_t clkid, int cmdc, char *cmdv[]) + struct timespec ts, rta, rtb; + int64_t sys_offset, delay = 0, offset; + uint64_t sys_ts; ++ int method; + +- if (SYSOFF_SUPPORTED == +- sysoff_measure(CLOCKID_TO_FD(clkid), +- 9, &sys_offset, &sys_ts, &delay)) { ++ method = sysoff_probe(CLOCKID_TO_FD(clkid), 9); ++ ++ if (method >= 0 && sysoff_measure(CLOCKID_TO_FD(clkid), method, 9, ++ &sys_offset, &sys_ts, &delay) >= 0) { + pr_notice( "offset from CLOCK_REALTIME is %"PRId64"ns\n", + sys_offset); + return 0; +diff --git a/sysoff.c b/sysoff.c +index 407a01c..f709a9b 100644 +--- a/sysoff.c ++++ b/sysoff.c +@@ -73,8 +73,8 @@ static int64_t sysoff_estimate(struct ptp_clock_time *pct, int n_samples, + return samples[0].offset; + } + +-int sysoff_measure(int fd, int n_samples, +- int64_t *result, uint64_t *ts, int64_t *delay) ++static int sysoff_basic(int fd, int n_samples, ++ int64_t *result, uint64_t *ts, int64_t *delay) + { + struct ptp_sys_offset pso; + memset(&pso, 0, sizeof(pso)); +@@ -84,13 +84,24 @@ int sysoff_measure(int fd, int n_samples, + return SYSOFF_RUN_TIME_MISSING; + } + *result = sysoff_estimate(pso.ts, n_samples, ts, delay); +- return SYSOFF_SUPPORTED; ++ return SYSOFF_BASIC; ++} ++ ++int sysoff_measure(int fd, int method, int n_samples, ++ int64_t *result, uint64_t *ts, int64_t *delay) ++{ ++ switch (method) { ++ case SYSOFF_BASIC: ++ return sysoff_basic(fd, n_samples, result, ts, delay); ++ } ++ return SYSOFF_COMPILE_TIME_MISSING; + } + + int sysoff_probe(int fd, int n_samples) + { + int64_t junk, delay; + uint64_t ts; ++ int i; + + if (n_samples > PTP_MAX_SAMPLES) { + fprintf(stderr, "warning: %d exceeds kernel max readings %d\n", +@@ -99,7 +110,13 @@ int sysoff_probe(int fd, int n_samples) + return SYSOFF_RUN_TIME_MISSING; + } + +- return sysoff_measure(fd, n_samples, &junk, &ts, &delay); ++ for (i = 0; i < SYSOFF_LAST; i++) { ++ if (sysoff_measure(fd, i, n_samples, &junk, &ts, &delay) < 0) ++ continue; ++ return i; ++ } ++ ++ return SYSOFF_RUN_TIME_MISSING; + } + + #else /* !PTP_SYS_OFFSET */ +diff --git a/sysoff.h b/sysoff.h +index cb70265..02ecdfa 100644 +--- a/sysoff.h ++++ b/sysoff.h +@@ -21,13 +21,14 @@ + #include + + enum { +- SYSOFF_SUPPORTED, +- SYSOFF_COMPILE_TIME_MISSING, +- SYSOFF_RUN_TIME_MISSING, ++ SYSOFF_COMPILE_TIME_MISSING = -2, ++ SYSOFF_RUN_TIME_MISSING = -1, ++ SYSOFF_BASIC, ++ SYSOFF_LAST, + }; + + /** +- * Check to see if the PTP_SYS_OFFSET ioctl is supported. ++ * Check to see if a PTP_SYS_OFFSET ioctl is supported. + * @param fd An open file descriptor to a PHC device. + * @return One of the SYSOFF_ enumeration values. + */ +@@ -36,11 +37,12 @@ int sysoff_probe(int fd, int n_samples); + /** + * Measure the offset between a PHC and the system time. + * @param fd An open file descriptor to a PHC device. ++ * @param method A non-negative SYSOFF_ value returned by sysoff_probe(). + * @param n_samples The number of consecutive readings to make. + * @param result The estimated offset in nanoseconds. + * @param ts The system time corresponding to the 'result'. + * @param delay The delay in reading of the clock in nanoseconds. + * @return One of the SYSOFF_ enumeration values. + */ +-int sysoff_measure(int fd, int n_samples, ++int sysoff_measure(int fd, int method, int n_samples, + int64_t *result, uint64_t *ts, int64_t *delay); + +commit 192b8e315c4585489d7aa7f59683035998805e40 +Author: Miroslav Lichvar +Date: Mon Nov 12 17:28:00 2018 +0100 + + sysoff: Add support for PTP_SYS_OFFSET_PRECISE ioctl. + + This ioctl uses cross timestamping for a more accurate measurement of + the offset. It is supported on some onboard Intel NICs using the e1000e + driver and a virtual PHC with the ptp_kvm driver. + + Signed-off-by: Miroslav Lichvar + +diff --git a/sysoff.c b/sysoff.c +index f709a9b..9f65d95 100644 +--- a/sysoff.c ++++ b/sysoff.c +@@ -22,6 +22,7 @@ + #include + #include + ++#include "print.h" + #include "sysoff.h" + + #define NS_PER_SEC 1000000000LL +@@ -39,6 +40,23 @@ static struct { + uint64_t timestamp; + } samples[PTP_MAX_SAMPLES]; + ++static int sysoff_precise(int fd, int64_t *result, uint64_t *ts) ++{ ++#ifdef PTP_SYS_OFFSET_PRECISE ++ struct ptp_sys_offset_precise pso; ++ memset(&pso, 0, sizeof(pso)); ++ if (ioctl(fd, PTP_SYS_OFFSET_PRECISE, &pso)) { ++ pr_debug("ioctl PTP_SYS_OFFSET_PRECISE: %m"); ++ return SYSOFF_RUN_TIME_MISSING; ++ } ++ *result = pctns(&pso.sys_realtime) - pctns(&pso.device); ++ *ts = pctns(&pso.sys_realtime); ++ return SYSOFF_PRECISE; ++#else ++ return SYSOFF_COMPILE_TIME_MISSING; ++#endif ++} ++ + static void insertion_sort(int length, int64_t interval, int64_t offset, uint64_t ts) + { + int i = length - 1; +@@ -91,6 +109,9 @@ int sysoff_measure(int fd, int method, int n_samples, + int64_t *result, uint64_t *ts, int64_t *delay) + { + switch (method) { ++ case SYSOFF_PRECISE: ++ *delay = 0; ++ return sysoff_precise(fd, result, ts); + case SYSOFF_BASIC: + return sysoff_basic(fd, n_samples, result, ts, delay); + } +diff --git a/sysoff.h b/sysoff.h +index 02ecdfa..37f7353 100644 +--- a/sysoff.h ++++ b/sysoff.h +@@ -23,6 +23,7 @@ + enum { + SYSOFF_COMPILE_TIME_MISSING = -2, + SYSOFF_RUN_TIME_MISSING = -1, ++ SYSOFF_PRECISE, + SYSOFF_BASIC, + SYSOFF_LAST, + }; + +commit 68a9011c9d7d859920da339ba59c14dc1d617a45 +Author: Miroslav Lichvar +Date: Mon Nov 12 17:28:01 2018 +0100 + + sysoff: Add support for PTP_SYS_OFFSET_EXTENDED ioctl. + + This is a more accurate variant of the the PTP_SYS_OFFSET ioctl, which + will probably be supported in future kernel versions. + + Signed-off-by: Miroslav Lichvar + +diff --git a/sysoff.c b/sysoff.c +index 9f65d95..b993ee9 100644 +--- a/sysoff.c ++++ b/sysoff.c +@@ -71,17 +71,23 @@ static void insertion_sort(int length, int64_t interval, int64_t offset, uint64_ + samples[i+1].timestamp = ts; + } + +-static int64_t sysoff_estimate(struct ptp_clock_time *pct, int n_samples, +- uint64_t *ts, int64_t *delay) ++static int64_t sysoff_estimate(struct ptp_clock_time *pct, int extended, ++ int n_samples, uint64_t *ts, int64_t *delay) + { + int64_t t1, t2, tp; + int64_t interval, offset; + int i; + + for (i = 0; i < n_samples; i++) { +- t1 = pctns(&pct[2*i]); +- tp = pctns(&pct[2*i+1]); +- t2 = pctns(&pct[2*i+2]); ++ if (extended) { ++ t1 = pctns(&pct[3*i]); ++ tp = pctns(&pct[3*i+1]); ++ t2 = pctns(&pct[3*i+2]); ++ } else { ++ t1 = pctns(&pct[2*i]); ++ tp = pctns(&pct[2*i+1]); ++ t2 = pctns(&pct[2*i+2]); ++ } + interval = t2 - t1; + offset = (t2 + t1) / 2 - tp; + insertion_sort(i, interval, offset, (t2 + t1) / 2); +@@ -91,6 +97,24 @@ static int64_t sysoff_estimate(struct ptp_clock_time *pct, int n_samples, + return samples[0].offset; + } + ++static int sysoff_extended(int fd, int n_samples, ++ int64_t *result, uint64_t *ts, int64_t *delay) ++{ ++#ifdef PTP_SYS_OFFSET_EXTENDED ++ struct ptp_sys_offset_extended pso; ++ memset(&pso, 0, sizeof(pso)); ++ pso.n_samples = n_samples; ++ if (ioctl(fd, PTP_SYS_OFFSET_EXTENDED, &pso)) { ++ pr_debug("ioctl PTP_SYS_OFFSET_EXTENDED: %m"); ++ return SYSOFF_RUN_TIME_MISSING; ++ } ++ *result = sysoff_estimate(&pso.ts[0][0], 1, n_samples, ts, delay); ++ return SYSOFF_EXTENDED; ++#else ++ return SYSOFF_COMPILE_TIME_MISSING; ++#endif ++} ++ + static int sysoff_basic(int fd, int n_samples, + int64_t *result, uint64_t *ts, int64_t *delay) + { +@@ -101,7 +125,7 @@ static int sysoff_basic(int fd, int n_samples, + perror("ioctl PTP_SYS_OFFSET"); + return SYSOFF_RUN_TIME_MISSING; + } +- *result = sysoff_estimate(pso.ts, n_samples, ts, delay); ++ *result = sysoff_estimate(pso.ts, 0, n_samples, ts, delay); + return SYSOFF_BASIC; + } + +@@ -112,6 +136,8 @@ int sysoff_measure(int fd, int method, int n_samples, + case SYSOFF_PRECISE: + *delay = 0; + return sysoff_precise(fd, result, ts); ++ case SYSOFF_EXTENDED: ++ return sysoff_extended(fd, n_samples, result, ts, delay); + case SYSOFF_BASIC: + return sysoff_basic(fd, n_samples, result, ts, delay); + } +diff --git a/sysoff.h b/sysoff.h +index 37f7353..79d2290 100644 +--- a/sysoff.h ++++ b/sysoff.h +@@ -24,6 +24,7 @@ enum { + SYSOFF_COMPILE_TIME_MISSING = -2, + SYSOFF_RUN_TIME_MISSING = -1, + SYSOFF_PRECISE, ++ SYSOFF_EXTENDED, + SYSOFF_BASIC, + SYSOFF_LAST, + }; + +commit 8142da41b61fb5b9ee4ad8f5ab56adb0447cd37b +Author: Miroslav Lichvar +Date: Mon Nov 12 17:28:02 2018 +0100 + + phc2sys: Use reversed sysoff when synchronizing to system clock. + + If synchronizing a PHC to the system clock, use one of the + PTP_SYS_OFFSET ioctls (if supported) to measure the offset between the + two clocks. Negate the offset and switch the timestamp before passing + them to the servo. + + This makes the synchronization between PHC and system clock symmetric. + + Signed-off-by: Miroslav Lichvar + +diff --git a/phc2sys.c b/phc2sys.c +index 2cd477a..b8f1ea0 100644 +--- a/phc2sys.c ++++ b/phc2sys.c +@@ -790,6 +790,16 @@ static int do_loop(struct node *node, int subscriptions) + node->phc_readings, + &offset, &ts, &delay) < 0) + return -1; ++ } else if (node->master->clkid == CLOCK_REALTIME && ++ clock->sysoff_method >= 0) { ++ /* use reversed sysoff */ ++ if (sysoff_measure(CLOCKID_TO_FD(clock->clkid), ++ clock->sysoff_method, ++ node->phc_readings, ++ &offset, &ts, &delay) < 0) ++ return -1; ++ ts += offset; ++ offset = -offset; + } else { + /* use phc */ + if (!read_phc(node->master->clkid, clock->clkid, diff --git a/SOURCES/linuxptp-team.patch b/SOURCES/linuxptp-team.patch new file mode 100644 index 0000000..bb4b9c9 --- /dev/null +++ b/SOURCES/linuxptp-team.patch @@ -0,0 +1,459 @@ +commit 8ca81014a352a125aab38fce2b1302d92c0f5ef2 +Author: Hangbin Liu +Date: Fri Mar 1 15:08:48 2019 +0800 + + rtnl: add team activebackup support + + This patch add team interface activebackup mode support. As linux team use + genl netlink message, when we get a rtnl link change notify, we have to setup + a new genl socket and request the current active port. + + v2: check nlmsg_len before copy rta_data + v3: a) Do not make rtnl_buf global as it may be freed by calling rtnl_close() + while we are using it in rtnl_link_status() + b) Reorder declarations of variables as reversed Christmas tree for + function rtnl_link_status() + c) remove rtnl_len + v4: Remove the first !rtnl_buf check in rtnl_link_status as it's alway true + v5: a) Re-order {nl, rtnl}_open and add function nl_close() + b) revert the v3_{a,c}, v4 changes, use nl_close to close genl fd + c) do not use len in get_team_active_iface() as it may mislead reader + + Signed-off-by: Hangbin Liu + +diff --git a/missing.h b/missing.h +index 2f7adb9..8f92079 100644 +--- a/missing.h ++++ b/missing.h +@@ -118,6 +118,22 @@ enum { + #define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) + #endif /*IFLA_BOND_MAX*/ + ++#ifndef NLA_TYPE_MAX ++enum { ++ NLA_UNSPEC, ++ NLA_U8, ++ NLA_U16, ++ NLA_U32, ++ NLA_U64, ++ NLA_STRING, ++ NLA_FLAG, ++ NLA_MSECS, ++ NLA_NESTED, ++ __NLA_TYPE_MAX, ++}; ++#define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1) ++#endif /*NLA_TYPE_MAX*/ ++ + #ifdef __UCLIBC__ + + #if (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L) && \ +diff --git a/phc2sys.8 b/phc2sys.8 +index 45cb0e3..b3a3de3 100644 +--- a/phc2sys.8 ++++ b/phc2sys.8 +@@ -108,9 +108,9 @@ together with the + option, the master clock is used only to correct the offset by whole number of + seconds, which cannot be fixed with PPS alone. Not compatible with the + .B \-a +-option. This option does not support bonded interface (e.g. bond0). If ++option. This option does not support bonded interface (e.g. bond0, team0). If + .B ptp4l +-has a port on an active-backup bond interface, the ++has a port on an active-backup bond or team interface, the + .B \-a + option can be used to track the active interface. + .TP +diff --git a/rtnl.c b/rtnl.c +index f9a572b..e3758b3 100644 +--- a/rtnl.c ++++ b/rtnl.c +@@ -20,6 +20,8 @@ + #include /* Must come before linux/netlink.h on some systems. */ + #include + #include ++#include ++#include + #include + #include + #include +@@ -30,8 +32,39 @@ + #include "print.h" + #include "rtnl.h" + ++#define BUF_SIZE 4096 ++#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN)) ++ + static int rtnl_len; + static char *rtnl_buf; ++static int get_team_active_iface(int master_index); ++ ++static int nl_close(int fd) ++{ ++ return close(fd); ++} ++ ++static int nl_open(int family) ++{ ++ int fd; ++ struct sockaddr_nl sa; ++ ++ memset(&sa, 0, sizeof(sa)); ++ sa.nl_family = AF_NETLINK; ++ sa.nl_groups = RTNLGRP_LINK; ++ ++ fd = socket(AF_NETLINK, SOCK_RAW, family); ++ if (fd < 0) { ++ pr_err("failed to open netlink socket: %m"); ++ return -1; ++ } ++ if (bind(fd, (struct sockaddr *) &sa, sizeof(sa))) { ++ pr_err("failed to bind netlink socket: %m"); ++ close(fd); ++ return -1; ++ } ++ return fd; ++} + + int rtnl_close(int fd) + { +@@ -40,7 +73,12 @@ int rtnl_close(int fd) + rtnl_buf = NULL; + rtnl_len = 0; + } +- return close(fd); ++ return nl_close(fd); ++} ++ ++int rtnl_open(void) ++{ ++ return nl_open(NETLINK_ROUTE); + } + + static void rtnl_get_ts_device_callback(void *ctx, int linkup, int ts_index) +@@ -116,14 +154,24 @@ int rtnl_link_query(int fd, char *device) + return 0; + } + +-static inline __u32 rta_getattr_u32(const struct rtattr *rta) ++static inline __u8 rta_getattr_u8(struct rtattr *rta) ++{ ++ return *(__u8 *)RTA_DATA(rta); ++} ++ ++static inline __u16 rta_getattr_u16(struct rtattr *rta) ++{ ++ return *(__u16 *)RTA_DATA(rta); ++} ++ ++static inline __u32 rta_getattr_u32(struct rtattr *rta) + { + return *(__u32 *)RTA_DATA(rta); + } + +-static inline const char *rta_getattr_str(const struct rtattr *rta) ++static inline char *rta_getattr_str(struct rtattr *rta) + { +- return (const char *)RTA_DATA(rta); ++ return (char *)RTA_DATA(rta); + } + + static int rtnl_rtattr_parse(struct rtattr *tb[], int max, struct rtattr *rta, int len) +@@ -150,12 +198,12 @@ static inline int rtnl_nested_rtattr_parse(struct rtattr *tb[], int max, struct + return rtnl_rtattr_parse(tb, max, RTA_DATA(rta), RTA_PAYLOAD(rta)); + } + +-static int rtnl_linkinfo_parse(struct rtattr *rta) ++static int rtnl_linkinfo_parse(int master_index, struct rtattr *rta) + { +- int index = -1; +- const char *kind; + struct rtattr *linkinfo[IFLA_INFO_MAX]; + struct rtattr *bond[IFLA_BOND_MAX]; ++ int index = -1; ++ char *kind; + + if (rtnl_nested_rtattr_parse(linkinfo, IFLA_INFO_MAX, rta) < 0) + return -1; +@@ -172,6 +220,8 @@ static int rtnl_linkinfo_parse(struct rtattr *rta) + if (bond[IFLA_BOND_ACTIVE_SLAVE]) { + index = rta_getattr_u32(bond[IFLA_BOND_ACTIVE_SLAVE]); + } ++ } else if (kind && !strncmp(kind, "team", 4)) { ++ index = get_team_active_iface(master_index); + } + } + return index; +@@ -179,18 +229,18 @@ static int rtnl_linkinfo_parse(struct rtattr *rta) + + int rtnl_link_status(int fd, char *device, rtnl_callback cb, void *ctx) + { ++ struct rtattr *tb[IFLA_MAX+1]; ++ struct ifinfomsg *info = NULL; + int index, len, link_up; +- int slave_index = -1; +- struct iovec iov; + struct sockaddr_nl sa; +- struct msghdr msg; ++ int slave_index = -1; + struct nlmsghdr *nh; +- struct ifinfomsg *info = NULL; +- struct rtattr *tb[IFLA_MAX+1]; ++ struct msghdr msg; ++ struct iovec iov; + + index = if_nametoindex(device); + if (!rtnl_buf) { +- rtnl_len = 4096; ++ rtnl_len = BUF_SIZE; + rtnl_buf = malloc(rtnl_len); + if (!rtnl_buf) { + pr_err("rtnl: low memory"); +@@ -246,7 +296,7 @@ int rtnl_link_status(int fd, char *device, rtnl_callback cb, void *ctx) + IFLA_PAYLOAD(nh)); + + if (tb[IFLA_LINKINFO]) +- slave_index = rtnl_linkinfo_parse(tb[IFLA_LINKINFO]); ++ slave_index = rtnl_linkinfo_parse(index, tb[IFLA_LINKINFO]); + + if (cb) + cb(ctx, link_up, slave_index); +@@ -255,24 +305,164 @@ int rtnl_link_status(int fd, char *device, rtnl_callback cb, void *ctx) + return 0; + } + +-int rtnl_open(void) ++static int genl_send_msg(int fd, int family_id, int genl_cmd, int genl_version, ++ int rta_type, void *rta_data, int rta_len) + { +- int fd; +- struct sockaddr_nl sa; ++ struct sockaddr_nl daddr; ++ struct genlmsghdr *gnlh; ++ struct nlmsghdr *nlh; ++ struct rtattr *attr; ++ char msg[BUF_SIZE]; + +- memset(&sa, 0, sizeof(sa)); +- sa.nl_family = AF_NETLINK; +- sa.nl_groups = RTNLGRP_LINK; ++ memset(&daddr, 0, sizeof(daddr)); ++ daddr.nl_family = AF_NETLINK; + +- fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); +- if (fd < 0) { +- pr_err("failed to open netlink socket: %m"); ++ memset(&msg, 0, sizeof(msg)); ++ nlh = (struct nlmsghdr *) msg; ++ nlh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); ++ nlh->nlmsg_type = family_id; ++ nlh->nlmsg_flags = NLM_F_REQUEST; ++ ++ gnlh = (struct genlmsghdr *) NLMSG_DATA(nlh); ++ gnlh->cmd = genl_cmd; ++ gnlh->version = genl_version; ++ ++ if (rta_data && rta_len > 0) { ++ attr = (struct rtattr *) GENLMSG_DATA(msg); ++ attr->rta_type = rta_type; ++ attr->rta_len = RTA_LENGTH(rta_len); ++ nlh->nlmsg_len += NLMSG_ALIGN(attr->rta_len); ++ if (nlh->nlmsg_len < sizeof(msg)) ++ memcpy(RTA_DATA(attr), rta_data, rta_len); ++ else ++ return -1; ++ } ++ ++ return sendto(fd, &msg, nlh->nlmsg_len, 0, ++ (struct sockaddr *)&daddr, sizeof(daddr)); ++} ++ ++static int genl_get_family_id(int fd, void *family_name) ++{ ++ struct rtattr *tb[CTRL_ATTR_MAX+1]; ++ struct nlmsghdr *nlh; ++ struct rtattr *attr; ++ char msg[BUF_SIZE]; ++ int len, gf_id; ++ ++ len = genl_send_msg(fd, GENL_ID_CTRL, CTRL_CMD_GETFAMILY, 1, ++ CTRL_ATTR_FAMILY_NAME, family_name, ++ strlen(family_name) + 1); ++ if (len < 0) ++ return len; ++ ++ len = recv(fd, &msg, sizeof(msg), 0); ++ if (len < 0) ++ return len; ++ ++ nlh = (struct nlmsghdr *) msg; ++ if (nlh->nlmsg_type == NLMSG_ERROR || !NLMSG_OK(nlh, len)) + return -1; ++ ++ attr = (struct rtattr *) GENLMSG_DATA(msg); ++ rtnl_rtattr_parse(tb, CTRL_ATTR_MAX, attr, NLMSG_PAYLOAD(nlh, GENL_HDRLEN)); ++ ++ if (tb[CTRL_ATTR_FAMILY_ID]) ++ gf_id = rta_getattr_u16(tb[CTRL_ATTR_FAMILY_ID]); ++ else ++ gf_id = -1; ++ ++ return gf_id; ++} ++ ++static int parase_team_list_option(struct rtattr *attr) ++{ ++ struct rtattr *tb[TEAM_ATTR_OPTION_MAX+1]; ++ int len = RTA_PAYLOAD(attr); ++ const char *optname = ""; ++ const char *mode = ""; ++ int active_index = -1; ++ ++ for (attr = RTA_DATA(attr); RTA_OK(attr, len); attr = RTA_NEXT(attr, len)) { ++ rtnl_nested_rtattr_parse(tb, TEAM_ATTR_OPTION_MAX, attr); ++ ++ if (tb[TEAM_ATTR_OPTION_NAME]) ++ optname = rta_getattr_str(tb[TEAM_ATTR_OPTION_NAME]); ++ ++ if (!strcmp(optname, "mode") && tb[TEAM_ATTR_OPTION_TYPE] && ++ rta_getattr_u8(tb[TEAM_ATTR_OPTION_TYPE]) == NLA_STRING) ++ mode = rta_getattr_str(tb[TEAM_ATTR_OPTION_DATA]); ++ ++ if (!strcmp(optname, "activeport") && tb[TEAM_ATTR_OPTION_TYPE] && ++ rta_getattr_u8(tb[TEAM_ATTR_OPTION_TYPE]) == NLA_U32) ++ active_index = rta_getattr_u32(tb[TEAM_ATTR_OPTION_DATA]); + } +- if (bind(fd, (struct sockaddr *) &sa, sizeof(sa))) { +- pr_err("failed to bind netlink socket: %m"); +- close(fd); ++ ++ if (strcmp(mode, "activebackup")) { ++ pr_err("team supported only in activebackup mode"); + return -1; ++ } else { ++ return active_index; + } +- return fd; ++} ++ ++static int get_team_active_iface(int master_index) ++{ ++ struct rtattr *tb[TEAM_ATTR_MAX+1]; ++ struct genlmsghdr *gnlh; ++ struct nlmsghdr *nlh; ++ char msg[BUF_SIZE]; ++ int fd, gf_id, len; ++ int index = -1; ++ ++ fd = nl_open(NETLINK_GENERIC); ++ if (fd < 0) ++ return fd; ++ ++ gf_id = genl_get_family_id(fd, TEAM_GENL_NAME); ++ if (gf_id < 0) { ++ pr_err("get genl family failed"); ++ goto no_info; ++ } ++ ++ len = genl_send_msg(fd, gf_id, TEAM_CMD_OPTIONS_GET, ++ TEAM_GENL_VERSION, TEAM_ATTR_TEAM_IFINDEX, ++ &master_index, sizeof(master_index)); ++ if (len < 0) { ++ pr_err("send team info request failed: %m"); ++ goto no_info; ++ } ++ ++ len = recv(fd, msg, sizeof(msg), 0); ++ if (len < 0) { ++ pr_err("recv team info failed: %m"); ++ goto no_info; ++ } ++ ++ nlh = (struct nlmsghdr *) msg; ++ for ( ; NLMSG_OK(nlh, len); nlh = NLMSG_NEXT(nlh, len)) { ++ if (nlh->nlmsg_type != gf_id) ++ continue; ++ ++ gnlh = (struct genlmsghdr *) NLMSG_DATA(nlh); ++ if (gnlh->cmd != TEAM_CMD_OPTIONS_GET) ++ continue; ++ ++ rtnl_rtattr_parse(tb, TEAM_ATTR_MAX, (struct rtattr *)GENLMSG_DATA(msg), ++ NLMSG_PAYLOAD(nlh, GENL_HDRLEN)); ++ ++ if (tb[TEAM_ATTR_TEAM_IFINDEX] && ++ master_index != rta_getattr_u32(tb[TEAM_ATTR_TEAM_IFINDEX])) ++ continue; ++ ++ if (tb[TEAM_ATTR_LIST_OPTION]) { ++ index = parase_team_list_option(tb[TEAM_ATTR_LIST_OPTION]); ++ break; ++ } ++ } ++ ++ return index; ++no_info: ++ nl_close(fd); ++ return -1; + } +commit d8eafa6a39a609597e6c1ce44d616ba6f33c27f8 +Author: Hangbin Liu +Date: Wed Mar 20 14:44:13 2019 +0800 + + port: should check the new phc_index before switching + + In logic, when we want to switch phc, we should check if the new phc + index is valid instead of checking the previous one. + + In reality, if we use linux team interface with activebackup mode. As + teamd is a userspace tool, it sets the new slave as active port after + receiving link change message. If we set current active port down and + another slave up. There is a race that we receive the new slave's link + up message while active port(ts_index) is still the old one. This means + we may use a link down interface as ts_index and get phc_index with -1. + + If we update the p->phc_index to -1, there will be no possibility to + change it back to other value as we swith phc only when p->phc_index >= 0. + + With this fix, we will not switch phc_index until receiving the real + active port(p->iface->ts_info.phc_index >= 0) update message. + + Reported-by: Miroslav Lichvar + Fixes: 536a71031d5c ("ptp4l: use ts label to get ts info") + Signed-off-by: Hangbin Liu + +diff --git a/port.c b/port.c +index ad9554f..49c6f76 100644 +--- a/port.c ++++ b/port.c +@@ -2442,7 +2442,7 @@ void port_link_status(void *ctx, int linkup, int ts_index) + sk_get_ts_info(p->iface->ts_label, &p->iface->ts_info); + + /* Only switch phc with HW time stamping mode */ +- if (p->phc_index >= 0 && p->iface->ts_info.valid) { ++ if (p->iface->ts_info.valid && p->iface->ts_info.phc_index >= 0) { + required_modes = clock_required_modes(p->clock); + if ((p->iface->ts_info.so_timestamping & required_modes) != required_modes) { + pr_err("interface '%s' does not support requested " +commit ecfbea2dac2312cb61aa5d2fe1646ee4c6b18643 +Author: Miroslav Lichvar +Date: Thu Mar 21 15:44:32 2019 +0100 + + rtnl: close file descriptor in get_team_active_iface() + + Signed-off-by: Miroslav Lichvar + +diff --git a/rtnl.c b/rtnl.c +index e3758b3..59ed0ec 100644 +--- a/rtnl.c ++++ b/rtnl.c +@@ -461,8 +461,7 @@ static int get_team_active_iface(int master_index) + } + } + +- return index; + no_info: + nl_close(fd); +- return -1; ++ return index; + } diff --git a/SOURCES/linuxptp-timeout.patch b/SOURCES/linuxptp-timeout.patch new file mode 100644 index 0000000..b104787 --- /dev/null +++ b/SOURCES/linuxptp-timeout.patch @@ -0,0 +1,24 @@ +commit 241d8a064efa535029e28b87a8995add3cca8c0c +Author: Miroslav Lichvar +Date: Tue Sep 25 18:16:19 2018 +0200 + + unicast: Process timeouts equal to current time. + + Don't postpone processing of a timeout if it is equal to the current + time. This prevents an infinite loop with a simulated clock. + + Signed-off-by: Miroslav Lichvar + +diff --git a/unicast_service.c b/unicast_service.c +index ad0e06a..9c9b95b 100644 +--- a/unicast_service.c ++++ b/unicast_service.c +@@ -502,7 +502,7 @@ int unicast_service_timer(struct port *p) + pr_debug("peek i={2^%d} tmo={%ld,%ld}", interval->log_period, + interval->tmo.tv_sec, interval->tmo.tv_nsec); + +- if (timespec_compare(&now, &interval->tmo) >= 0) { ++ if (timespec_compare(&now, &interval->tmo) > 0) { + break; + } + interval = pqueue_extract(p->unicast_service->queue); diff --git a/SOURCES/linuxptp-ucastrate.patch b/SOURCES/linuxptp-ucastrate.patch new file mode 100644 index 0000000..77fad5c --- /dev/null +++ b/SOURCES/linuxptp-ucastrate.patch @@ -0,0 +1,45 @@ +commit a36602f1e65cd6bace6ed9405b0ce359de4a27d1 +Author: Miroslav Lichvar +Date: Thu Jan 3 15:23:54 2019 +0100 + + unicast: limit message rate and grant duration + + Deny service requests with logInterMessagePeriod smaller than -7 (128 + packets per second) or larger than 16. This limits the network and CPU + consumption per address and prevents undefined shifts in the calculation + of the interval. + + Also, limit the maximum grant duration to one hour. + + Signed-off-by: Miroslav Lichvar + +diff --git a/unicast_service.c b/unicast_service.c +index 9c9b95b..c6c17c6 100644 +--- a/unicast_service.c ++++ b/unicast_service.c +@@ -31,6 +31,9 @@ + #include "unicast_service.h" + #include "util.h" + ++#define MIN_LOG_INTER_MESSAGE_PERIOD -7 ++#define MAX_LOG_INTER_MESSAGE_PERIOD 16 ++#define MAX_DURATION 3600 + #define QUEUE_LEN 16 + + struct unicast_client_address { +@@ -289,6 +292,15 @@ int unicast_service_add(struct port *p, struct ptp_message *m, + return SERVICE_DENIED; + } + ++ if (req->logInterMessagePeriod < MIN_LOG_INTER_MESSAGE_PERIOD || ++ req->logInterMessagePeriod > MAX_LOG_INTER_MESSAGE_PERIOD) { ++ return SERVICE_DENIED; ++ } ++ ++ if (req->durationField > MAX_DURATION) { ++ req->durationField = MAX_DURATION; ++ } ++ + LIST_FOREACH(itmp, &p->unicast_service->intervals, list) { + /* + * Remember the interval of interest. diff --git a/SOURCES/phc2sys.service b/SOURCES/phc2sys.service new file mode 100644 index 0000000..ff2f77e --- /dev/null +++ b/SOURCES/phc2sys.service @@ -0,0 +1,11 @@ +[Unit] +Description=Synchronize system clock or PTP hardware clock (PHC) +After=ntpdate.service ptp4l.service + +[Service] +Type=simple +EnvironmentFile=-/etc/sysconfig/phc2sys +ExecStart=/usr/sbin/phc2sys $OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/ptp4l.service b/SOURCES/ptp4l.service new file mode 100644 index 0000000..fbb26d1 --- /dev/null +++ b/SOURCES/ptp4l.service @@ -0,0 +1,12 @@ +[Unit] +Description=Precision Time Protocol (PTP) service +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +EnvironmentFile=-/etc/sysconfig/ptp4l +ExecStart=/usr/sbin/ptp4l $OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/timemaster.conf b/SOURCES/timemaster.conf new file mode 100644 index 0000000..d47a305 --- /dev/null +++ b/SOURCES/timemaster.conf @@ -0,0 +1,33 @@ +# Configuration file for timemaster + +#[ntp_server ntp-server.local] +#minpoll 4 +#maxpoll 4 + +#[ptp_domain 0] +#interfaces eth0 + +[timemaster] +ntp_program chronyd + +[chrony.conf] +include /etc/chrony.conf + +[ntp.conf] +includefile /etc/ntp.conf + +[ptp4l.conf] + +[chronyd] +path /usr/sbin/chronyd +options -u chrony + +[ntpd] +path /usr/sbin/ntpd +options -u ntp:ntp -g + +[phc2sys] +path /usr/sbin/phc2sys + +[ptp4l] +path /usr/sbin/ptp4l diff --git a/SOURCES/timemaster.service b/SOURCES/timemaster.service new file mode 100644 index 0000000..a6bda33 --- /dev/null +++ b/SOURCES/timemaster.service @@ -0,0 +1,12 @@ +[Unit] +Description=Synchronize system clock to NTP and PTP time sources +After=chronyd.service ntpd.service ntpdate.service sntp.service network-online.target +Conflicts=chronyd.service ntpd.service phc2sys.service ptp4l.service +Wants=network-online.target + +[Service] +Type=simple +ExecStart=/usr/sbin/timemaster -f /etc/timemaster.conf + +[Install] +WantedBy=multi-user.target diff --git a/SPECS/linuxptp.spec b/SPECS/linuxptp.spec new file mode 100644 index 0000000..3f91582 --- /dev/null +++ b/SPECS/linuxptp.spec @@ -0,0 +1,209 @@ +%global _hardened_build 1 +%global testsuite_ver a7f6e1 +%global clknetsim_ver 8b4842 +Name: linuxptp +Version: 2.0 +Release: 2%{?dist} +Summary: PTP implementation for Linux + +Group: System Environment/Base +License: GPLv2+ +URL: http://linuxptp.sourceforge.net/ + +Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz +Source1: phc2sys.service +Source2: ptp4l.service +Source3: timemaster.service +Source4: timemaster.conf +# external test suite +Source10: https://github.com/mlichvar/linuxptp-testsuite/archive/%{testsuite_ver}/linuxptp-testsuite-%{testsuite_ver}.tar.gz +# simulator for test suite +Source11: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz + +# fix building with new kernel headers +Patch1: linuxptp-headers.patch +# fix timeout handling to work with simulated clock +Patch2: linuxptp-timeout.patch +# add support for more accurate synchronization to phc2sys +Patch3: linuxptp-sysoff.patch +# limit unicast message rate per address and grant duration +Patch4: linuxptp-ucastrate.patch +# add support for active-backup team interface +Patch5: linuxptp-team.patch +# fix comparing of unicast addresses +Patch6: linuxptp-addreq.patch +# don't leak memory when allocation fails +Patch7: linuxptp-msgput.patch + +BuildRequires: kernel-headers > 3.10.0-1002 +BuildRequires: systemd-units + +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units + +%description +This software is an implementation of the Precision Time Protocol (PTP) +according to IEEE standard 1588 for Linux. The dual design goals are to provide +a robust implementation of the standard and to use the most relevant and modern +Application Programming Interfaces (API) offered by the Linux kernel. +Supporting legacy APIs and other platforms is not a goal. + +%prep +%setup -q -a 10 -a 11 +%patch1 -p1 -b .headers +%patch2 -p1 -b .timeout +%patch3 -p1 -b .sysoff +%patch4 -p1 -b .ucastrate +%patch5 -p1 -b .team +%patch6 -p1 -b .addreq +%patch7 -p1 -b .msgput +mv linuxptp-testsuite-%{testsuite_ver}* testsuite +mv clknetsim-%{clknetsim_ver}* testsuite/clknetsim + +%build +make %{?_smp_mflags} \ + EXTRA_CFLAGS="$RPM_OPT_FLAGS" \ + EXTRA_LDFLAGS="$RPM_LD_FLAGS" + +%install +%makeinstall + +mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_unitdir},%{_mandir}/man5} +install -m 644 -p configs/default.cfg $RPM_BUILD_ROOT%{_sysconfdir}/ptp4l.conf +install -m 644 -p %{SOURCE1} %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir} +install -m 644 -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir} + +echo 'OPTIONS="-f /etc/ptp4l.conf -i eth0"' > \ + $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ptp4l +echo 'OPTIONS="-a -r"' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/phc2sys + +echo '.so man8/ptp4l.8' > $RPM_BUILD_ROOT%{_mandir}/man5/ptp4l.conf.5 +echo '.so man8/timemaster.8' > $RPM_BUILD_ROOT%{_mandir}/man5/timemaster.conf.5 + +%check +cd testsuite +# set random seed to get deterministic results +export CLKNETSIM_RANDOM_SEED=26743 +make %{?_smp_mflags} -C clknetsim +PATH=..:$PATH ./run + +%post +%systemd_post phc2sys.service ptp4l.service timemaster.service + +%preun +%systemd_preun phc2sys.service ptp4l.service timemaster.service + +%postun +%systemd_postun_with_restart phc2sys.service ptp4l.service timemaster.service + +%files +%doc COPYING README.org configs +%config(noreplace) %{_sysconfdir}/ptp4l.conf +%config(noreplace) %{_sysconfdir}/sysconfig/phc2sys +%config(noreplace) %{_sysconfdir}/sysconfig/ptp4l +%config(noreplace) %{_sysconfdir}/timemaster.conf +%{_unitdir}/phc2sys.service +%{_unitdir}/ptp4l.service +%{_unitdir}/timemaster.service +%{_sbindir}/hwstamp_ctl +%{_sbindir}/nsm +%{_sbindir}/phc2sys +%{_sbindir}/phc_ctl +%{_sbindir}/pmc +%{_sbindir}/ptp4l +%{_sbindir}/timemaster +%{_mandir}/man5/*.5* +%{_mandir}/man8/*.8* + +%changelog +* Tue Mar 26 2019 Miroslav Lichvar 2.0-2 +- fix comparing of unicast addresses +- don't leak memory when allocation fails + +* Thu Mar 21 2019 Miroslav Lichvar 2.0-1 +- update to 2.0 (#1623919) +- add support for more accurate synchronization to phc2sys (#1643977) +- add support for active-backup team interface (#1650672) +- limit unicast message rate per address and grant duration + +* Wed May 30 2018 Miroslav Lichvar 1.8-6 +- add support for bonding to timemaster (#1549015) +- improve timemaster to restart terminated processes (#1527170) +- start ptp4l, timemaster and phc2sys after network-online target (#1541991) +- don't forward management requests to UDS port (#1520366) + +* Tue Oct 24 2017 Miroslav Lichvar 1.8-5 +- add support for active-backup bonding (#1002657) +- add support for IP over InfiniBand (#1472880) +- fix handling of unknown/invalid management TLVs in pmc (#1459446 #1459449) + +* Thu Sep 07 2017 Michal Ruprich - 1.8-4 +- Resolves: #1487522 - Race condition in phc2sys + +* Wed Mar 15 2017 Miroslav Lichvar 1.8-3 +- fix backport of linkdown patch + +* Tue Mar 14 2017 Miroslav Lichvar 1.8-2 +- force BMC election when link goes down + +* Tue Feb 07 2017 Miroslav Lichvar 1.8-1 +- update to 1.8 (#1359311 #1353336) + +* Tue Nov 25 2014 Miroslav Lichvar 1.4-3.20140718gitbdb6a3 +- fix resetting of linreg servo (#1165045) +- fix phc2sys automatic mode with multiple interfaces (#1108795) + +* Tue Oct 14 2014 Miroslav Lichvar 1.4-2.20140718gitbdb6a3 +- add timemaster (#1085580) +- send peer messages to correct address +- make NTP SHM segment number configurable +- update UDS handling to allow running multiple ptp4l/phc2sys instances +- fix warnings from static analysis + +* Wed Sep 03 2014 Miroslav Lichvar 1.4-1.20140718gitbdb6a3 +- update to 20140718gitbdb6a3 (#1108795, #1059039) +- fix PIE linking (#1092537) +- replace hardening build flags with _hardened_build +- include simulation test suite + +* Fri Jan 24 2014 Daniel Mach - 1.3-3 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 1.3-2 +- Mass rebuild 2013-12-27 + +* Fri Aug 02 2013 Miroslav Lichvar 1.3-1 +- update to 1.3 + +* Tue Jul 30 2013 Miroslav Lichvar 1.2-3.20130730git7789f0 +- update to 20130730git7789f0 + +* Fri Jul 19 2013 Miroslav Lichvar 1.2-2.20130719git46db40 +- update to 20130719git46db40 +- drop old systemd scriptlets +- add man page link for ptp4l.conf + +* Mon Apr 22 2013 Miroslav Lichvar 1.2-1 +- update to 1.2 + +* Mon Feb 18 2013 Miroslav Lichvar 1.1-1 +- update to 1.1 +- log phc2sys output + +* Thu Feb 14 2013 Fedora Release Engineering - 1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Dec 13 2012 Miroslav Lichvar 1.0-1 +- update to 1.0 + +* Fri Nov 09 2012 Miroslav Lichvar 0-0.3.20121109git4e8107 +- update to 20121109git4e8107 +- install unchanged default.cfg as ptp4l.conf +- drop conflicts from phc2sys service + +* Fri Sep 21 2012 Miroslav Lichvar 0-0.2.20120920git6ce135 +- fix issues found in package review (#859193) + +* Thu Sep 20 2012 Miroslav Lichvar 0-0.1.20120920git6ce135 +- initial release