Thread (7 messages) 7 messages, 4 authors, 2011-01-13

[PATCH] ipv4: devconf: start IPV4_DEVCONF_* from 0

flat view
STALE5758d

From: Lucian Adrian Grijincu <hidden>
Date: 2011-01-12 10:19:31

The IPV4_DEVCONF_* enums are never exposed to the userspace and it
would make code simpler to remove all the useless (-1) adjustments.

-----

Thomas Graf added an interface that exposes the enums (counting from 1)
for libnl which seems to be the only user of the interface:

commit 9f0f7272ac9506f4c8c05cc597b7e376b0b9f3e4
Author: Thomas Graf [off-list ref]
Date:   Tue Nov 16 04:32:48 2010 +0000

    ipv4: AF_INET link address family

The development branch of libnl[0] redefines the enums in userspace
counting from 1 (to mimic the 2.6.37 kernel).

The stable[1] version of libnl does not define or use these enums.

This patch adjusts the number received from userspace to not break the
ABI, but given these circumstances, could we consider the 2.6.37 ABI
unstable and change the only user to start counting from 0?

[0] http://git.kernel.org/?p=libs/netlink/libnl.git
[1] http://git.kernel.org/?p=libs/netlink/libnl-stable.git

-----

    And the moral of the story is that we had better regard — after
    all those centuries! — zero as a most natural number.

    http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

CC: Edsger Wybe Dijkstra <redacted>
CC: Thomas Graf <redacted>
Signed-off-by: Lucian Adrian Grijincu <redacted>
---
 include/linux/inetdevice.h |    9 +++------
 net/ipv4/devinet.c         |   44 ++++++++++++++++++++++++++------------------
 2 files changed, 29 insertions(+), 24 deletions(-)

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help