netlink-socket: Always pass the output buffer in a transaction.
authorNithin Raju <nithin@vmware.com>
Tue, 7 Oct 2014 22:08:53 +0000 (15:08 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Oct 2014 20:27:12 +0000 (13:27 -0700)
commit9189184d09bfb742149b878d6b9e0194979b3dbb
tree7cfd35f0740044a9e03a51f892421fdfc996d687
parent06021dcba984a0e229140179d25d060659bb60a8
netlink-socket: Always pass the output buffer in a transaction.

We need to pass down the output buffer so that the kernel can return
transaction status - error or otherwise.

Also, we were processing the output buffer only when when
'txn->reply != NULL' ie when the caller specified an ofpbuf for the
reply. In this patch, the code has been updated to process the reply
unconditionally, but making sure to copy the reply to the 'txn->reply'
only when it is not NULL. The reason for the unconditional processing is
we can pass up transactional errors in 'txn->error'. Otherwise, it
results in an endless loop of calling nl_transact().

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
lib/netlink-socket.c