ptp4l: change interface name into static array
In order to support future settings which allow for the configuration of per-port data, this patch modifies the interface name to be a static array instead of a pointer. -v2 * Minor edit for merge with previous patch Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>master
parent
5a0b6c3cd3
commit
31865b2589
3
config.h
3
config.h
|
@ -25,10 +25,11 @@
|
||||||
#include "transport.h"
|
#include "transport.h"
|
||||||
|
|
||||||
#define MAX_PORTS 8
|
#define MAX_PORTS 8
|
||||||
|
#define MAX_IFNAME_SIZE 16
|
||||||
|
|
||||||
/** Defines a network interface, with PTP options. */
|
/** Defines a network interface, with PTP options. */
|
||||||
struct interface {
|
struct interface {
|
||||||
char *name;
|
char name[MAX_IFNAME_SIZE + 1];
|
||||||
enum delay_mechanism dm;
|
enum delay_mechanism dm;
|
||||||
enum transport_type transport;
|
enum transport_type transport;
|
||||||
};
|
};
|
||||||
|
|
2
ptp4l.c
2
ptp4l.c
|
@ -152,7 +152,7 @@ int main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if (*nports < MAX_PORTS) {
|
if (*nports < MAX_PORTS) {
|
||||||
iface[*nports].name = optarg;
|
strncpy(iface[*nports].name, optarg, MAX_IFNAME_SIZE);
|
||||||
iface[*nports].dm = *dm;
|
iface[*nports].dm = *dm;
|
||||||
iface[*nports].transport = *transport;
|
iface[*nports].transport = *transport;
|
||||||
(*nports)++;
|
(*nports)++;
|
||||||
|
|
Loading…
Reference in New Issue