Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 860506 Details for
Bug 1057772
Querying the ipv6 address of a non existing (or no longer existing) device ends up in a Python SystemError
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Report invalid/non-existing devices as ENODEV
0001-Report-invalid-non-existing-devices-as-ENODEV.patch (text/plain), 1.84 KB, created by
David Sommerseth
on 2014-02-07 12:59:08 UTC
(
hide
)
Description:
Report invalid/non-existing devices as ENODEV
Filename:
MIME Type:
Creator:
David Sommerseth
Created:
2014-02-07 12:59:08 UTC
Size:
1.84 KB
patch
obsolete
>From 4287666557c09cef5af8e8a6bb1230632e830aa7 Mon Sep 17 00:00:00 2001 >From: David Sommerseth <davids@redhat.com> >Date: Fri, 7 Feb 2014 13:53:36 +0100 >Subject: [PATCH] Report invalid/non-existing devices as ENODEV > >Without this patch py-ethtool will just report with a very >generic system error exception if trying to query a non-existing >network interface. This patch will change this to report the >error using ENODEV instead. > >Signed-off-by: David Sommerseth <davids@redhat.com> >--- > python-ethtool/etherinfo.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/python-ethtool/etherinfo.c b/python-ethtool/etherinfo.c >index c5e6798..24147bc 100644 >--- a/python-ethtool/etherinfo.c >+++ b/python-ethtool/etherinfo.c >@@ -118,6 +118,9 @@ static int _set_device_index(PyEtherInfo *self) > struct nl_cache *link_cache; > struct rtnl_link *link; > >+ /* Reset errno, as we will use it to report errors further on */ >+ errno = 0; >+ > /* Find the interface index we're looking up. > * As we don't expect it to change, we're reusing a "cached" > * interface index if we have that >@@ -129,6 +132,7 @@ static int _set_device_index(PyEtherInfo *self) > > link = rtnl_link_get_by_name(link_cache, PyString_AsString(self->device)); > if( !link ) { >+ errno = ENODEV; > nl_cache_free(link_cache); > return 0; > } >@@ -177,6 +181,9 @@ int get_etherinfo_link(PyEtherInfo *self) > } > > if( _set_device_index(self) != 1) { >+ if( errno != 0 ) { >+ PyErr_SetString(PyExc_IOError, strerror(errno)); >+ } > return 0; > } > >@@ -227,6 +234,9 @@ PyObject * get_etherinfo_address(PyEtherInfo *self, nlQuery query) > } > > if( _set_device_index(self) != 1) { >+ if( errno != 0 ) { >+ return PyErr_SetFromErrno(PyExc_IOError); >+ } > return NULL; > } > >-- >1.8.5.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1057772
: 860506