#include <sys/time.h>
#include <sys/types.h>
#include <sys/uio.h>
+#include <sys/utsname.h>
#include <arpa/inet.h>
#include <net/route.h>
#define RELEASE_DELAY_S 0
#define RELEASE_DELAY_NS 10000000
+char vendor[VENDORCLASSID_MAX_LEN];
int pidfd = -1;
struct interface *ifaces = NULL;
int ifac = 0;
size_t len;
pid_t pid;
struct timespec ts;
+ struct utsname utn;
+ const char *platform;
closefrom(3);
openlog(PACKAGE, LOG_PERROR | LOG_PID, LOG_DAEMON);
}
}
+ platform = hardware_platform();
+ if (uname(&utn) == 0)
+ snprintf(vendor, VENDORCLASSID_MAX_LEN,
+ "%s-%s:%s-%s:%s%s%s", PACKAGE, VERSION,
+ utn.sysname, utn.release, utn.machine,
+ platform ? ":" : "", platform ? platform : "");
+ else
+ snprintf(vendor, VENDORCLASSID_MAX_LEN,
+ "%s-%s", PACKAGE, VERSION);
+
i = 0;
while ((opt = getopt_long(argc, argv, IF_OPTS, cf_options, &oi)) != -1)
{
*/
#include <sys/types.h>
-#include <sys/utsname.h>
#include <arpa/inet.h>
{
struct if_options *ifo;
FILE *f;
- char *line, *option, *p, *platform;
+ char *line, *option, *p;
int skip = 0, have_profile = 0;
- struct utsname utn;
/* Seed our default options */
ifo = xzalloc(sizeof(*ifo));
strcmp(ifo->hostname, "localhost") == 0)
ifo->hostname[0] = '\0';
- platform = hardware_platform();
- if (uname(&utn) == 0)
- ifo->vendorclassid[0] = snprintf((char *)ifo->vendorclassid + 1,
- VENDORCLASSID_MAX_LEN,
- "%s-%s:%s-%s:%s%s%s", PACKAGE, VERSION,
- utn.sysname, utn.release, utn.machine,
- platform ? ":" : "", platform ? platform : "");
- else
- ifo->vendorclassid[0] = snprintf((char *)ifo->vendorclassid + 1,
- VENDORCLASSID_MAX_LEN, "%s-%s", PACKAGE, VERSION);
+ ifo->vendorclassid[0] = strlen(vendor);
+ memcpy(ifo->vendorclassid + 1, vendor, ifo->vendorclassid[0]);
/* Parse our options file */
f = fopen(file ? file : CONFIG, "r");