diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2020-06-16 20:12:42 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-26 18:26:49 +0100 |
commit | 00babfd5869087ca3167f6c0c58ef0a37228ee06 (patch) | |
tree | 2c380242d2b026603ddca44ce1648ad6724dd71f /meta/recipes-extended/findutils | |
parent | 0ebc923317c5ba9dd4b4ba31306a48025da7dfb9 (diff) | |
download | poky-00babfd5869087ca3167f6c0c58ef0a37228ee06.tar.gz |
net-tools: backport a patch from upstream to use the same ifconfig format as debian/ubuntu
* this is needed for python3-ifcfg to parse it correctly
https://github.com/ftao/python-ifcfg/issues/43
* backport this single patch, so it can be backported to dunfell
then for master we should upgrade to new snapshot from debian
which includes other fixes and improvements as well
* this is already part of net-tools_1.60-26.diff from debian we're using
but it's first added there and then removed
$ grep 'sprintf(flags' net-tools_1.60-26.diff
++ sprintf(flags, "flags=%d<", ptr->flags);
+- sprintf(flags, "flags=%d<", ptr->flags);
* before:
root@qemux86-64:~# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:02
inet addr:192.168.7.2 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe12:3402/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:496 (496.0 B) TX bytes:42832 (41.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:846 errors:0 dropped:0 overruns:0 frame:0
TX packets:846 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:53364 (52.1 KiB) TX bytes:53364 (52.1 KiB)
* after:
root@qemux86-64:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 metric 1
inet 192.168.7.2 netmask 255.255.255.0 broadcast 192.168.7.255
inet6 fe80::5054:ff:fe12:3402 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:12:34:02 txqueuelen 1000 (Ethernet)
RX packets 6 bytes 496 (496.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 14 bytes 2140 (2.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 metric 1
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 80 bytes 6080 (5.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 80 bytes 6080 (5.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
* for comparison ubuntu-20.04 in docker:
root@dafcbbf25ff2:/# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet)
RX packets 39299 bytes 89614740 (89.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33767 bytes 3807354 (3.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 5658 bytes 1294220 (1.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5658 bytes 1294220 (1.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
* python3-ifcfg now parses flags correctly:
root@qemux86-64:~# python3 -m ifcfg.cli | python3 -m json.tool
{
"eth0": {
"inet": "192.168.7.2",
"inet4": [
"192.168.7.2"
],
"ether": "52:54:00:12:34:02",
"inet6": [
"fe80::5054:ff:fe12:3402"
],
"netmask": "255.255.255.0",
"device": "eth0",
"flags": "4163<UP,BROADCAST,RUNNING,MULTICAST> ",
"mtu": "1500",
"broadcast": "192.168.7.255"
},
"lo": {
"inet": "127.0.0.1",
"inet4": [
"127.0.0.1"
],
"ether": null,
"inet6": [
"::1"
],
"netmask": "255.0.0.0",
"device": "lo",
"flags": "73<UP,LOOPBACK,RUNNING> ",
"mtu": "65536"
},
"sit0": {
"inet": null,
"inet4": [],
"ether": null,
"inet6": [],
"netmask": null,
"device": "sit0",
"flags": "128<NOARP> ",
"mtu": "1480"
}
}
(From OE-Core rev: 71c8667fca681a5977ed2b825b14306930707f2d)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit dacfd695061b186240a85f8ffc43e6636c56e1fb)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/findutils')
0 files changed, 0 insertions, 0 deletions