Bug 1261432
| Summary: | net-dhcp-leases should return error when parse invalid mac | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Shanzhi Yu <shyu> |
| Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.2 | CC: | dyuan, jsuchane, jtomko, mzhan, rbalakri, yalzhang |
| Target Milestone: | rc | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.3.1-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-03 18:23:50 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Shanzhi Yu
2015-09-09 10:20:58 UTC
*** This bug has been marked as a duplicate of bug 1281707 *** Fixed upstream by:
commit 1e6d87bdfc801d2c006a17054bd19273430dce14
Author: Ján Tomko <jtomko>
CommitDate: 2015-12-03 10:15:22 +0100
bridge: check for invalid MAC in networkGetDHCPLeases
Instead of comparing garbage strings against real MAC addresses,
introduce an error mesage for unparsable ones:
$ virsh net-dhcp-leases default --mac t12
error: Failed to get leases info for default
error: invalid MAC address: t12
https://bugzilla.redhat.com/show_bug.cgi?id=1261432
git describe: v1.3.0-rc1-3-g1e6d87b
verified on libvirt-1.3.1-1.el7.x86_64, the result is as expected. [root@work tmp]# virsh net-dhcp-leases default Expiry Time MAC address Protocol IP address Hostname Client ID or DUID ------------------------------------------------------------------------------------------------------------------- 2016-02-23 17:55:31 52:54:00:1b:6f:e5 ipv4 192.168.122.159/24 - - 2016-02-23 17:32:43 52:54:00:ed:89:bc ipv4 192.168.122.176/24 yalan-PC 01:52:54:00:ed:89:bc [root@work tmp]# virsh net-dhcp-leases default --mac invalid error: Failed to get leases info for default error: invalid MAC address: invalid Tried more invalid mac address, the result is as expected. The mac should be dotted hexadecimal and 16 characters in all. [root@work tmp]# virsh net-dhcp-leases default '52:54:00:ed:89:fg' error: Failed to get leases info for default error: invalid MAC address: 52:54:00:ed:89:fg [root@work tmp]# virsh net-dhcp-leases default --mac " 52:54:00:ed:89:bc" error: Failed to get leases info for default error: invalid MAC address: 52:54:00:ed:89:bc [root@work tmp]# virsh net-dhcp-leases default --mac 52-54-00-ed-89-bc error: Failed to get leases info for default error: invalid MAC address: 52-54-00-ed-89-bc [root@work tmp]# virsh net-dhcp-leases default --mac 52:54:00:ed:89 error: Failed to get leases info for default error: invalid MAC address: 52:54:00:ed:89 check a valid mac: [root@work tmp]# virsh net-dhcp-leases default --mac "52:54:00:ed:89:bc" Expiry Time MAC address Protocol IP address Hostname Client ID or DUID ------------------------------------------------------------------------------------------------------------------- 2016-02-23 18:29:59 52:54:00:ed:89:bc ipv4 192.168.122.176/24 yalan-PC 01:52:54:00:ed:89:bc Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html |