Instead of allocating a 'struct inet_data', rtnl_link_inet_get_conf()
should only look for an existing entry.
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Take 'include/uapi/linux/ip.h' from current kernel v3.13
(commit d8ec26d7f8287f5788a494f56e8814210f0e64be).
Also add three new IPV4_DEVCONF_* names.
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
If the netlink message for IFLA_INET_CONF contains less then
IPV4_DEVCONF_MAX entires, the last entries in i_conf are unset.
Modify rtnl_link_inet_get_conf() to return -EINVAL when accessing
an unset cfgid.
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Older kernel version might have fewer values defined, so they would send
netlink messages that got rejected. Only check that at least one value
got sent.
This is especially grave as libnl uses an internal copy of the
kernel header files. Thus not only it is bound to the installed kernel
headers but to the libnl internal header copies that might easily be out
of sync with the kernel.
This affects IFLA_PROTINFO, inet6_parse_protinfo():
- tb[IFLA_INET6_CONF], expecting DEVCONF_MAX
- tb[IFLA_INET6_STATS], expecting __IPSTATS_MIB_MAX
- tb[IFLA_INET6_ICMP6STATS], expecting __ICMP6_MIB_MAX
and IFLA_AF_SPEC, inet_parse_af():
- tb[IFLA_INET_CONF], expecting IPV4_DEVCONF_MAX
https://bugzilla.redhat.com/show_bug.cgi?id=1062533
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Note: The code for this is not upstream yet.
Extends the link api to allow address family modules to fill a link
message and implements a AF_INET address family link module which
uses the new interface.