Fixed a bug in netcf when netmask is bigger than 24
by Jens Nyberg
Hi,
I noticed a bug in netcf when setting a netmask larger than /24.
This patch consist of:
* Removed a -1 in the inet_ntop call which is the actual bug that made the string incorrect.
* Changed the way you calculate the netmask ip in a more intuitive way - feel free to ignore it if you want.
--- xslt_ext.c 2011-10-26 17:42:54.000000000 +0200
+++ xslt_ext.c.new 2011-10-26 17:39:16.000000000 +0200
@@ -71,10 +71,10 @@
struct in_addr netmask;
xmlChar netmask_str[16];
- netmask.s_addr = htonl(~((1 << (32 - prefix)) - 1));
+ netmask.s_addr = htonl(~(0xffffffff >> prefix));
if (! inet_ntop(AF_INET, &netmask,
- (char *) netmask_str, sizeof(netmask_str) - 1)) {
+ (char *) netmask_str, sizeof(netmask_str))) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"ipcalc:netmask: internal error: inet_ntop failed");
goto error;
12 years, 4 months
Fix to allow definitions with multiple ipv4 addresses for arp monitoring
by Jens Nyberg
Hi!
It's me again and I have a new patch. I don't know if I went about this the correct way but it solved a problem we had.
We wanted to define multiple targets for arp monitoring. Having multiple targets actually works except it is disallowed by the parser so I created a new definition called ipv4-multi-addr to solve it.
This might not be the correct solution so please advice me on how to further improve this in order to better suit the netcf code base.
Thanks!
// Jens
Patch:
--- interface.rng 2010-06-17 15:40:45.000000000 +0200
+++ interface.rng.new 2011-10-31 14:56:36.000000000 +0100
@@ -202,7 +202,7 @@
</element>
<element name="arpmon">
<attribute name="interval"><ref name="uint"/></attribute>
- <attribute name="target"><ref name="ipv4-addr"/></attribute>
+ <attribute name="target"><ref name="ipv4-multi-addr"/></attribute>
<optional>
<attribute name="validate">
<choice>
@@ -446,6 +446,12 @@
</data>
</define>
+ <define name='ipv4-multi-addr'>
+ <data type='string'>
+ <param name="pattern">(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))\.){3}((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))(,(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))\.){3}((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))*</param>
+ </data>
+ </define>
+
<define name='ipv4-prefix'>
<data type='unsignedInt'>
<param name="maxInclusive">32</param>
12 years, 4 months
copyrights
by Serge Hallyn
Hi,
I'm trying to finish the debian/ubuntu netcf package, and trying to make
sure I get copyrights right. The debian/copyright file I have so far is
below. There are a lot of xml files under tests/ and data/ (i.e.
./tests/suse/schema/vlan.xml) which have no attribution. Are they all
the same license and copyright as the main project, or were some taken
from other projects?
thanks,
-serge
====================== debian/copyright ==========================
Format: http://dep.debian.net/deps/dep5
Upstream-Name: netcf
Source: http://git.fedorahosted.org/git/?p=netcf.git
Files: tests/cutest.*
Copyright: 2003 Asim Jalis
License:
.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
.
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software in
a product, an acknowledgment in the product documentation would be
appreciated but is not required.
.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
.
3. This notice may not be removed or altered from any source distribution.
Files: *
Copyright: 2009-2011 David Lutterkort <lutter(a)redhat.com>
2009-2011 Laine Stump <laine(a)laine.org>
2009 Daniel Veillard <veillard(a)redhat.com>
2009 Jonas Eriksson <jonas.j.eriksson(a)ericsson.com>
2009,2011 Daniel Berrange <berrange(a)redhat.com>
2010 Cole Robinson <crobinso(a)redhat.com>
2010,2011 Eric Blake <eblake(a)redhat.com>
2011 Osier Yang <jyang(a)redhat.com>
2011 Aleix Conchillo <aleix(a)oblong.com>
License: GNU LESSER GENERAL PUBLIC LICENSE
.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
Files: debian/*
Copyright: 2011 Ubuntu <ubuntu@unknown>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
12 years, 5 months