Stephen Hemminger wrote:
> The argument to print_0xhex is converted to unsigned long long
> so the format string give for normal printout has to be some
> variant of %llx. Otherwise, bogus values will be printed on
> 32 bit platforms.
Sorry it is too late and change is merged as commit 90c5c969f0
tun_validate() when @data is NULL that is
always in case since rtnl_link_ops->maxtype is zero in tun driver.
Fixes: f019a7a594d9 ("tun: Implement ip link del tunXXX")
Signed-off-by: Serhey Popovych
---
drivers/net/tun.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/driver
Fixes: commit 9516823051ce ("ipaddress: Improve print_linkinfo()")
Reported-by: Vincent Bernat
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c |6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 5009bfe..ea8211c 100644
--
Serhey Popovych wrote:
> Vincent Bernat wrote:
>> ❦ 11 juillet 2018 21:01 -0400, David Ahern :
>>
>>>> +++ b/ip/ipaddress.c
>>>> @@ -837,11 +837,6 @@ int print_linkinfo(const struct sockaddr_nl *who,
>>>>if (!name)
>>
Vincent Bernat wrote:
> ❦ 11 juillet 2018 21:01 -0400, David Ahern :
>
>>> +++ b/ip/ipaddress.c
>>> @@ -837,11 +837,6 @@ int print_linkinfo(const struct sockaddr_nl *who,
>>> if (!name)
>>> return -1;
>>>
>>> - if (filter.label &&
>>> - (!filter.family || filter.family
and returns -1 to it's caller. Either call exit()
or return to the caller to preserve behaviour before change.
Use -nodev() in traffic control (tc) code to return 1.
Simplify expression for checking for argument being 0/NULL in @if
statement.
Signed-off-by: Serhey Popovych
---
bridge/
are not needed outside.
While there change return -1 to exit(-1) for group parsing errors: we
want to stop further command processing unless -force option is given
to get error line easily.
Signed-off-by: Serhey Popovych
---
ip/ip_common.h|4 +-
ip/iplink.c | 143
behaviour on link create:
ip link add {name|dev} veth1a type veth peer {name|dev} veth1b
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 34 ++
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index 5471626..b43
ments
to help identify failing line in batch mode.
Thanks,
Serhii
Serhey Popovych (4):
utils: Introduce and use nodev() helper routine
iplink: Use "dev" and "name" parameters interchangeable when possible
iplink: Follow documented behaviour when "index" is
ed for ip link delete scenario
(actually "index" being ignored in favor to "dev").
Prohibit "index" when configuring/deleting group of network devices.
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
d
Stephen Hemminger wrote:
> On Tue, 27 Feb 2018 14:06:51 +0200
> Serhey Popovych wrote:
>
>> diff --git a/include/compat/libc/bits/socket.h
>> b/include/compat/libc/bits/socket.h
>> new file mode 100644
>> index 000..25ef0d5
>> --- /dev/null
>
Stephen Hemminger wrote:
> On Tue, 27 Feb 2018 21:34:56 +0200
> Serhey Popovych wrote:
>
>> Stephen Hemminger wrote:
>>> On Tue, 27 Feb 2018 14:06:50 +0200
>>> Serhey Popovych wrote:
>>>
>>>> Since commit 596b1c94aa38 ("iprout
Stephen Hemminger wrote:
> On Tue, 27 Feb 2018 14:06:50 +0200
> Serhey Popovych wrote:
>
>> Since commit 596b1c94aa38 ("iproute: build more easily on Android"),
>> iproute2 uses types __kernel_long_t and __kernel_ulong_t but does not
>> provide internal defi
Thomas De Schampheleire wrote:
> On Mon, Feb 26, 2018 at 09:46:41PM +0200, Serhey Popovych wrote:
>> Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types
>> __kernel_long_t and __kernel_ulong_t but does not provide internal
>> definitions for it.
eport ecnseen")
and original one introducing this include commit 76e5d2c39201 ("add
include/netinet/tcp.h").
Any missing functionality and compatibility stuff must go to "compat"
subdirectory in include/.
Signed-off-by: Serhey Popovych
---
x27;s contents for compat.
As usal reviews, comments and suggestions are welcome.
Thanks,
Serhii
Serhey Popovych (3):
ip: Fix compilation with kernel headers < 3.4
ss: Fix build with old libc headers without AF_VSOCK
ip: Get rid of custom netinet/tcp.h
Makefile
Thomas De Schampheleire
Signed-off-by: Serhey Popovych
---
Makefile |5 -
include/compat/kernel/linux/sysinfo.h | 14 ++
2 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 include/compat/kernel/linux/sysinfo.h
diff --git a/
ompatibility; adjust
AF_MAX and PF_MAX to reflect change.
Tested in Debian 7 (Wheezy) environment with glibc-2.13 and Linux
Kernel 3.2. Still supported config until 31 May 2018 according to
Debian LTS support page.
Signed-off-by: Serhey Popovych
---
include/compat/libc/bits/socket.h | 15 +++
Thomas De Schampheleire wrote:
> On Mon, Feb 26, 2018 at 09:46:41PM +0200, Serhey Popovych wrote:
>> Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types
>> __kernel_long_t and __kernel_ulong_t but does not provide internal
>> definitions for it.
Serhey Popovych wrote:
> David Ahern wrote:
>> On 2/26/18 11:20 AM, Serhey Popovych wrote:
>>> Stephen Hemminger wrote:
>>>> On Thu, 22 Feb 2018 15:02:06 +0200
>>>> Serhey Popovych wrote:
>>>>
>>>>> +struct iplink_parse_args {
Serhey Popovych wrote:
> Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types
> __kernel_long_t and __kernel_ulong_t but does not provide internal
> definitions for it.
>
> This means that compilation using kernel headers that are older than 3.4
> (wher
Signed-off-by: Serhey Popovych
---
include/linux/sysinfo.h | 14 ++
misc/ss.c | 10 ++
2 files changed, 24 insertions(+)
create mode 100644 include/linux/sysinfo.h
diff --git a/include/linux/sysinfo.h b/include/linux/sysinfo.h
new file mode 100644
index
Thomas De Schampheleire wrote:
> Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types
> __kernel_long_t and __kernel_ulong_t but does not provide internal
> definitions for it.
I tried one time to build with headers from 3.2 (last supported LTS at
the moment) and found that A
David Ahern wrote:
> On 2/26/18 11:20 AM, Serhey Popovych wrote:
>> Stephen Hemminger wrote:
>>> On Thu, 22 Feb 2018 15:02:06 +0200
>>> Serhey Popovych wrote:
>>>
>>>> +struct iplink_parse_args {
>>>> + const char *dev;
>>>&g
Stephen Hemminger wrote:
> On Thu, 22 Feb 2018 15:02:06 +0200
> Serhey Popovych wrote:
>
>> +struct iplink_parse_args {
>> +const char *dev;
>> +const char *name;
>> +const char *type;
>> +
>> +/* This definitely must be the last on
David Ahern wrote:
> On 2/22/18 6:02 AM, Serhey Popovych wrote:
>> Introduce new @struct iplink_parse_args data structure to consolidate
>> arguments to iplink_parse(). This will reduce number of arguments
>> passed to it.
>>
>> Pass this data structure to ->pa
David Ahern wrote:
> On 2/22/18 6:02 AM, Serhey Popovych wrote:
>> Now in iplink_parse() we use ->ifi_change and ->ifi_flags fields and
>> plan to use ->ifi_index with upcoming change.
>>
>> Saving, restoring and reinitializing individual fields is error prone
David Ahern wrote:
> On 2/22/18 6:02 AM, Serhey Popovych wrote:
>> To benefit other users (e.g. link_veth.c) of iplink_parse() from
>> additional attribute checks and setups made in iplink_modify(). This
>> catches most of weired cobination of parameters to peer device
>>
David Ahern wrote:
> On 2/22/18 6:02 AM, Serhey Popovych wrote:
>> Now in iplink_parse() we use ->ifi_change and ->ifi_flags fields and
>> plan to use ->ifi_index with upcoming change.
>>
>> Saving, restoring and reinitializing individual fields is error prone
David Ahern wrote:
> On 2/22/18 6:02 AM, Serhey Popovych wrote:
>> Introduce new @struct iplink_parse_args data structure to consolidate
>> arguments to iplink_parse(). This will reduce number of arguments
>> passed to it.
>>
>> Pass this data structure to ->pa
David Ahern wrote:
> On 2/22/18 6:02 AM, Serhey Popovych wrote:
>> @@ -650,6 +658,9 @@ int iplink_parse(int argc, char **argv, struct
>> iplink_req *req,
>> bool drv = strcmp(*argv, "xdpdrv") == 0;
>> bool offlo
and returns -1 to it's caller. Either call exit()
or return to the caller to preserve behaviour before change.
Use -nodev() in traffic control (tc) code to return 1.
Simplify expression for checking for argument being 0/NULL in @if
statement.
Signed-off-by: Serhey Popovych
---
bridge/
behaviour on link create:
ip link add {name|dev} veth1a type veth peer {name|dev} veth1b
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 34 ++
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index fc358fc..135
in device ifinfomsg data.
Since @struct ifinfomsg is small enough with known sizeof() compiler may
inline memcpy()/memset() with few load/store instructions.
Signed-off-by: Serhey Popovych
---
ip/iplink_vxcan.c | 22 --
ip/link_veth.c| 22 --
2 files ch
a exit() when failing to parse command line arguments
to help identify failing line in batch mode.
Thanks,
Serhii
Serhey Popovych (8):
utils: Introduce and use nodev() helper routine
iplink: Correctly report error when network device isn't found
iplink: Use "dev" and "
needed outside.
While there change return -1 to exit(-1) for group parsing errors: we
want to stop further command processing unless -force option is given
to get error line easily.
Signed-off-by: Serhey Popovych
---
ip/ip_common.h|3 +-
ip/iplink.c | 118
This will consolidate data and code using it in single place and prepare
for upcoming ->parse_opt() method change.
Signed-off-by: Serhey Popovych
---
ip/link_gre.c| 32
ip/link_gre6.c | 32
ip/link_ip6tnl.c |
ed for ip link delete scenario
(actually "index" being ignored in favor to "dev").
Prohibit "index" when configuring/deleting group of network devices.
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
d
not
found) for this.
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 16 +---
ip/iplink_xdp.c |7 +--
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index 5471626..fc358fc 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -569,6 +569,1
off-by: Serhey Popovych
---
ip/ip_common.h | 16 +---
ip/iplink.c | 34 ++
ip/iplink_bond.c |4 +++-
ip/iplink_bond_slave.c |4 +++-
ip/iplink_bridge.c |4 +++-
ip/iplink_bridge_slave.c |4 +++-
David Ahern wrote:
> On 2/20/18 2:37 PM, Serhey Popovych wrote:
>> Distinguish cases when "dev" parameter isn't given from cases where no
>> network device corresponding to "dev" is found.
>>
>> Do not check for index validity in xdp_parse():
Petr Machata wrote:
> For IP-in-IP tunnels, one can specify the [no]allow-localremote command
> when configuring a device. Under the hood, this flips the
> IP6_TNL_F_ALLOW_LOCAL_REMOTE flag on the netdevice. However, ip6gretap
> and ip6erspan devices, where the flag is also relevant, are not IP-in-
Stephen Hemminger wrote:
> On Tue, 20 Feb 2018 23:37:25 +0200
> Serhey Popovych wrote:
>
>> Both of them accept network device name as argument, but have different
>> meaning:
>>
>> dev - is a device by it's name,
>> name - name for specific d
tility
behaviour on link create:
ip link add {name|dev} veth1a type veth peer {name|dev} veth1b
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 34 ++
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index
off-by: Serhey Popovych
---
ip/ip_common.h | 16 +---
ip/iplink.c | 34 ++
ip/iplink_bond.c |4 +++-
ip/iplink_bond_slave.c |4 +++-
ip/iplink_bridge.c |4 +++-
ip/iplink_bridge_slave.c |4 +++-
not
found) for this.
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 16 +---
ip/iplink_xdp.c |7 +--
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index 5471626..fc358fc 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -569,6 +569,1
and processing unless -force option is given
to get error line easily.
Signed-off-by: Serhey Popovych
---
ip/ip_common.h|3 +-
ip/iplink.c | 118 +
ip/iplink_vxcan.c | 27 +++-
ip/link_veth.c| 27 +++-
4 files chan
This will consolidate data and code using it in single place and prepare
for upcoming ->parse_opt() method change.
Signed-off-by: Serhey Popovych
---
ip/link_gre.c| 32
ip/link_gre6.c | 32
ip/link_ip6tnl.c |
v2
Terminate via exit() when failing to parse command line arguments
to help identify failing line in batch mode.
Thanks,
Serhii
Serhey Popovych (7):
utils: Introduce and use nodev() helper routine
iplink: Correctly report error when network device isn't found
iplink: Use "dev" and
ed for ip link delete scenario
(actually "index" being ignored in favor to "dev").
Prohibit "index" when configuring/deleting group of network devices.
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
d
and returns -1 to it's caller. Either call exit()
or return to the caller to preserve behaviour before change.
Use -nodev() in traffic control (tc) code to return 1.
Simplify expression for checking for argument being 0/NULL in @if
statement.
Signed-off-by: Serhey Popovych
---
bridge/
David Ahern wrote:
> On 2/20/18 1:17 PM, Serhey Popovych wrote:
>> Stephen Hemminger wrote:
>>> On Tue, 20 Feb 2018 21:39:51 +0200
>>> Serhey Popovych wrote:
>>>
>>>> Signed-off-by: Serhey Popovych
>>>> ---
>>>> ip/iplink.
Stephen Hemminger wrote:
> On Tue, 20 Feb 2018 21:39:51 +0200
> Serhey Popovych wrote:
>
>> Signed-off-by: Serhey Popovych
>> ---
>> ip/iplink.c | 12 ++--
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/ip/iplink.c b
Petr Machata wrote:
> For IP-in-IP tunnels, one can specify the [no]allow-localremote command
> when configuring a device. Under the hood, this flips the
> IP6_TNL_F_ALLOW_LOCAL_REMOTE flag on the netdevice. However, ip6gretap
> and ip6erspan devices, where the flag is also relevant, are not IP-in-
t
found) for this.
Use exit(-nodev()) in has_dev() instead of return since missarg() will
call exit() and thus requires change.
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 16 +---
ip/iplink_xdp.c |7 +--
2 files changed, 14 insertions(+), 9 deletions(-)
diff --gi
and returns -1 to it's caller.
Return to the caller instead of exit(-1) in tunnel code.
Use -nodev() in traffic control (tc) code to return 1.
Simplify expression for checking for argument being 0/NULL in @if
statement.
Signed-off-by: Serhey Popovych
---
bridge/fdb.c |
off-by: Serhey Popovych
---
ip/ip_common.h | 16 +---
ip/iplink.c | 34 ++
ip/iplink_bond.c |4 +++-
ip/iplink_bond_slave.c |4 +++-
ip/iplink_bridge.c |4 +++-
ip/iplink_bridge_slave.c |4 +++-
structure as now ->ifi_index is set inside
iplist_parse(). Using memcpy() with constant length inlined by compiler.
Drop @link, @group and @index from iplink_parse() parameters list: they
are not needed outside.
Signed-off-by: Serhey Popovych
---
ip/ip_common.h|3 +-
ip/iplink.c |
tility
behaviour on link create:
ip link add {name|dev} veth1a type veth peer {name|dev} veth1b
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 34 ++
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index 74c377c..a2c8108 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -653,7 +653,7 @@ int iplink_parse(int argc, char **argv, struct
ed for ip link delete scenario
(actually "index" being ignored in favor to "dev").
Prohibit "index" when configuring/deleting group of network devices.
Signed-off-by: Serhey Popovych
---
ip/iplink.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
d
This will consolidate data and code using it in single place and prepare
for upcoming ->parse_opt() method change.
Signed-off-by: Serhey Popovych
---
ip/link_gre.c| 32
ip/link_gre6.c | 32
ip/link_ip6tnl.c |
nks,
Serhii
Serhey Popovych (8):
iplink: Return from function instead of calling exit()
utils: Introduce and use nodev() helper routine
iplink: Correctly report error when network device isn't found
iplink: Use "dev" and "name" parameters interchangeable when possible
Stephen Hemminger wrote:
> Make bridge work like other iproute2 commands with standard -j and -p
> flags.
>
> Signed-off-by: Stephen Hemminger
> ---
> bridge/br_common.h | 3 ++-
> bridge/bridge.c| 9 ++---
> bridge/fdb.c | 10 ++
> bridge/mdb.c | 12 ++--
>
Sabrina Dubroca wrote:
> Signed-off-by: Sabrina Dubroca
> Reviewed-by: Stefano Brivio
> ---
>
> I included the uapi changes from the kernel patch. Let me know if I
> need to resend without the header changes.
>
> include/uapi/linux/if_link.h | 18 ++
> ip/iptuntap.c| 85
David Ahern wrote:
> On 2/15/18 2:23 PM, Serhey Popovych wrote:
>> With this series I propose to make print_linkinfo_brief() static in
>> favor of print_linkinfo() as single point for linkinfo printing.
>>
>
> ...
>
>>
>> Thanks,
>> Serhii
>
David Ahern wrote:
> On 2/15/18 11:34 AM, Serhey Popovych wrote:
>> Be consistent in handling of IFLA_IFNAME attribute in all places: if
>> there is no attribute report bug to stderr and use ll_idx_n2a() as
>> last measure to get name in "if%u" format instead of
Simplify calling code in ipaddr_list_flush_or_save() by introducing
intermediate variable of @struct nlmsghdr, drop duplicated code:
print_linkinfo_brief() never returns values other than <= 0 so we can
move print_selected_addrinfo() outside of each block.
Signed-off-by: Serhey Popovych
---
second for filter.label being
non NULL.
This allows us to further simplify down code and prepare for
ll_idx_n2a() replacement with ll_index_to_name() without 80 columns
checkpatch notice.
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c | 57 +++--
ouldn't be considered
3) replace open coded access to IFLA_IFNAME attribute data by
RTA_DATA() with rta_getattr_str()
4) simplify ifname printing since name is never NULL, thanks to (2).
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c | 30 +-
1 f
.
Tested using make clean && make -j4. No problems so far.
Signed-off-by: Serhey Popovych
---
Makefile |2 +-
lib/Makefile |4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 32587db..b526d3b 100644
--- a/Makefile
+++ b/Makefile
ther code (e.g.
ll_name_to_index() and ll_index_to_name()) supporting such template.
Signed-off-by: Serhey Popovych
---
bridge/link.c | 13 +++--
include/utils.h |4
ip/ipaddress.c | 44 ++--
lib/util
greather than zero.
Also introduce ll_idx_n2a() conterpart: ll_idx_a2n() that is used
to translate name of the "if%u" form to index using sscanf().
Signed-off-by: Serhey Popovych
---
include/ll_map.h |4 +++-
lib/ll_map.c | 31 +--
2 files chan
turn from kernel and ll_idx_n2a().
Signed-off-by: Serhey Popovych
---
bridge/link.c |8
include/utils.h |1 +
ip/ipaddress.c | 20
lib/utils.c | 19 +++
4 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/bridge/link.c b
lp compiler optimize
exit for both print_linkinfo_brief() and normal paths.
Signed-off-by: Serhey Popovych
---
ip/ip_common.h |2 --
ip/ipaddress.c | 76
ip/iplink.c|5 +---
3 files changed, 11 insertions(+), 72 deletions
ts to support
attribute parse that finally will be used to simplify ip/tunnel
RTM_GETLINK code.
As always reviews, comments, suggestions and criticism is welcome.
v5
Fix build failures caused by incorrect dependency: libnetlink.a does
not depend on ll_map.o, instead ll_map.o depends on it.
v4
There is no reentrancy as well as deferred result usage for all cases
where ll_idx_n2a() being used: it is safe to use ll_index_to_name() that
internally calls ll_idx_n2a() with static buffer to hold result.
While there print master network device name using correct color.
Signed-off-by: Serhey
o support
attribute parse that finally will be used to simplify ip/tunnel
RTM_GETLINK code.
As always reviews, comments, suggestions and criticism is welcome.
v4
Print master network device name using correct color.
v3
Fixed subject line.
v2
Rebased to current iproute2-next/master. N
There is no reentrancy as well as deferred result usage for all cases
where ll_idx_n2a() being used: it is safe to use ll_index_to_name() that
internally calls ll_idx_n2a() with static buffer to hold result.
While there print master network device name using correct color.
Signed-off-by: Serhey
Neither internal libnetlink nor libgenl depends on ll_map.o: prepare for
upcoming changes that brings much more cleaner dependency between
utils.o and ll_map.o.
Signed-off-by: Serhey Popovych
---
lib/Makefile |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib
greather than zero.
Also introduce ll_idx_n2a() conterpart: ll_idx_a2n() that is used
to translate name of the "if%u" form to index using sscanf().
Signed-off-by: Serhey Popovych
---
include/ll_map.h |4 +++-
lib/ll_map.c | 31 +--
2 files chan
Simplify calling code in ipaddr_list_flush_or_save() by introducing
intermediate variable of @struct nlmsghdr, drop duplicated code:
print_linkinfo_brief() never returns values other than <= 0 so we can
move print_selected_addrinfo() outside of each block.
Signed-off-by: Serhey Popovych
---
turn from kernel and ll_idx_n2a().
Signed-off-by: Serhey Popovych
---
bridge/link.c |8
include/utils.h |1 +
ip/ipaddress.c | 20
lib/utils.c | 19 +++
4 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/bridge/link.c b
second for filter.label being
non NULL.
This allows us to further simplify down code and prepare for
ll_idx_n2a() replacement with ll_index_to_name() without 80 columns
checkpatch notice.
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c | 57 +++--
ther code (e.g.
ll_name_to_index() and ll_index_to_name()) supporting such template.
Signed-off-by: Serhey Popovych
---
bridge/link.c | 13 +++--
include/utils.h |4
ip/ipaddress.c | 44 ++--
lib/util
ouldn't be considered
3) replace open coded access to IFLA_IFNAME attribute data by
RTA_DATA() with rta_getattr_str()
4) simplify ifname printing since name is never NULL, thanks to (2).
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c | 30 +-
1 f
lp compiler optimize
exit for both print_linkinfo_brief() and normal paths.
Signed-off-by: Serhey Popovych
---
ip/ip_common.h |2 --
ip/ipaddress.c | 76
ip/iplink.c|5 +---
3 files changed, 11 insertions(+), 72 deletions
y both support
JSON output and thus depend show_pretty in new_json_obj().
Assuming above use common variable to represent -pretty option, define
it in utils.c and declare in utils.h that is commonly used. Replace
show_pretty with pretty.
Fixes: a233caa0aaee ("json: make pretty printing option
David Ahern wrote:
> On 2/14/18 1:09 PM, Serhey Popovych wrote:
>
>>
>> Any comments on this series? Should I perform some additional testing?
>>
>>
>
> I thought I had applied them. Can you re-send and cc me?
>
Done. v2 is broken due to missing subje
turn from kernel and ll_idx_n2a().
Signed-off-by: Serhey Popovych
---
bridge/link.c |8
include/utils.h |1 +
ip/ipaddress.c | 20
lib/utils.c | 19 +++
4 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/bridge/link.c b
Simplify calling code in ipaddr_list_flush_or_save() by introducing
intermediate variable of @struct nlmsghdr, drop duplicated code:
print_linkinfo_brief() never returns values other than <= 0 so we can
move print_selected_addrinfo() outside of each block.
Signed-off-by: Serhey Popovych
---
greather than zero.
Also introduce ll_idx_n2a() conterpart: ll_idx_a2n() that is used
to translate name of the "if%u" form to index using sscanf().
Signed-off-by: Serhey Popovych
---
include/ll_map.h |4 +++-
lib/ll_map.c | 31 +--
2 files chan
ther code (e.g.
ll_name_to_index() and ll_index_to_name()) supporting such template.
Signed-off-by: Serhey Popovych
---
bridge/link.c | 13 +++--
include/utils.h |4
ip/ipaddress.c | 44 ++--
lib/util
There is no reentrancy as well as deferred result usage for all cases
where ll_idx_n2a() being used: it is safe to use ll_index_to_name() that
internally calls ll_idx_n2a() with static buffer to hold result.
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c | 14 +-
1 file changed
Neither internal libnetlink nor libgenl depends on ll_map.o: prepare for
upcoming changes that brings much more cleaner dependency between
utils.o and ll_map.o.
Signed-off-by: Serhey Popovych
---
lib/Makefile |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib
support
attribute parse that finally will be used to simplify ip/tunnel
RTM_GETLINK code.
As always reviews, comments, suggestions and criticism is welcome.
v3
Fixed subject line.
v2
Rebased to current iproute2-next/master. No changes.
Thanks,
Serhii
Serhey Popovych (9):
ipaddres
lp compiler optimize
exit for both print_linkinfo_brief() and normal paths.
Signed-off-by: Serhey Popovych
---
ip/ip_common.h |2 --
ip/ipaddress.c | 76
ip/iplink.c|5 +---
3 files changed, 11 insertions(+), 72 deletions
second for filter.label being
non NULL.
This allows us to further simplify down code and prepare for
ll_idx_n2a() replacement with ll_index_to_name() without 80 columns
checkpatch notice.
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c | 57 +++--
ouldn't be considered
3) replace open coded access to IFLA_IFNAME attribute data by
RTA_DATA() with rta_getattr_str()
4) simplify ifname printing since name is never NULL, thanks to (2).
Signed-off-by: Serhey Popovych
---
ip/ipaddress.c | 30 +-
1 f
ted by the series.
>
> All this work is done in prepare of iplink_get() enhancements to support
> attribute parse that finally will be used to simplify ip/tunnel
> RTM_GETLINK code.
>
> As always reviews, comments, suggestions and criticism is welcome.
>
> v2
>
1 - 100 of 379 matches
Mail list logo