- 23 5月, 2017 1 次提交
-
-
由 Jim Fehlig 提交于
Use a macro instead of hardcoding "127.0.0.1" throughout the sources.
-
- 19 12月, 2016 1 次提交
-
-
由 Jiri Denemark 提交于
The API creates PTR domain which corresponds to a given addr/prefix. Both IPv4 and IPv6 addresses are supported, but the prefix must be divisible by 8 for IPv4 and divisible by 4 for IPv6. The generated PTR domain has the following format IPv4: 1.2.3.4.in-addr.arpa IPv6: 0.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.0.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.ip6.arpa Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 27 6月, 2016 2 次提交
-
-
由 Laine Stump 提交于
There are times when we don't have a netmask pointer to give to virSocketAddrGetIPPrefix() (e.g. the IP addresses in domain interfaces only have a prefix, no netmask), but it would have caused a segv if we called it with NULL instead of a pointer to a netmask. This patch qualifies the code that would use the netmask or address pointers to check for NULL first.
-
由 Laine Stump 提交于
I'm tired of mistyping this all the time, so let's do it the same all the time (similar to how we changed all "Pci" to "PCI" awhile back). (NB: I've left alone some things in the esx and vbox drivers because I'm unable to compile them and they weren't obviously *not* a part of some API. I also didn't change a couple of variables named, e.g. "somethingIptables", because they were derived from the name of the "iptables" command)
-
- 30 5月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Yet another one of those where signed int (or long int) is not enough. And useless to as we're aiming at unsigned anyway. ../../src/util/virsocketaddr.c: In function 'virSocketAddrIsPrivate': ../../src/util/virsocketaddr.c:289:45: error: result of '192l << 24' requires 33 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=] return ((val & 0xFFFF0000) == ((192L << 24) + (168 << 16)) || ^~ ../../src/util/virsocketaddr.c:290:45: error: result of '172l << 24' requires 33 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=] (val & 0xFFF00000) == ((172L << 24) + (16 << 16)) || ^~ cc1: all warnings being treated as errors Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 03 5月, 2016 1 次提交
-
-
由 Erik Skultety 提交于
Our socket address format is in a rather non-standard format and that is because sasl library requires the IP address and service to be delimited by a semicolon. The string form is a completely internal matter, however once the admin interfaces to retrieve client identity information are merged, we should return the socket address string in a common format, e.g. format defined by URI rfc-3986, i.e. the IP address and service are delimited by a colon and in case of an IPv6 address, square brackets are added: Examples: 127.0.0.1:1234 [::1]:1234 This patch changes our default format to the one described above, while adding separate methods to request the non-standard SASL format using semicolon as a delimiter. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 21 3月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
This allows setting the address in host and/or network order and makes the naming consistent. Now you don't need to call [hn]to[nh]l() functions as that is taken care of by these functions. Also, now the *NetOrder take the address in network order, the other functions in host order so the naming and usage is consistent. Some places were having the address in network order and calling ntohl() just so the original function can call htonl() again. This makes it nicer to read. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 19 3月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
This is a missing counterpart for virSocketAddrSetIPv4Addr() and is going to be needed later in the tests. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 11 8月, 2015 1 次提交
-
-
由 Laine Stump 提交于
This patch modifies virSocketAddrGetRange() to function properly when the containing network/prefix of the address range isn't known, for example in the case of the NAT range of a virtual network (since it is a range of addresses on the *host*, not within the network itself). We then take advantage of this new functionality to validate the NAT range of a virtual network. Extra test cases are also added to verify that virSocketAddrGetRange() works properly in both positive and negative cases when the network pointer is NULL. This is the *real* fix for: https://bugzilla.redhat.com/show_bug.cgi?id=985653 Commits 1e334a and 48e8b9 had earlier been pushed as fixes for that bug, but I had neglected to read the report carefully, so instead of fixing validation for the NAT range, I had fixed validation for the DHCP range. sigh.
-
- 03 6月, 2015 3 次提交
-
-
由 Martin Kletzander 提交于
Since commit 55ace7c4, the sockettest fails without VIR_TEST_DEBUG set. The problem is found by test number 42 (co-incidence?), which tests range '192.168.122.1' - '192.168.122.255' in network '192.168.122.0/24'. That is supposed to fail because the end address is equal to the broadcast address. When comparing these two in 'virSocketAddrEqual(end, &broadcast)', there is a check for sin_addr as well as for sin_port. That port, however, is different when we do not enable test debugging. With the testing enabled, the port is 0 (correctly initialized), but without that it has a random number there. And that's because the structure is not initialized anywhere. By zeroing the structure before filling in the info, we make sure we return only the address and not any information that was not requested. And the test work once again. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Laine Stump 提交于
There are now many more reasons that virSocketAddrGetRange() could fail, so it is much more informative to report the error there instead of in the caller. (one of the two callers was previously assuming success, which is almost surely safe based on the parsing that has already happened to the config by that time, but it still is nicer to account for an error "just in case") Part of fix for: https://bugzilla.redhat.com/show_bug.cgi?id=985653
-
由 Laine Stump 提交于
virSocketAddrGetRange() has been updated to take the network address and prefix, and now checks that both the start and end of the range are within that network, thus validating that the entire range of addresses is in the network. For IPv4, it also checks that ranges to not start with the "network address" of the subnet, nor end with the broadcast address of the subnet (this check doesn't apply to IPv6, since IPv6 doesn't have a broadcast or network address) Negative tests have been added to the network update and socket tests to verify that bad ranges properly generate an error. This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=985653
-
- 17 1月, 2015 1 次提交
-
-
由 Cédric Bosdonnat 提交于
-
- 16 1月, 2015 1 次提交
-
-
由 Cédric Bosdonnat 提交于
If 0.0.0.0 or :: address is provided, then the returned prefix should be 0, for the default address.
-
- 22 10月, 2014 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Build with clang fails with: CC util/libvirt_util_la-virsocketaddr.lo util/virsocketaddr.c:904:17: error: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 1 to 4 [-Werror,-Wcast-align] inet4 = (struct sockaddr_in*) res->ai_addr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ util/virsocketaddr.c:909:17: error: cast from 'struct sockaddr *' to 'struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Werror,-Wcast-align] inet6 = (struct sockaddr_in6*) res->ai_addr; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. Fix that by replacing virSocketAddrParseInternal() call with virSocketAddrParse() in the virSocketAddrIsNumericLocalhost() function. virSocketAddrParse stores an address in virSocketAddr. virSocketAddr uses a union to store an address, so it doesn't need casting.
-
- 15 10月, 2014 4 次提交
-
-
由 Chen Fan 提交于
Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
由 Chen Fan 提交于
Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
由 Chen Fan 提交于
Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Chen Fan 提交于
if specifying migration_host to an Ipv6 address without brackets, it was resolved to an incorrect address, such as: tcp:2001:0DB8::1428:4444, but the correct address should be: tcp:[2001:0DB8::1428]:4444 so we should add brackets when parsing it. Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
-
- 05 9月, 2014 1 次提交
-
-
由 Eric Blake 提交于
I'm about to add a syntax check that enforces our documented HACKING style of always using matching {} on if-else statements. This patch focuses on all remaining problems, where there weren't enough issues to warrant splitting it further. * src/remote/remote_driver.c (doRemoteOpen): Correct use of {}. * src/security/virt-aa-helper.c (vah_add_path, valid_path, main): Likewise. * src/rpc/virnetsocket.c (virNetSocketNewConnectLibSSH2): Likewise. * src/esx/esx_vi_types.c (esxVI_Type_FromString): Likewise. * src/uml/uml_driver.c (umlDomainDetachDevice): Likewise. * src/util/viralloc.c (virShrinkN): Likewise. * src/util/virbuffer.c (virBufferURIEncodeString): Likewise. * src/util/virdbus.c (virDBusCall): Likewise. * src/util/virnetdev.c (virNetDevValidateConfig): Likewise. * src/util/virnetdevvportprofile.c (virNetDevVPortProfileGetNthParent): Likewise. * src/util/virpci.c (virPCIDeviceIterDevices) (virPCIDeviceWaitForCleanup) (virPCIDeviceIsBehindSwitchLackingACS): Likewise. * src/util/virsocketaddr.c (virSocketAddrGetNumNetmaskBits): Likewise. * src/util/viruri.c (virURIParseParams): Likewise. * daemon/stream.c (daemonStreamHandleAbort): Likewise. * tests/testutils.c (virtTestResult): Likewise. * tests/cputest.c (cpuTestBaseline): Likewise. * tools/virsh-domain.c (cmdDomPMSuspend): Likewise. * tools/virsh-host.c (cmdNodeSuspend): Likewise. * src/esx/esx_vi_generator.py (Type.generate_typefromstring): Tweak generated code. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 21 3月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 20 3月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
The virSocketAddrMask method did not initialize all fields in the sockaddr_in6 struct. In paticular the 'sin6_scope_id' field could contain random garbage, which would in turn affect the result of any later virSocketAddrFormat calls. This led to ip6tables rules in the FORWARD chain which matched on random garbage sin6_scope_id. Fortunately these were ACCEPT rules, so the impact was merely that desired traffic was blocked, rather than undesired traffic allowed. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 15 10月, 2013 1 次提交
-
-
由 Eric Blake 提交于
'const fooPtr' is the same as 'foo * const' (the pointer won't change, but it's contents can). But in general, if an interface is trying to be const-correct, it should be using 'const foo *' (the pointer is to data that can't be changed). Fix up offenders in src/util outside of the virnet namespace. Also, make a few virSocketAddr functions const-correct, for easier conversions in future patches. * src/util/virbuffer.h (virBufferError, virBufferUse) (virBufferGetIndent): Use intended type. * src/util/virmacaddr.h (virMacAddrCmp, virMacAddrCmpRaw) (virMacAddrSet, virMcAddrFormat, virMacAddrIsUnicast) (virMacAddrIsMulticast): Likewise. * src/util/virebtables.h (ebtablesAddForwardAllowIn) (ebtablesRemoveForwardAllowIn): Likewise. * src/util/virsocketaddr.h (virSocketAddrSetIPv4Addr): Drop incorrect const. (virMacAddrGetRaw, virSocketAddrFormat, virSocketAddrFormatFull): Make const-correct. (virSocketAddrMask, virSocketAddrMaskByPrefix) (virSocketAddrBroadcast, virSocketAddrBroadcastByPrefix) (virSocketAddrGetNumNetmaskBits, virSocketAddrGetIpPrefix) (virSocketAddrEqual, virSocketAddrIsPrivate) (virSocketAddrIsWildcard): Use intended type. * src/util/virbuffer.c (virBufferError, virBufferUse) (virBufferGetIndent): Fix fallout. * src/util/virmacaddr.c (virMacAddrCmp, virMacAddrCmpRaw) (virMacAddrSet, virMcAddrFormat, virMacAddrIsUnicast) (virMacAddrIsMulticast): Likewise. * src/util/virebtables.c (ebtablesAddForwardAllowIn) (ebtablesRemoveForwardAllowIn): Likewise. * src/util/virsocketaddr.c (virSocketAddrMask, virMacAddrGetRaw) (virSocketAddrMaskByPrefix, virSocketAddrBroadcast) (virSocketAddrBroadcastByPrefix, virSocketAddrGetNumNetmaskBits) (virSocketAddrGetIpPrefix, virSocketAddrEqual) (virSocketAddrIsPrivate, virSocketAddrIsWildcard) (virSocketAddrGetIPv4Addr, virSocketAddrGetIPv6Addr) (virSocketAddrFormat, virSocketAddrFormatFull): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 11 10月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
This function takes exactly one argument: an address to check. It returns true, if the address is an IPv4 or IPv6 address in numeric format, false otherwise (e.g. for "examplehost"). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 11 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 10 7月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 28 6月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The 'in_addr_t' typedef is not present in Mingw64 headers. Instead we can use the more portable 'struct in_addr' and then access its 's_addr' field. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 10 6月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
The IN6_IS_ADDR_UNSPECIFIED macro expects pointer to sin6_addr element instead of s6_addr element.
-
- 07 6月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
This internal API checks, if passed address is a wildcard address.
-
- 28 5月, 2013 1 次提交
-
-
由 Eric Blake 提交于
I noticed several unusual spacings in for loops, and decided to fix them up. See the next commit for the syntax check that found all of these. * examples/domsuspend/suspend.c (main): Fix spacing. * python/libvirt-override.c: Likewise. * src/conf/interface_conf.c: Likewise. * src/security/virt-aa-helper.c: Likewise. * src/util/virconf.c: Likewise. * src/util/virhook.c: Likewise. * src/util/virlog.c: Likewise. * src/util/virsocketaddr.c: Likewise. * src/util/virsysinfo.c: Likewise. * src/util/viruuid.c: Likewise. * src/vbox/vbox_tmpl.c: Likewise. * src/xen/xen_hypervisor.c: Likewise. * tools/virsh-domain-monitor.c (vshDomainStateToString): Drop default case, to let compiler check us. * tools/virsh-domain.c (vshDomainVcpuStateToString): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 24 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 02 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
The source code base needs to be adapted as well. Some files include virutil.h just for the string related functions (here, the include is substituted to match the new file), some include virutil.h without any need (here, the include is removed), and some require both.
-
- 23 4月, 2013 1 次提交
-
-
由 Gene Czarcinski 提交于
Create the utility function virSocketAddrGetIpPrefix() to determine the prefix for this network. The code in this function was adapted from virNetworkIpDefPrefix(). Update virNetworkIpDefPrefix() in src/conf/network_conf.c to use the new utility function. Signed-off-by: NGene Czarcinski <gene@czarc.net>
-
- 30 1月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=905708 Only the first 12 bits should be set in the mask for this range. All addresses between 172.16.0.0 and 172.31.255.255 are private.
-
- 21 12月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
- 30 11月, 2012 1 次提交
-
-
由 Laine Stump 提交于
This new function returns true if the given address is in the range of any "private" or "local" networks as defined in RFC1918 (IPv4) or RFC3484/RFC4193 (IPv6), otherwise they return false. These ranges are: 192.168.0.0/16 172.16.0.0/16 10.0.0.0/24 FC00::/7 FEC0::/10
-
- 02 11月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
The libvirt coding standard is to use 'function(...args...)' instead of 'function (...args...)'. A non-trivial number of places did not follow this rule and are fixed in this patch. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 12 10月, 2012 1 次提交
-
-
由 Ján Tomko 提交于
-