Commit f21c4f0b authored by Davide Ciminaghi's avatar Davide Ciminaghi Committed by Alessandro Rubini

bugfix: config fields must be int

This fixes a bug introduced by f1d048c3
(conf.c: use f_simple_int() for assigning simple integer options):
we used ASSIGN_INT_FIELD for assigning values to variables shorter than
int, while the destination pointer was set to int *, so neighbouring
fields were overwritten.

Another commit in a non-merged branch adds a build-time check to
avoid repeating this bug, but field names changed, so let's avoid
cherry-picking it here at this point.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 7905978c
......@@ -101,10 +101,10 @@ typedef struct PortAdress { /* page 13 (33) */
Octet *adressField;
} PortAdress;
typedef struct ClockQuality { /* page 14 (34) */
UInteger8 clockClass;
Enumeration8 clockAccuracy;
UInteger16 offsetScaledLogVariance;
typedef struct ClockQuality { /* page 14 (34) -- int because of lib/config.c */
int clockClass;
int clockAccuracy;
int offsetScaledLogVariance;
} ClockQuality;
struct TLV { /* page 14 (34) -- never used */
......
......@@ -24,10 +24,10 @@ struct pp_runtime_opts {
Integer16 ap, ai;
Integer16 s;
Integer8 announce_intvl;
Integer8 sync_intvl;
UInteger8 prio1;
UInteger8 prio2;
UInteger8 domain_number;
int sync_intvl;
int prio1;
int prio2;
int domain_number;
void *arch_opts;
};
......@@ -114,7 +114,7 @@ enum { /* The two sockets. They are called "net path" for historical reasons */
struct pp_instance_cfg {
char port_name[16];
char iface_name[16];
int ext; /* 0: none, 1: whiterabbit */ /* FIXME extension enumeration */
int ext; /* 0: none, 1: whiterabbit */
};
/*
......@@ -126,8 +126,8 @@ struct pp_instance {
void *arch_data; /* if arch needs it */
void *ext_data; /* if protocol ext needs it */
unsigned long d_flags; /* diagnostics, ppi-specific flags */
unsigned char flags, /* protocol flags (see below) */
role, /* same as in config file */
unsigned char flags; /* protocol flags (see below) */
int role, /* same as in config file */
proto; /* same as in config file */
/* Pointer to global instance owning this pp_instance*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment