X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetlink-notifier.c;h=8f6daff8d8bcc858141aa634bb691f18f66b62d8;hb=f7cc6bd82f5ff86369c5719fdd81420af5ddf0c3;hp=9446488115381f6d6514f7d068209396ac44a515;hpb=2ee6545f2bff7eb27e8c84965e3ff38dfa909bf6;p=sliver-openvswitch.git diff --git a/lib/netlink-notifier.c b/lib/netlink-notifier.c index 944648811..8f6daff8d 100644 --- 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. @@ -164,18 +164,20 @@ nln_run(struct nln *nln) nln->has_run = true; for (;;) { - struct ofpbuf *buf; + uint64_t buf_stub[4096 / 8]; + struct ofpbuf buf; int error; + ofpbuf_use_stub(&buf, buf_stub, sizeof buf_stub); 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); } - ofpbuf_delete(buf); + ofpbuf_uninit(&buf); } else if (error == EAGAIN) { return; } else {