Fix memory leaks in error paths.

Found by Fortify.

Signed-off-by: yinpeijun <yinpeijun@huawei.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
vtep-ctl: Free error string before return from cmd_remove().

Error string should be freed in all cases.

Found by Coverity.

Signed-off-by: Madhu Challa <challa@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS: Add Madhu Challa.

Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: define mcgroup IDs for VPORT and other families

dpif-linux.c makes a nl_lookup_genl_mcgroup(OVS_VPORT_FAMILY) that is not
implemented yet on Windows yet. Multicast group is used currently to
subscribe to events related to VPORTs. Whether the exact same mechanism
would be used is unclear yet.

In the interim, we can implement code to support nl_lookup_genl_mcgroup().
and make progress with the other simpler commands.

In this patch, we define a ID for the VPORT MC group and use it. The IDs for
other families were also defined, but without usage, were seen as unclear.
Hence we define only the VPORT group.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
netlink-socket: add support for nl_lookup_genl_mcgroup()

While we work out whether nl_sock_join_mcgroup() will be the mechanism
to support VPORT events, it is easy to add support for
nl_lookup_genl_mcgroup() and make progress on the other commands.

In this patch, we implement support for nl_lookup_genl_mcgroup() only
for the VPORT family though, which is all what dpif-linux.c needs.

Validation:
- A ported dpif-linux.c with epoll code commented out went so far as
to call dp_enumerate! DP Dump commands can be implemented next.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
netlink-socket: fix typo to get_sock_pid_from_kernel()

A typo crept in while respinning get_sock_pid_from_kernel() in the previous
patch. Fixing it now. Also, get_sock_pid_from_kernel() doesn't need an OUT
argument. Fixing that too.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Update netlink family IDs

I didn't realize earlier while defining OvsDpInterfaceExt.h that
there are special values defined in netlink-protocol.h for nlmsg_type.
For Eg. NLMSG_ERROR is defined to be 2. In this patch, we update the
values of the family IDs to not clash with the special defines.
I'm using NLMSG_MIN_TYPE as a reference.

All this points to doing family ID lookup from the kernel rather than
returning values from netlink-socket.c. We should move to that model
after we get through the first round of netlink commands.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/flow.h Revert bitfield back to uint64_t.

Using different types for the two bitfields did not work on MSVC, so
reverting back to "64-bit bool" :-)

Reported-by: Saurabh Shah <ssaurabh@vmware.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
INSTALL: Describe steps to use/install continuous integration

Describe the steps required to setup use of travis-ci for any
GitHub ovs repository.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
ovsdb: Fix error leak for negative timeout and invalid until case

Although the check for negative timeout is present, the error string
is overwritten if an invalid "until" is found right after. This leaks
an error string and results in not reporting the negative timeout back
to the user even though it is encountered first.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
netdev-linux: Cast policer rate to uint64_t to avoid overflow

tc_fill_rate() takes a 64bit int, casting kbits_rate from int
to uint64_t avoids a possible overflow when translating from
kbits to bytes.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
thread: Use explicit wide type when shifting > 32 bits

Without the explicit wide type, the shift operation may be performed
on a int which will result in implementation defined behaviour on a
system with more than 31 CPUs.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>