int n, err = 0, multipart = 0, interrupted = 0, nrecv = 0;
unsigned char *buf = NULL;
struct nlmsghdr *hdr;
+
+ /*
+ nla is passed on to not only to nl_recv() but may also be passed
+ to a function pointer provided by the caller which may or may not
+ initialize the variable. Thomas Graf.
+ */
struct sockaddr_nl nla = {0};
struct nl_msg *msg = NULL;
struct ucred *creds = NULL;
int rtnl_tc_read_classid_file(void)
{
static time_t last_read;
- struct stat st = {0};
+ struct stat st;
char buf[256], *path;
FILE *fd;
int err;
#include <netlink/netlink.h>
#include <netlink/route/cls/ematch.h>
-static int container_parse(struct rtnl_ematch *e, void *data, size_t len)
+static int container_parse(struct rtnl_ematch *e, void *data, size_t len __attribute__((unused)))
{
+ /*
+ The kernel may provide more than 4 bytes of data in the future and we want
+ older libnl versions to be ok with that. We want interfaces to be growable
+ so we only ever enforce a minimum data length and copy as much as we are
+ aware of. Thomas Graf.
+ */
memcpy(e->e_data, data, sizeof(uint32_t));
return 0;
YY_BUFFER_STATE buf = NULL;
yyscan_t scanner = NULL;
static time_t last_read;
- struct stat st = {0};
+ struct stat st;
char *path;
int i, err;
FILE *fd;
struct nl_msg *msg)
{
struct rtnl_htb_qdisc *htb = data;
- struct tc_htb_glob opts = {0};
-
- opts.version = TC_HTB_PROTOVER;
- opts.rate2quantum = 10;
+ struct tc_htb_glob opts = {
+ .version = TC_HTB_PROTOVER,
+ .rate2quantum = 10,
+ };
if (htb) {
if (htb->qh_mask & SCH_HTB_HAS_RATE2QUANTUM)