This patch adds configuration parameters for network namespace. These parameters are only needed when configuring interfaces in different namespaces than each other. Otherwise the ptp4l program can be started directly in correct namespace.
Signed-off-by: Anders Selhammer <anders.selham...@est.tech> --- config.c | 2 ++ ptp4l.8 | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/config.c b/config.c index 2321310..d7a155e 100644 --- a/config.c +++ b/config.c @@ -260,6 +260,8 @@ struct config_item config_tab[] = { PORT_ITEM_INT("min_neighbor_prop_delay", -20000000, INT_MIN, -1), PORT_ITEM_INT("neighborPropDelayThresh", 20000000, 0, INT_MAX), PORT_ITEM_INT("net_sync_monitor", 0, 0, 1), + GLOB_ITEM_STR("netns_path", "/var/run/netns/"), + PORT_ITEM_STR("network_namespace", ""), PORT_ITEM_ENU("network_transport", TRANS_UDP_IPV4, nw_trans_enu), GLOB_ITEM_INT("ntpshm_segment", 0, INT_MIN, INT_MAX), GLOB_ITEM_INT("offsetScaledLogVariance", 0xffff, 0, UINT16_MAX), diff --git a/ptp4l.8 b/ptp4l.8 index 99b085c..643e968 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -274,6 +274,15 @@ Relevant only with L2 transport. The default is 01:1B:19:00:00:00. The MAC address to which peer delay messages should be sent. Relevant only with L2 transport. The default is 01:80:C2:00:00:0E. .TP +.B network_namespace +The network namspace in which the port operate. +This option should be used if atleast one port operates in different +namespaces than the other. When used, the ptp4l program needs to be +opened in default namespace. +Skip this option to select default namespace for the port. +If all ports operates in same namespace, the ptp4l program can be opened +directly in that namespace and this option can be disregarded. +.TP .B network_transport Select the network transport. Possible values are UDPv4, UDPv6 and L2. The default is UDPv4. @@ -357,6 +366,10 @@ to the same subnet. .SH PROGRAM AND CLOCK OPTIONS .TP +.B netns_path +Specifies the path where the named network namspace object is located. +The default is /var/run/netns/ +.TP .B twoStepFlag Enable two-step mode for sync messages. One-step mode can be used only with hardware time stamping. -- 1.8.3.1 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel