git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://openvswitch.org/openvswitch
[sliver-openvswitch.git]
/
lib
/
netlink-notifier.c
diff --git
a/lib/netlink-notifier.c
b/lib/netlink-notifier.c
index
9446488
..
6739ece
100644
(file)
--- a/
lib/netlink-notifier.c
+++ b/
lib/netlink-notifier.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009, 2010, 2011
Nicira Networks
.
+ * Copyright (c) 2009, 2010, 2011
, 2012 Nicira, Inc
.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-18,7
+18,6
@@
#include "netlink-notifier.h"
#include "netlink-notifier.h"
-#include <assert.h>
#include <errno.h>
#include <poll.h>
#include <stdlib.h>
#include <errno.h>
#include <poll.h>
#include <stdlib.h>
@@
-87,7
+86,7
@@
void
nln_destroy(struct nln *nln)
{
if (nln) {
nln_destroy(struct nln *nln)
{
if (nln) {
- assert(list_is_empty(&nln->all_notifiers));
+
ovs_
assert(list_is_empty(&nln->all_notifiers));
nl_sock_destroy(nln->notify_sock);
free(nln);
}
nl_sock_destroy(nln->notify_sock);
free(nln);
}
@@
-164,18
+163,20
@@
nln_run(struct nln *nln)
nln->has_run = true;
for (;;) {
nln->has_run = true;
for (;;) {
- struct ofpbuf *buf;
+ uint64_t buf_stub[4096 / 8];
+ struct ofpbuf buf;
int error;
int error;
+ ofpbuf_use_stub(&buf, buf_stub, sizeof buf_stub);
error = nl_sock_recv(nln->notify_sock, &buf, false);
if (!error) {
error = nl_sock_recv(nln->notify_sock, &buf, false);
if (!error) {
- if (nln->parse(buf, nln->change)) {
+ if (nln->parse(
&
buf, nln->change)) {
nln_report(nln, nln->change);
} else {
VLOG_WARN_RL(&rl, "received bad netlink message");
nln_report(nln, NULL);
}
nln_report(nln, nln->change);
} else {
VLOG_WARN_RL(&rl, "received bad netlink message");
nln_report(nln, NULL);
}
- ofpbuf_
delete(
buf);
+ ofpbuf_
uninit(&
buf);
} else if (error == EAGAIN) {
return;
} else {
} else if (error == EAGAIN) {
return;
} else {