summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/netfilter_ipv4
diff options
context:
space:
mode:
authorDavid S. Miller2014-07-21 05:39:16 +0200
committerDavid S. Miller2014-07-21 05:39:16 +0200
commit4ec6837804e4a0e096930f9d989952cb081eae2f (patch)
tree92c83d2cbb4ff1a24b21295853f3c5008d1d0158 /include/uapi/linux/netfilter_ipv4
parentbonding: make it possible to have unlimited nested upper vlans (diff)
parentnet: print net_device reg_state in netdev_* unless it's registered (diff)
downloadkernel-qcow2-linux-4ec6837804e4a0e096930f9d989952cb081eae2f.tar.gz
kernel-qcow2-linux-4ec6837804e4a0e096930f9d989952cb081eae2f.tar.xz
kernel-qcow2-linux-4ec6837804e4a0e096930f9d989952cb081eae2f.zip
Merge branch 'netdev_print'
Veaceslav Falico says: ==================== net: print net_device name/state more often Currently we use net_device->name only if it's the NETREG_REGISTERED reg_state, otherwise we return "(unregistered device)". However, we always populate net_device->name on creation, so it's always available to us for use. The only caveat is that we might have a name like "eth%d", in which case we cannot use it as it might change in the future. Also, the net_device might not be NETREG_UNREGISTERED when the function is called (_UNINITIALIZED, _UNREGISTERING, _RELEASED, _DUMMY), so it's misleading. So, a better way would be to always return the dev->name in netdev_name(), unless it's in the form of "eth%d" or it's empty, then return "unnamed net_device". This way we'll always return the name in NETREG_REGISTERED reg_state, and also return it in other states, when possible. Also, to be more verbose on non-NETREG_REGISTERED states, add a function netdev_reg_state(), which returns a string describing the state, and use it in netdev_printk()-related functions. If the dev is in NETREG_REGISTERED state then a void string is regurned and, thus, nothing changes. After these two patches we'll have the same behaviour in the usual cases, and more verbose in non-standardad/buggy ones. v2->v3: Correct the string for _UNINITIALIZED and warn on a bad reg_state, per Joe Perches's comments. v1->v2: As Tom Gundersen suggested, there might be a case when we have an empty string as a name for a device, so account this also and return "unnamed device" for that case too. ==================== Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/netfilter_ipv4')
0 files changed, 0 insertions, 0 deletions