[PATCH] ncftool: avoid memory leak
by Alex Jia
From: Alex Jia <ajia(a)redhat.com>
* src/ncftool.c: Calling allocation function 'ncf_lookup_by_name' to allocate
memory to 'nif', however, it hasn't been released before return.
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
src/ncftool.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/ncftool.c b/src/ncftool.c
index c9e26a2..90c6cbf 100644
--- a/src/ncftool.c
+++ b/src/ncftool.c
@@ -390,8 +390,10 @@ static int cmd_undefine(const struct command *cmd) {
return CMD_RES_ERR;
r = ncf_if_undefine(nif);
- if (r < 0)
+ if (r < 0) {
+ ncf_if_free(nif);
return CMD_RES_ERR;
+ }
printf("%s undefined\n", name);
ncf_if_free(nif);
--
1.7.1
12 years, 7 months
[PATCH 0/11] Support for Debian/Suse/Windows distros
by Daniel P. Berrange
This is an update to
https://fedorahosted.org/pipermail/netcf-devel/2011-September/000601.html
As before it includes the Debian driver which is fully functional.
In v2 though, it also includes
- The Suse driver taken from OpenSuse netcf RPMs. This is only
partially complete and apparently only works for plain ethernet
devices, not bridging/bonding
- The Windows driver developed by Adam Stokes. This is only
partially complete, only able to list devices and bring them
up / down. No XML query/define support at all.
- Update to the bootstrap scripts
- An automated build script
IMHO, we should include the Suse/Windows drivers as they are,
even though they're incomplete, since this might motivate
someone into fixing them up further
12 years, 7 months
[PATCH] Fix missing vlan/bond/ethernet info in dumpxml --live
by Laine Stump
This patch addresses:
https://bugzilla.redhat.com/show_bug.cgi?id=736920
https://bugzilla.redhat.com/show_bug.cgi?id=739505
Commit 38f44cf (pushed between 0.1.8 and 0.1.9) put a check for an
invalid ifindex into the functions that add type-specific status data
to the xml document (e.g. the mac address of an ethernet, or tag of a
vlan). This check was inadvertently done incorrectly ("ifindex !=
RTNL_LINK_NOT_FOUND" rather than "ifindex == RTNL_LINK_NOT_FOUND").
This patch corrects that error.
Because these functions are a part of the code to gather info from the
kernel via libnl (netlink) calls, there is unfortunately no simple way
to incorporate a build-time test to prevent similar regressions in the
future; we will instead have to rely on separate testing.
---
src/dutil_linux.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/dutil_linux.c b/src/dutil_linux.c
index 75492ba..730be45 100644
--- a/src/dutil_linux.c
+++ b/src/dutil_linux.c
@@ -909,7 +909,7 @@ static void add_ethernet_info(struct netcf *ncf,
struct rtnl_link *filter_link = NULL;
/* if interface isn't currently available, nothing to add */
- if (ifindex != RTNL_LINK_NOT_FOUND)
+ if (ifindex == RTNL_LINK_NOT_FOUND)
return;
filter_link = rtnl_link_alloc();
@@ -998,7 +998,7 @@ static void add_vlan_info(struct netcf *ncf,
struct rtnl_link *filter_link = NULL;
/* if interface isn't currently available, nothing to add */
- if (ifindex != RTNL_LINK_NOT_FOUND)
+ if (ifindex == RTNL_LINK_NOT_FOUND)
return;
filter_link = rtnl_link_alloc();
@@ -1113,7 +1113,7 @@ static void add_bond_info(struct netcf *ncf,
= { doc, root, NULL, ifindex, ncf };
/* if interface isn't currently available, nothing to add */
- if (ifindex != RTNL_LINK_NOT_FOUND)
+ if (ifindex == RTNL_LINK_NOT_FOUND)
return;
nl_cache_foreach(ncf->driver->link_cache, add_bond_info_cb, &cb_data);
--
1.7.3.4
12 years, 7 months
[PATCH 0/4] Support for Debian/Ubuntu
by Daniel P. Berrange
This patch series adds a new driver to NetCF that is able to
support Debian/Ubuntu OS. It has been tested on Debian Squeeze
only, so your milage may vary with older releases. At a min
it requires
- ifenslave
- bridge-utils
- vlan
to be available for configuring bonding, bridging & vlans
respectively. It supports IPv4 and IPv6 in most cases.
As with the Red Hat driver, there is no support for Wireless
PPP, or other types of wierd configs unrelated to etherner.
It is able to read any configuration that it has previously
written out. It should be able to read any configuration
created by an administrator, provided it follows the approach
illustrated in the doc/debian.txt file. Configurations that
make excessive use of up/down/pre-up/post-down scripts to
do magical bonding/bridging stuff are unlikely to work. You
should use the new style configs with new support.
It appears that Debian 'interfaces' file allows '-' to be
used as an alternative to '_' in many configuration options.
The netcf driver does not support this, only '_' is supported
at this time.
The default Debian Squeeze install comes with a /etc/modprobe.d/aliases.conf
file that is not parsable by augeas. The last 2 lines in that
file must be commented out if you want netcf to work.
12 years, 7 months
netcf fundamentally changes iptables config
by Dan Krause
I know this is the -devel mailing list, but I can find no other way of
contacting netcf developers or users.
Every time I use netcf, it makes a change to my iptables config, by
adding the following line:
-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
This is a pretty fundamental change to my iptables configuration - it
causes every packet destined for a bridged interface to pass through,
which breaks my existing firewall config. This causes traffic to make it
through to the bridges that I was formerly restricting. Every time I
comment it out, it gets added. Nothing I do seems to stop this tool from
breaking my iptables every time I use it. Browsing the source seems to
indicate that if bridged traffic is passed through iptables, netcf will
purposely alter my firewall config during the netcf init stage. Every
time.
How can this be corrected, so I can retain control of my firewall
configuration while using this tool to configure network bridges via
libvirt?
- Dan
12 years, 7 months