/*
- * Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "netlink.h"
#include "netlink-socket.h"
#include "ofpbuf.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(netlink_notifier);
struct nln {
struct nl_sock *notify_sock; /* Netlink socket. */
- struct list all_notifiers; /* All nln notifiers. */
+ struct ovs_list all_notifiers; /* All nln notifiers. */
bool has_run; /* Guard for run and wait functions. */
/* Passed in by nln_create(). */
struct nln_notifier {
struct nln *nln; /* Parent nln. */
- struct list node;
+ struct ovs_list node;
nln_notify_func *cb;
void *aux;
};
}
if (error) {
nl_sock_destroy(sock);
- VLOG_WARN("could not create netlink socket: %s", strerror(error));
+ VLOG_WARN("could not create netlink socket: %s",
+ ovs_strerror(error));
return NULL;
}
nln->notify_sock = sock;
return;
} else {
if (error == ENOBUFS) {
+ /* The socket buffer might be full, there could be too many
+ * notifications, so it makes sense to call nln_report() */
+ nln_report(nln, NULL);
VLOG_WARN_RL(&rl, "netlink receive buffer overflowed");
} else {
VLOG_WARN_RL(&rl, "error reading netlink socket: %s",
- strerror(error));
+ ovs_strerror(error));
}
- nln_report(nln, NULL);
+ return;
}
}
}