summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2020-07-22 22:02:22 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-25 15:11:05 +0100
commitbd7521568f9cec77202cd86e9fc29efe5c3db2d3 (patch)
tree4e49b151aa374479fbced86ef0b8764c24fb6386 /meta
parent23deb29c1b61ca9ef04b47dd27b9a8a126ad3d8d (diff)
downloadpoky-bd7521568f9cec77202cd86e9fc29efe5c3db2d3.tar.gz
net-tools: upgrade to latest revision in upstream repo instead of old debian snapshot
* debian switched to upstream snapshot as well in 2015: net-tools (1.60+git20150829.73cef8a-1) unstable; urgency=medium * After 14 years without an upstream release, I am producing a new package based on today's upstream repository. Closes: #391495, #486448, #323261, #260587, #545328, #511395. * Remove many patches now merged upstream, delete unmaintainable and undocumented local changes, and update the rest. -- Martín Ferrari <tincho@debian.org> Mon, 07 Sep 2015 01:54:07 +0000 * this allows dropping nettools_do_patch task and other weird parts of the recipe * LIC_FILES_CHKSUM change is caused by formatting changes in: d613e1d Updated COPYING file. * patches now included in upstream: 0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch eb04ef3 added 'ull' prefix to unsigned long long constants to make gcc 3.3 happy ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch 81814dc ifconfig interface:0 del <IP> will remove the aliased IP on IA64 musl-fixes.patch (only lib/inet_sr.c and netstat.c chunks weren't applied, but maybe not needed anymore) 86b2c77 Remove support for IPV6 with libc5 and glibc 2.0 ecae4b3 lib/util-ank: Include <limits.h> for UINT_MAX c35607e Remove inconsistent conditional includes for libc5 and glibc 2.0 net-tools-1.60-sctp1.patch net-tools-1.60-sctp2-quiet.patch net-tools-1.60-sctp3-addrs.patch 7af4859 netstat: update SCTP support 3bbfa09 statistics: add SCTP support 4932915 Add netstat -S/--sctp parameter into help and manpages 8306063 netstat: add sctp connection decoding (Debian #306428 and Gentoo #258714) 0001-lib-inet6.c-INET6_rresolve-various-fixes.patch a70c568 lib/inet6.c:INET6_rresolve() - various fixes net-tools-fix-building-with-linux-4.8.patch ea3935b iptunnel: fix building w/older linux headers 45d573a iptunnel: drop netinet/ip.h include * add 3 new patches from debian * add PACKAGECONFIG for parts which are now optional since: https://salsa.debian.org/debian/net-tools/-/commit/939123848205c8745542c2052b2c53de49461f4b https://salsa.debian.org/debian/net-tools/-/commit/fbc11bb9cfb5acb4b3c3b24a57c02f2b2338c656 https://salsa.debian.org/debian/net-tools/-/commit/bd8bceaed2311651710331a7f8990c3e31be9840 but unlike debian, keep building them to limit the changes from this upgrade * ifconfig and route were moved from sbin to bin adjust u-a accordingly * debian changelog: net-tools (1.60+git20180626.aebd88e-1) unstable; urgency=medium * New upstream snapshot * Refresh patches. * Fix typos in German manpages. Thanks to Prof. Dr. Steffen Wendzel and Dr. Tobias Quathamer for the patch. Closes: #900962. -- Martín Ferrari <tincho@debian.org> Mon, 24 Sep 2018 19:08:57 +0000 net-tools (1.60+git20161116.90da8a0-4) unstable; urgency=medium * Update maintainer email address. Closes: #899617. * Update Standards-Version with no changes. -- Martín Ferrari <tincho@debian.org> Mon, 24 Sep 2018 17:16:31 +0000 net-tools (1.60+git20161116.90da8a0-3) unstable; urgency=medium * debian/control: Update Vcs-* and Standards-Version. * debian/control: remove references to ancient package ja-trans. * debian/gbp.conf: Update repo layout. -- Martín Ferrari <tincho@debian.org> Tue, 31 Jul 2018 19:09:00 +0000 net-tools (1.60+git20161116.90da8a0-2) unstable; urgency=medium * Fix typo in French manpage. Thanks to Michel Grigaut for the patch. * Add manpage for iptunnel, thanks to Sergio Durigan Junior. Closes: #88910 * Rename patches so CME does not choke on them. * Automated cme fixes; packaging improvements. * Remove unused and ancient patch. -- Martín Ferrari <tincho@debian.org> Sun, 11 Feb 2018 17:29:24 +0000 net-tools (1.60+git20161116.90da8a0-1) unstable; urgency=medium * New upstream snapshot. * Re-synced translations.patch. * Acknowledge NMUs. Thanks a lot to Andrey Rahmatullin for the fixes and uploads. Closes: 846509. * Fix FTCBFS, thanks to Helmut Grohne for the patch. Closes: #811561. + Really assign CC for cross compilation. + Use triplet prefixed pkg-config. * Add debian/NEWS warning about changing output in net-tools commands. Closing bugs that reported problems in 3rd-party scripts arising from these changes. Closes: #845153, #843892, #820212. * Update Standards-Version, with no changes. -- Martín Ferrari <tincho@debian.org> Mon, 26 Dec 2016 05:58:42 +0000 net-tools (1.60+git20150829.73cef8a-2.2) unstable; urgency=medium * Non-maintainer upload. * Apply an additional fix for the previous FTBFS for some architectures. -- Andrey Rahmatullin <wrar@debian.org> Thu, 01 Dec 2016 22:49:27 +0500 net-tools (1.60+git20150829.73cef8a-2.1) unstable; urgency=medium * Non-maintainer upload. * Fix FTBFS by applying the upstream patch (Closes: #844073). -- Andrey Rahmatullin <wrar@debian.org> Sun, 20 Nov 2016 15:23:12 +0500 net-tools (1.60+git20150829.73cef8a-2) unstable; urgency=medium [ Laurent Bigonville ] * Enable SELinux support. Closes: #666204. [ Martín Ferrari ] * Mark the package "Multi-Arch: foreign", thanks to Frédéric Brière <fbriere@fbriere.net>. Closes: #752584. * Fix bug in Portuguese man page, thanks to julianofischer@gmail.com. Closes: #805377. -- Martín Ferrari <tincho@debian.org> Thu, 19 Nov 2015 14:48:47 +0000 net-tools (1.60+git20150829.73cef8a-1) unstable; urgency=medium * After 14 years without an upstream release, I am producing a new package based on today's upstream repository. Closes: #391495, #486448, #323261, #260587, #545328, #511395. * Remove many patches now merged upstream, delete unmaintainable and undocumented local changes, and update the rest. -- Martín Ferrari <tincho@debian.org> Mon, 07 Sep 2015 01:54:07 +0000 net-tools (1.60-27) unstable; urgency=medium * Add patch to accept "pointtopoint" as a synonym for "pointopoint". Closes: #443075. * Add patch to add an example for single route deletion in route.8. Closes: #500913. * Remove Luk from Uploaders as per his request. Closes: #748491. * Fix broken watchfile, thanks to Martin Bagge for the patch. Fix upstream homepage. Closes: #770070. * Add patch to make mii-tool scan all ethernet devices instead of eth[0-7]. Closes: #532879, #319508. * Add Vcs fields. * Update build system to debhelper 9 and 3.0 source format. * Update ancient Standards-Version, no changes needed. -- Martín Ferrari <tincho@debian.org> Sun, 06 Sep 2015 17:44:11 +0300 * upstream changelog: git log --oneline v1.60..0eebece8c9 0eebece Spell checking for German netstat manpage (#9) aebd88e standardize --help/usage handling c360845 always write --version output to stdout 479bb4a Fix incorrect ARP output b4f5182 Fix conversion of some ROSE addresses. 8076533 Update all instances of my email address. bfbadfc AX.25: Rename all references to axattach to kissattach. 90da8a0 netstat: improve ROSE support aab9274 build: respect standard $(LDLIBS) variable ea3935b iptunnel: fix building w/older linux headers 45d573a iptunnel: drop netinet/ip.h include 115f1af Fixed trailing whitespace issue with a and i flags (#7) bd8bcea slattach/plipconfig: add a config knob to control them 9391238 hostname: add a config knob to control build/install fbc11bb arp/rarp: add a config knob to control them 2cc98e1 man: do not install pages for disabled commands 5bf8112 man: improve install e1ce942 ifconfig: do not try to bring up interfaces implicitly w/IPv4 0.0.0.0 2529b5d ifconfig(8): document - suffix behavior w/alias interfaces 3f170bf netstat: increase address buffers to avoid and overflow 1cec84c route(8): fix typo in fr_FR page 452f8e2 hostname: -s: do not look up details via dns 8e9db22 po: delete duplicate translations 614e15d statistics: fix multiple typos in strings 5c9e1e7 use sockaddr_storage everywhere 27e4308 netstat: convert to sockaddr_storage adf6f57 netstat: unrecognized option -> non-zero exit code 73cef8a statistics: use getline instead of fgets d923212 statistics: optimize filter processing slightly 238f086 ipx: always byte swap fields 7af4859 netstat: update SCTP support 3bbfa09 statistics: add SCTP support 9c073fe statistics: sort tables statically (and constify) 70c3a90 statistics: constify tables c58d03b statistics: constify strings 9c4b23a statistics: localize all vars/funcs b2f0f02 statistics: delete dead code 6556c27 build: use -- with rm c5a91aa lib: inet6: clean up INET6_print a bit fd10bbe lib: inet6: mark fix_v4_address static/const c17ec95 lib: frame: avoid casting char* to short* b10a1c0 lib: inet: switch to inet_ntop 16a83b4 lib: masq_info: check fgets return value df48bbe lib: masq_info: use stdlib.h instead of malloc.h 839f760 lib: masq_info: fix scanf addr loading on 64bit systems 2a0cd06 lib: af: constify sprint sockaddr bcc7d40 hostname: unify IPv4/IPv6 codepaths 742e628 lib: hw: constify hwtype a6118de lib: af: constify aftype 2e15dac lib: af/hw: constify name fields 738c834 lib: af: constify herror message 61077c3 lib: af/hw: localize init functions cf32e54 lib: af: get_socket_for_af: re-use get_afntype 86b2c77 Remove support for IPV6 with libc5 and glibc 2.0 c35607e Remove inconsistent conditional includes for libc5 and glibc 2.0 92773ed Add utility function ticks_per_second() to get jiffies per second (aka HZ) 9bdfd2c build: turn on transparent LFS support 43efbf2 Disable Econet support by default since it is removed from Linux 3.5 ecae4b3 lib/util-ank: Include <limits.h> for UINT_MAX 69e6463 netstat: fix up Bluetooth error messages 761da2d netstat: support Linux v4.0 debug/bluetooth/l2cap e5f1be1 ifconfig can incorrectly round PiB 25b3c9a netstat: INFO_GUTS1(): don't treat EACCES as error 24cd6f2 Revert "fix statistics with aliased interfaces" 4e499e2 netstat(8): fix style in a few places 2dd754e netstat: do not abort/warn with unsupported protocols using general -A buckets 343192d fix statistics with aliased interfaces 96225a6 netstat: decode timer type of 4 in tcp lines 6ab465c interface: localize & constify funcs 1fbf057 netstat.8: bump date 6b79232 Thanks: Lubomir 34ea18c netstat: Fix short options for --l2cap and --rfcomm 2246c64 pathnames: Bluetooth stuff is now in debugfs b2a5d59 man: Document Bluetooth options 4321146 Fix typo in license notice. 80ac2bb First version of a contributors acknowledgement (to clean up file headers) d621c2e [Bug#22] Return non-zero exit code if route arguments fail verification (CEM@sf.net) 038ed39 mii-tool: apply -p to -w 68a4d78 fix default for inet4 (0) and pointer to ip(8) a3cab50 Documented metric defaults, made markup of keywords/variables more consistent. b2f92c3 Fix unsigned sscanf format 4932915 Add netstat -S/--sctp parameter into help and manpages 47b8bce netstat.c: fix typo in error message 3eb367a Fix serveral strings in de/fr/pt_BR.po 12f5a0c Fix nstrcmp() to prevent ifconfig from showing duplicate interfaces. f919c51 Makefile: add BINDIR & SBINDIR variables 08abda6 add const qualifier to fix compile warning about xstrdup argument 2356964 rprint_fib6() was passing 1 instead of 'numeric' into INET6_sprint() a70c568 lib/inet6.c:INET6_rresolve() - various fixes a753a90 lib/util.c: introduxe xstrdup which catches NULL and use it in all places e8510bc lib/inet.c: replace safe_strcpy with strdup for dynamically allocated cache, fixes truncation c0d4640 Show symbolic default only for 0.0.0.0/0 (which fixes Suse Bug#821077) 0348310 lib/x25.c: fix compile error for -DDEBUG=1 2466c75 hostname: modernized man page 8f124a7 hostname: do not mention root on permission problems. Thanks to Elias Probst for mentioning the problem. e569425 merged: replace all remaining strcpy() with safe_strncpy() d5d5db4 route: document -4 and -6 for route command cb15dc2 fix issues caused by replaceing strcpy() with safe_strncpy() 604785a replace all remaining strcpy() with safe_strncpy() dc752cc Merge pull request #1 from florianl/master 3a2961d Fix calculation of available space 3da9774 [PATCH] replace strcpy() with safe_strncpy() 6a14c03 slattach: tweak how we ignore the ret of fchown() d87ceba ifconfig: use sockaddr_storage to hold addresses 911ccc4 ifconfig: use in_addr_t for IPv4 types d1381f9 trim trailing whitespace 35eaa82 Make SELINUX compile. 266c140 get selinux build info via pkg-config 4953812 ignore gdb related files 4fa4939 fix building with selinux enabled 70953e9 use CFLAGS when linking too 56a8434 Man page syntax fixes. 7cf048d Rémi Verschelde contributed french translation if ifconfig(8). https://sourceforge.net/p/net-tools/bugs/6/ 36bd859 deal with 2-digits kernel versions as reported in Bug#7. https://sourceforge.net/p/net-tools/bugs/7/ e816552 Minor mostly comments typo fixes 3d31cea Use safe_strncpy wherever possible 60674bc updated manpage date, project url and email adee8b7 mii-tool: dump also non standard registers 784f0af mii-tool: update manpage and usage b30cd20 mii-tool: update PHY list 2370ab1 mii-tool: fix PHY ID in list 343864a Potential buffer overflow if kernel is missbehaved removed, reported by Adien Bustany 8b1ccd3 Merge branch 'master' of ssh://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools 0727f6e Removed per-file version number ded9e77 Removed per-file version number a773411 Merge branch 'master' of ssh://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools 4ee5ca4 Bump Version to 2.10 to be compatible with ubuntu ae6e4a3 fix typo in statistics.c 4aa89e8 Bump to 1.70-alpha version and switch to net-tools-devel@lists.sourceforge.net as maintainer 339c720 mii-tool.c: increase buf size in show_basic_mii() 7e91281 netstat: check fstat's return value 8217b88 Some more fixes for german arp.8 d34e8f2 Use groff umlaut 868b18e Remove trailing linefeeds from arp.8 man pages 5333f7f arp(8): German translation updated + corrected, en: missing ) added 2bbc0ab arp(8): part of a sentence was missing 293bec6 update the dist target and add a distcheck target 70f4818 disable old features by default 8a77011 slattach: pass up exit status of shell command 77d0c1b Deprecated netstat, made usage with --inet/--inet6 clear. 6970e0b Minor cleanup of netstat usage() 01b8da0 Removed code duplication (Sourceforege#3567952 reported by hugh redelmeier) e8b37a8 netstat memory leak fixed. 992a1de iptunnel.c: avoid fd leak in case of ioctl() error 53c4017 use scanf("%ms") instead of scanf("%as") for dynamic string 699e5db Consistently use defined exit codes. 6d09cad arp(8): fixed one more typo (simplyfy -> simplify) 776c653 arp(8): fixed typo (priveledge -> privilege) b8cd80d Fixed 2 SELinux related compiler warnings. a1de647 Removed SET and GET of interface metrics 5fac037 ifconfig(8): fix tunnel option syntax 6f050f1 infiniband: fix up new warning message 7182584 Make netstat -h and -V honor HAVE_SELINUX 4c91a43 removed unused variable 8509a38 new option for nestat, -Z shows SELinux context 064568d Make the code style consistent across netstat.c aa01f8c man/de_DE/arp.8 fix translation (RHBZ#322901) 1e787c3 man/pt_BR/ifconfig.8: remove untranslated paragraph 653fd7c route(8): note that 'route mss' actually sets MTU (RHBZ#680837) a4cbb77 ifconfig(8): note about supported format for IPv4 addresses (RHBZ#176661) cb81887 ifconfig(8), netstat(8): mention iptables instead of ipchains, ipfwadm or ipfw. 4838db1 ifconfig(8): do not mention /proc/net/socket (RHBZ#661905) 5f5f16d Warn about changed encoding of man pages 6f5c897 Convert latin1 characters to UTF-8 1b74c24 inform user that ifconfig can correctly show only first 8 bytes of Infiniband hw address 9dc3a20 mii-tool: don't rely on eth0 being default network device name. faf31f8 mii-tool: use <linux/mii.h> instead of "mii.h" and fix RHBZ #491358 6ccabd5 Possible problems found by static analysis of code. 0dcd1d1 plipconfig man page and usage output fixes 81814dc ifconfig interface:0 del <IP> will remove the aliased IP on IA64 796ba7f prevent 'netstat -nr -A inet6' from smashing stack (RHBZ #668047) 7b57688 fixed clearing flags in ifconfig (RHBZ #450252) 1f2c75d nameif crash for long interface names (RHBZ #209120) cf33780 in kernel 2.6 /proc/net/x25_routes moves to /proc/net/x25/route 96b25f1 buffer overflow in arp (RHBZ #164695) f1f8932 netstat -s reports negative octet counts c8d4f43 The return value of nameif was wrong 81d60e0 Fix Content-Type in po files to avoid msgfmt warning. ca5633d Updated README to reflect move to SourceForge.net d613e1d Updated COPYING file. 98e1d90 mii-tool: fix inverted advertising/link features 0f65cdc slattach: man page documents /dev/ptmx support 4615091 slattach: add support for /dev/ptmx [Bug:3467521] aa6c885 Merge branch 'master' of ssh://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools 3642531 Bluetooth name fix f6baf95 Add Bluetooth socket support 36b541c ifconfig/route: move to /bin ca46fb1 ignore return value of fgets calls we dont care about 153ab83 hostname: check return value of getdomainname 9cd07a6 netstat: unify duplicate addr pretty printing 9eba397 fix integer/pointer cast warnings c5e8dfb fix "format not a string literal" warnings 4d721ae fix up signed/unsigned warnings 46cd57a fix up unused variable warnings 243cd05 pull in stdlib.h for malloc() prototype 97b31ce clean up const/unsigned pointers with aftype/hwtype structs 7ae4aa5 get_sname: avoid buffer overflows if proto name is too long 6a9347c get_sname: unify numeric handling 2b4f34b get_sname: constify args/return when possible 5888d1b fix path to net-features.h 11310f8 patch from Bert Wesarg to separate basename of -p only if it is absulote path (in order to make argv[0]="sshd pty/0" display as sshd, and not as /0. 491cedb netstat: split host resolution out from --numeric-ports 74b2b54 netstat: fix handling of large socket numbers 8022436 hostname: fix FQDN handling with AAAA records 1dd95c5 corrected indention c4b18d3 added some address family alias (still needs description) Bug#017886 Reported by Toralf c65379a Bug #17812 Fix the handling of some of the HAVE_* flags ifdef vs if. --jpa468 1791685 [Bug #17645] Add netstat(8) support for RcvbufErrors, SndbufErrors. Thanks jwm afb24b5 netstat: include sys/stat.h for S_ISREG macros 63582c8 Remove garbage ipv6 scopes in netstat output (Debian Bug #508110) Thanks Marco Steinacher for reporting. 60d538d netstat: PIDs can be long, Bug #199702 of Ubuntu Launchpad, Bug #16913 of Berlios 74f98bb interface: fix IPv6 parsing of interfaces with large indexes (> 255) 8003503 po/man: if LINGUAS is set, only install translations for those langs 0b2d037 improve dist target: include compiled gettext files, exclude scm files, and always prefix the paths in the tarball with the full versioned name 6c6e701 ignore generated gettext files 8c3c91f set BASEDIR to DESTDIR by default so the default install matches most packages 93f5da4 fix parallel build problems with the lib/ subdir and multiple targets that descend into it 043b0fa netstat: fix %*s handling -- the field takes an int, not a size_t 592e3a3 interface slip: cast keepalive/outfill to unsigned long to fix warnings on 64bit hosts -- no functional changes since these only have an 8bit range anyways 5edf1a4 ignore patch related files 8306063 netstat: add sctp connection decoding (Debian #306428 and Gentoo #258714) 0529337 ifconfig: fix no output when if_readlist_proc() fails d50af4c slattach: use fchown() rather than chown() to avoid race between creation and permission changing d114ba0 enable -fno-strict-aliasing until the code base gets a hefty clean up to fix all of the strict aliasing problems f91f1b0 convert -idirafter to -I fa5eec7 add missing dependency on version.h to libdir target to fix parallel build failures f74e6f4 touch up build system to respect normal toolchain env vars rather than requiring people to set random custom ones 4db8743 handle raw "IP" masqinfo b1c865c move man/fr_FR/*.8 pages into the "administrator" section 2e2ef32 arp: document the existing -e/-t options 15cf547 netstat: fix typo in udp display 9f22441 start a .gitignore 1e4c72b Missing include to make compileable with gcc-4.3.2 and glibc-2.9_p20081201 Patch from Petr Pisar [Berlios Bug#16232]. 0d88998 ignore local .git dir 74f077e Fix for Feature Request from ssb [ Feature Request #4466 ] --continuous should flush stdout 9cfbce3 Czech translation update by petr.pisar@atlas.cz 0540cf6 Avoid name resolution for listening or established sockets (-l) by return fast. Problem reported by Ragnar Hojland Espinosa <ragnar@ragnar-hojland.com> 608b0fd scanf format length fix (non exploitable?) from Fabian Hugelshofer <hugelshofer2006@gmx.ch> 2750e60 -W option bb2e60b new date, reformatted authors section (shorter) 9036cd6 sorted options 91f3c44 UDPlite Support for net-stat by Brian Micek <bmicek@gmail.com> 38720e8 Add wide option to prevent truncating IPv6 addresses b6dabb7 moved H suport for Infiniband to the right section 24f959e Add hardware support for InfiniBand (Debian Bug #294252 Tom Duffy from Sun). 5737940 avoid unused filetype, fix formatting of -p headers 57b70fa conditional printing of values (to support -tuw options for netstat -s) 2e572c2 Support netstat -s with -6tuw options (incl. usage()) 50165b2 Enable netstat -s for IPv6 (Debian Bug #453859 from Varun Chandramohan) 188a83f Avoid segfault of ifconfig(8) on missing /proc/net/dev (Debian Bug #222209 Pierre Lombard, Tollef Fog Heen) 0009712 Fix hypen in man pages (Debian Bug#288343 from Andrew Moise) Move man pages to sysadmin books update samples for route(8) (Debian Bug#400844, #368697 Danny Rathjens) update see also for ifconfig(8) (Debian Bug#365916 Dan Jacobs) 11b7232 fix some more hypens, changed book name and updated date to 2008-10-03 2fd7009 document the additional info in Send-Q/Recv-Q with recent kernels for listening sockets. 3e179eb allow netstat to print Rcv/Snd-Q for TCP_LISTEN (containing accept backlog) 7ac5bd2 Spelling error (Debian Bug #486448 reported by Volker Stolz) bcebe9e fixed interfaceS spelling (Debian Bug #435690). Thanks Alan and Liu Xing. 3eb2013 more backoff 8ccfb33 backoff proc_fopen usage from etherfile. b9963e7 use new page aliged proc_fopen for address families eb21d0e Page aligned fopen buffer 20f0f8e Faster pagesize aligned fopen for netstat -s (Eric Dumazet) 41cae5e Better netstat -s error handling and larger buffers 94fb2fc cleanup man page (arp.8 2007-12-01) c59ba33 ROSE support (not yet enabled) 4193b10 ROSE support f6ec7f0 Fix Formatting Bug for ifconfig.8 (Debian Bug#450432 reported by Ivan Shmakov) a7006fd unneeded %s in translation (Debian Bug #403033) Thanks to Marco Tulio Gontijo e Silva 2af5890 fixed signedness compiler warning 4347ec3 Fixed Debian Bug #392263 reported by Jochen Voss (buffer overflow in dev argument processing) e44dfb3 formatting fixes from Justin Pryzby in Debian Bug #391495 2c5906a GigE Support by Stephen Hemminger from http://developer.osdl.org/shemminger/prototypes/mii-tool.tar.bz2 with verbose register patch from Dean Gaudet b5b6f5b Debian Bug #260587 fixed, make sure the Columns state and user in netstat -t -e are separated by blanks. This may cause scripts to fail parsing by column width. Better wait for the script compatible output. Problems exists for ESTABLIHED state only. 3fecf29 use file version 79143c2 make slattach 3-wire -L mode work (no RTSCTS) (Debian Bug #175743) 2b01211 In order to fix alignment bugs with recent GCCs I have to use sockaddr_storage instead of sockaddr for allocation. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340384 Thanks to Blars Blarson, Jurij Smakov and Steve Langasek 23e6090 X25 code compiles with 2.4 and 2.6 kernel headers (Debian Bug#271678) 464d107 Spelling fix for Debian Bug#326124 reported by A. Costa. c47b0ce added link to berliOS 697cccc Eric Oberlander reported in Debian Bug#323261 that byte counter unit should be named "B" not "b". 3fb20be make ipx in 2.6 work (perhaps). Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=318503 fa7e5f6 minor formatting c1b0c81 added pointer to iptables(8) not only ipchains(8) (Toralf Förster) 5ce2138 make it compile with 2.4 and 2.6 kernel headers (Debian Bug #271678) 501fb48 desupport dontpub in arp.8 and arp -? (Debian Bug #203396) 7762692 updated pot file and use msgmerge instead of tupdate (Debian Bug #271426) b07eb40 token ring patch from http://www.linuxtr.net/download/net-tools-1.60.patch Fixes Debian Bug #79462 d610378 line break fix debian bug #305637 85dad0a spellig fix debian bug #305638 0518929 spelling fix debian bug #305640 d1724c0 little formatting fix f93122d default all options which work with recent systems to on d42c104 debians version of nstrcmp - ugly but works a859bcb merged debian patch to make it compile with new headers 6e5363d avoid namespace conflicts faa3a97 added linebreak to version signature 6ead3cb added diagnostics (closes debian bug #239229: EINVAL for downed interface) b3412aa Typo Fix for german translation of arp po file reported by Christoph Berg (Debian Bug #176151) 321b4af make sure version string is helpful 7dfa4bd patch to recognize more hardware without MII support (from Redhat Bug#77882, notified by Tilmann Bubeck). 2085dd6 fix portability problem on 64-bit big endian. patch from Mads Martin Joergensen <mmj@suse.de> 17948a9 Maik Broemme contributed gcc warning fixes (break after default: label) e02f9d0 fixes for man page bugs reported by Hugh Redelmeier. aac294c Fix off by one in name length checking a1c938f Use new style MII ioctls only. This will give you a warning, if compiled with old kernel source tree. It will also not work if compiled with new source on old kernels. The new ioctls also require root for reading, the old didnt. This fixes Debian bug #133648. No fallback compatibility is included for reasons of cleaner source. 5b24d94 bugfix: Skipping readlist, if readlist_proc sicceeded is not a good idea. I Rewrote that section for clarity. This is also present in the 1.60-8 debian package, which fixed #197582 and #197924. e273e09 make hostname compile warnign free with gcc 3.3 (Ec) eb04ef3 added 'ull' prefix to unsigned long long constants to make gcc 3.3 happy 01c830f added mii-tool as featured tool 04331bd fixed compile warning (unneeded default: label in switch) 1c0f026 fixed wording of binary units counters and interpunctuation in netstat(8) 2868186 make it compile on stricter gcc3.3 408b6dd Fix Debian Bug#178209, Fix RedHat Bug#85748: nameif segfaults 8d55e6f Marc Lehmann pointed out that binary prefixes are made up by the IEEE and are not official SI yet. (Debian Bug #182478) e06fed4 Add text for two new TCP statistics and fix some existing descriptions 651bf19 add a comment about alias interfaces and primary interface of scopes (intended to fix Debian wishlist bug #179780 and normal bug #64458) 4d2084d fixed an logic error in the "not found" handling for deleting entries also added a documentation comment and newer errno values for 2.4 Thanks to niteowl@intrinsity.com for pointing out. fdc9421 use [::]:port as wildcard ipv6 address instead of *:port 9628c3a change confusing "*" into "<from_interface>" cb9aeb9 - change columns of netstat -i/ifconfig -s to avoid run-into (Stefan Illner) - prevent segfault on protocol families without host error member - use /128 as default prefix if not specified instead of /0 88d85a7 Bruno Hall contributed a small and working nstrcmp() 1981012 corrected typo to make lib/interfaces.c actually compile 47af40a better ioctl fallback handling for interface listing, avoids duplicate interfaces, thanks for the help from Bruno Hall. e2bee14 Implemented the Sean Reifenschneider suggested fflush() to the --watch function of mii-tool. bbd4eca route now support -6 -4 or -46 option better layout for ipv6 routing table -C support for ipv6 routing cache more flags (i.e. reject) are recogniced for ipv6 routes 763c110 more stable ipx parsing (no segfault anymore) 0daeffd ethernet mac in lower case hex digits f8f38f3 allow support for -6 and -4 options to netstat, also allow both, and print out tcp6, udp6 or raw6 if it is a v6 socket 8887da0 Jack Bloch noticed that the hw comamnd of ifconfig returns a confusing -EBUSY if interface is up (on lkml). 2ff6edc there is no such thing as -i option for ifconfig removed variable, fixed usage, added options to english man page 15080ea fixing debian bug #151130 reported by Dan Jacobson where netstat was printing 81 chars in a line for tcp, udp and raw. 2c3f73f thanks to "Erik A. Hendriks" <hendriks@lanl.gov> the interface nane bug in debian (#135744) is fixed, with his patch in (#149579) hopefully. 8cd8f53 this fixes segfault on -A "" and -F "" in mii-tool reported in debian bug #139027 7e52da1 simple patch from Ajax <ajax@firest0rm.org> (corrected) to print DDP (AppleTalk) routing table. b03df1a brken buffer for printed irda address, reported by Christoph Bartelmus d807bcb Fix some counter descriptions. add5d92 export procnetdev_version, get_dev_fields, get_name from lib/interface.c for general usage (e.g. in my next patch to iptunnel) 5491f6f make RX-OK and TX-OK col. in "netstat -i" 1 digit longer by left aligning metric and TX-OVR and shorten max length of them. 5b1a3bb fixed typo in german man page and added a comment that man page is currently not completely up-to-date. 453c30f inodes in unix domain sockets are now padded to 8chars (netstat -x) bdb279b fixes debian bug#134600 (sigsegv in netstat on negative inoded in /proc/net/udp) on "netstat -lpu". Thanks to Arnaud Giersch for the report. 4478c3c fixed debian bug#111642 reported by Jonathan Amery <jdamery@pick.ucam.org> (newline missing in nameif usage) 06be6d8 this fixes Debian Bug #109164 (netstat -ci does only print stats once). It also renames add_interface and free_interface list to if_cache_add/free. I am not sure if removing the "proc_read" flag will harm performance, looks likt this check is never triggereed. Anyway, we need more efficient b-search sooner or later. 1aaeb28 fixed minor errors in netstat.8 man page (--numeric-users was missing, some font problems and --interfaces has no <interface> argument (Debian Bug #120475) thanks for the report to Uwe Hermann. 2aea5d6 fixed debian bug#109370 (empty line if baseaddr < 0x100 in ifconfig). Patch by Jonathan Amery <jdamery@pick.ucam.org> 29e4329 added EUI64 Hardware Address Family Daniel Stodden <stodden@in.tum.de> 68ca19b added documentation about SI prefixes for decimal numbers b93fefc added SI unit patch from adam@cfar.umd.edu to output of ifconfig byte counters 811cf0a sscanf pattern is %Lu not %llu for long long unsigned byte counters. This fixes the 0 byte output of ifconfig/netstat -i 017c996 changed troff syntax according to ESR's report 73ff76e fixed troff syntax, as reported by ESR. Did not changed the date of the man page. e1dde4b delay the setting of netmask derived from /mask after setting address (Debian Bug #116573 reported by Brian Warner) 590aeaa minor fix to return E_USAGE on -V instead of exit(0); 234b63a failed to set error flag if netmask setting reported an error (Debian Bug #117837 reported by Sam Clegg) 81f8bc8 (Finally) update netstat -s for 2.4 statistics. d67a12a Only print unknown statistics when their counter is > 0. fb9c5b0 Fix netstat -- don't print all v4 addresses as v4-mapped-in-v6. fc474dc Increase SIOCGIFCONF buffer size faster for many interfaces. c8a6725 Remove Debian-specific path. 03f5eac doh eb7fb72 Fix confusion between bits and bytes c899ac9 made man page more useful and added right link for irq conflicts in ifconfig.8 6a06088 a fix for Debian which can be nicely included upstream (#102139) 866746a man page fix CLOSED -> CLOSE afaea89 this will check after clearing a flag, that it is indeed cleared. it will also be a bit more verbose and precise on errors. See Debian Bug #102474 0284110 fixed CLOSED -> CLOSE in french and english manpage as of bug report from Matthew Tippett 1fa4848 changed a type arp -a now prints PUB instead of PUP for proxy arp entries 643ba69 Update from Meelis Roos (From OE-Core rev: c9caff40ff61c08e24a84922f8d7c8e9cdf8883e) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/net-tools/net-tools/0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch381
-rw-r--r--meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch87
-rw-r--r--meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch15
-rw-r--r--meta/recipes-extended/net-tools/net-tools/Bug_443075-ifconfig.c-pointtopoint_spelling.patch26
-rw-r--r--meta/recipes-extended/net-tools/net-tools/Bug_541172-netstat.c-exit-codes.patch22
-rw-r--r--meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch32
-rw-r--r--meta/recipes-extended/net-tools/net-tools/musl-fixes.patch100
-rw-r--r--meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch635
-rw-r--r--meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch28
-rw-r--r--meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch363
-rw-r--r--meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch52
-rw-r--r--meta/recipes-extended/net-tools/net-tools_1.60-20181103.bb108
-rw-r--r--meta/recipes-extended/net-tools/net-tools_1.60-26.bb132
13 files changed, 171 insertions, 1810 deletions
diff --git a/meta/recipes-extended/net-tools/net-tools/0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch b/meta/recipes-extended/net-tools/net-tools/0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch
deleted file mode 100644
index 523d434b7c..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch
+++ /dev/null
@@ -1,381 +0,0 @@
1From eb04ef31571f6c707eacaba6846feeebfab518e6 Mon Sep 17 00:00:00 2001
2From: Bernd Eckenfels <net-tools@lina.inka.de>
3Date: Thu, 29 May 2003 02:09:14 +0000
4Subject: [PATCH] added 'ull' prefix to unsigned long long constants to make
5 gcc 3.3 happy
6
7Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
8Upstream-Status: Backport [https://sourceforge.net/p/net-tools/code/ci/eb04ef31571f6c707eacaba6846feeebfab518e6]
9---
10 lib/interface.c | 299 ++++++++++++++++++++++++++----------------------
11 1 file changed, 161 insertions(+), 138 deletions(-)
12
13diff -uNr net-tools-1.60.orig/lib/interface.c net-tools-1.60/lib/interface.c
14--- net-tools-1.60.orig/lib/interface.c 2020-06-16 10:04:16.308411879 +0000
15+++ net-tools-1.60/lib/interface.c 2020-06-16 10:05:15.697264291 +0000
16@@ -23,7 +23,6 @@
17 #include <string.h>
18 #include <unistd.h>
19 #include <ctype.h>
20-#include <string.h>
21
22 #if HAVE_AFIPX
23 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
24@@ -654,6 +653,8 @@
25 const char *Rext = "B";
26 const char *Text = "B";
27
28+ static char flags[200];
29+
30 #if HAVE_AFIPX
31 static struct aftype *ipxtype = NULL;
32 #endif
33@@ -685,32 +686,68 @@
34 if (hw == NULL)
35 hw = get_hwntype(-1);
36
37- printf(_("%-9s Link encap:%s "), ptr->name, hw->title);
38- /* For some hardware types (eg Ash, ATM) we don't print the
39- hardware address if it's null. */
40- if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
41- hw->suppress_null_addr)))
42- printf(_("HWaddr %s "), hw->print(ptr->hwaddr));
43-#ifdef IFF_PORTSEL
44- if (ptr->flags & IFF_PORTSEL) {
45- printf(_("Media:%s"), if_port_text[ptr->map.port][0]);
46- if (ptr->flags & IFF_AUTOMEDIA)
47- printf(_("(auto)"));
48- }
49+ sprintf(flags, "flags=%d<", ptr->flags);
50+ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
51+ if (ptr->flags == 0)
52+ strcat(flags,">");
53+ if (ptr->flags & IFF_UP)
54+ strcat(flags,_("UP,"));
55+ if (ptr->flags & IFF_BROADCAST)
56+ strcat(flags,_("BROADCAST,"));
57+ if (ptr->flags & IFF_DEBUG)
58+ strcat(flags,_("DEBUG,"));
59+ if (ptr->flags & IFF_LOOPBACK)
60+ strcat(flags,_("LOOPBACK,"));
61+ if (ptr->flags & IFF_POINTOPOINT)
62+ strcat(flags,_("POINTOPOINT,"));
63+ if (ptr->flags & IFF_NOTRAILERS)
64+ strcat(flags,_("NOTRAILERS,"));
65+ if (ptr->flags & IFF_RUNNING)
66+ strcat(flags,_("RUNNING,"));
67+ if (ptr->flags & IFF_NOARP)
68+ strcat(flags,_("NOARP,"));
69+ if (ptr->flags & IFF_PROMISC)
70+ strcat(flags,_("PROMISC,"));
71+ if (ptr->flags & IFF_ALLMULTI)
72+ strcat(flags,_("ALLMULTI,"));
73+ if (ptr->flags & IFF_SLAVE)
74+ strcat(flags,_("SLAVE,"));
75+ if (ptr->flags & IFF_MASTER)
76+ strcat(flags,_("MASTER,"));
77+ if (ptr->flags & IFF_MULTICAST)
78+ strcat(flags,_("MULTICAST,"));
79+#ifdef HAVE_DYNAMIC
80+ if (ptr->flags & IFF_DYNAMIC)
81+ strcat(flags,_("DYNAMIC,"));
82+#endif
83+ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
84+ if (flags[strlen(flags)-1] == ',')
85+ flags[strlen(flags)-1] = '>';
86+ else
87+ flags[strlen(flags)-1] = 0;
88+
89+
90+ printf(_("%s: %s mtu %d metric %d"),
91+ ptr->name, flags, ptr->mtu, ptr->metric ? ptr->metric : 1);
92+#ifdef SIOCSKEEPALIVE
93+ if (ptr->outfill || ptr->keepalive)
94+ printf(_(" outfill %d keepalive %d"),
95+ ptr->outfill, ptr->keepalive);
96 #endif
97 printf("\n");
98
99 #if HAVE_AFINET
100 if (ptr->has_ip) {
101- printf(_(" %s addr:%s "), ap->name,
102+ printf(_(" %s %s"), ap->name,
103 ap->sprint(&ptr->addr, 1));
104- if (ptr->flags & IFF_POINTOPOINT) {
105- printf(_(" P-t-P:%s "), ap->sprint(&ptr->dstaddr, 1));
106- }
107+ printf(_(" netmask %s"), ap->sprint(&ptr->netmask, 1));
108 if (ptr->flags & IFF_BROADCAST) {
109- printf(_(" Bcast:%s "), ap->sprint(&ptr->broadaddr, 1));
110+ printf(_(" broadcast %s"), ap->sprint(&ptr->broadaddr, 1));
111 }
112- printf(_(" Mask:%s\n"), ap->sprint(&ptr->netmask, 1));
113+ if (ptr->flags & IFF_POINTOPOINT) {
114+ printf(_(" destination %s"), ap->sprint(&ptr->dstaddr, 1));
115+ }
116+ printf("\n");
117 }
118 #endif
119
120@@ -727,29 +764,30 @@
121 addr6p[0], addr6p[1], addr6p[2], addr6p[3],
122 addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
123 inet6_aftype.input(1, addr6, (struct sockaddr *) &sap);
124- printf(_(" inet6 addr: %s/%d"),
125- inet6_aftype.sprint((struct sockaddr *) &sap, 1), plen);
126- printf(_(" Scope:"));
127- switch (scope) {
128- case 0:
129- printf(_("Global"));
130- break;
131- case IPV6_ADDR_LINKLOCAL:
132- printf(_("Link"));
133- break;
134- case IPV6_ADDR_SITELOCAL:
135- printf(_("Site"));
136- break;
137- case IPV6_ADDR_COMPATv4:
138- printf(_("Compat"));
139- break;
140- case IPV6_ADDR_LOOPBACK:
141- printf(_("Host"));
142- break;
143- default:
144- printf(_("Unknown"));
145+ printf(_(" %s %s prefixlen %d"),
146+ inet6_aftype.name,
147+ inet6_aftype.sprint((struct sockaddr *) &sap, 1),
148+ plen);
149+ printf(_(" scopeid 0x%x"), scope);
150+
151+ flags[0] = '<'; flags[1] = 0;
152+ if (scope & IPV6_ADDR_COMPATv4) {
153+ strcat(flags, _("compat,"));
154+ scope -= IPV6_ADDR_COMPATv4;
155 }
156- printf("\n");
157+ if (scope == 0)
158+ strcat(flags, _("global,"));
159+ if (scope & IPV6_ADDR_LINKLOCAL)
160+ strcat(flags, _("link,"));
161+ if (scope & IPV6_ADDR_SITELOCAL)
162+ strcat(flags, _("site,"));
163+ if (scope & IPV6_ADDR_LOOPBACK)
164+ strcat(flags, _("host,"));
165+ if (flags[strlen(flags)-1] == ',')
166+ flags[strlen(flags)-1] = '>';
167+ else
168+ flags[strlen(flags)-1] = 0;
169+ printf("%s\n", flags);
170 }
171 }
172 fclose(f);
173@@ -762,17 +800,17 @@
174
175 if (ipxtype != NULL) {
176 if (ptr->has_ipx_bb)
177- printf(_(" IPX/Ethernet II addr:%s\n"),
178- ipxtype->sprint(&ptr->ipxaddr_bb, 1));
179+ printf(_(" %s Ethernet-II %s\n"),
180+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_bb, 1));
181 if (ptr->has_ipx_sn)
182- printf(_(" IPX/Ethernet SNAP addr:%s\n"),
183- ipxtype->sprint(&ptr->ipxaddr_sn, 1));
184+ printf(_(" %s Ethernet-SNAP %s\n"),
185+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_sn, 1));
186 if (ptr->has_ipx_e2)
187- printf(_(" IPX/Ethernet 802.2 addr:%s\n"),
188- ipxtype->sprint(&ptr->ipxaddr_e2, 1));
189+ printf(_(" %s Ethernet802.2 %s\n"),
190+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e2, 1));
191 if (ptr->has_ipx_e3)
192- printf(_(" IPX/Ethernet 802.3 addr:%s\n"),
193- ipxtype->sprint(&ptr->ipxaddr_e3, 1));
194+ printf(_(" %s Ethernet802.3 %s\n"),
195+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e3, 1));
196 }
197 #endif
198
199@@ -781,7 +819,7 @@
200 ddptype = get_afntype(AF_APPLETALK);
201 if (ddptype != NULL) {
202 if (ptr->has_ddp)
203- printf(_(" EtherTalk Phase 2 addr:%s\n"), ddptype->sprint(&ptr->ddpaddr, 1));
204+ printf(_(" %s %s\n"), ddptype->name, ddptype->sprint(&ptr->ddpaddr, 1));
205 }
206 #endif
207
208@@ -790,53 +828,30 @@
209 ectype = get_afntype(AF_ECONET);
210 if (ectype != NULL) {
211 if (ptr->has_econet)
212- printf(_(" econet addr:%s\n"), ectype->sprint(&ptr->ecaddr, 1));
213+ printf(_(" %s %s\n"), ectype->name, ectype->sprint(&ptr->ecaddr, 1));
214 }
215 #endif
216
217- printf(" ");
218- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
219- if (ptr->flags == 0)
220- printf(_("[NO FLAGS] "));
221- if (ptr->flags & IFF_UP)
222- printf(_("UP "));
223- if (ptr->flags & IFF_BROADCAST)
224- printf(_("BROADCAST "));
225- if (ptr->flags & IFF_DEBUG)
226- printf(_("DEBUG "));
227- if (ptr->flags & IFF_LOOPBACK)
228- printf(_("LOOPBACK "));
229- if (ptr->flags & IFF_POINTOPOINT)
230- printf(_("POINTOPOINT "));
231- if (ptr->flags & IFF_NOTRAILERS)
232- printf(_("NOTRAILERS "));
233- if (ptr->flags & IFF_RUNNING)
234- printf(_("RUNNING "));
235- if (ptr->flags & IFF_NOARP)
236- printf(_("NOARP "));
237- if (ptr->flags & IFF_PROMISC)
238- printf(_("PROMISC "));
239- if (ptr->flags & IFF_ALLMULTI)
240- printf(_("ALLMULTI "));
241- if (ptr->flags & IFF_SLAVE)
242- printf(_("SLAVE "));
243- if (ptr->flags & IFF_MASTER)
244- printf(_("MASTER "));
245- if (ptr->flags & IFF_MULTICAST)
246- printf(_("MULTICAST "));
247-#ifdef HAVE_DYNAMIC
248- if (ptr->flags & IFF_DYNAMIC)
249- printf(_("DYNAMIC "));
250-#endif
251- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
252- printf(_(" MTU:%d Metric:%d"),
253- ptr->mtu, ptr->metric ? ptr->metric : 1);
254-#ifdef SIOCSKEEPALIVE
255- if (ptr->outfill || ptr->keepalive)
256- printf(_(" Outfill:%d Keepalive:%d"),
257- ptr->outfill, ptr->keepalive);
258+ /* For some hardware types (eg Ash, ATM) we don't print the
259+ hardware address if it's null. */
260+ if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
261+ hw->suppress_null_addr)))
262+ printf(_(" %s %s"), hw->name, hw->print(ptr->hwaddr));
263+ else
264+ printf(_(" %s"), hw->name);
265+ if (ptr->tx_queue_len != -1)
266+ printf(_(" txqueuelen %d"), ptr->tx_queue_len);
267+ printf(" (%s)\n", hw->title);
268+
269+#ifdef IFF_PORTSEL
270+ if (ptr->flags & IFF_PORTSEL) {
271+ printf(_(" media %s"), if_port_text[ptr->map.port][0]);
272+ if (ptr->flags & IFF_AUTOMEDIA)
273+ printf(_("autoselect"));
274+ printf("\n");
275+ }
276 #endif
277- printf("\n");
278+
279
280 /* If needed, display the interface statistics. */
281
282@@ -845,19 +860,9 @@
283 * not for the aliases, although strictly speaking they're shared
284 * by all addresses.
285 */
286- printf(" ");
287-
288- printf(_("RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"),
289- ptr->stats.rx_packets, ptr->stats.rx_errors,
290- ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors,
291- ptr->stats.rx_frame_errors);
292- if (can_compress)
293- printf(_(" compressed:%lu\n"), ptr->stats.rx_compressed);
294
295 rx = ptr->stats.rx_bytes;
296- tx = ptr->stats.tx_bytes;
297 short_rx = rx * 10;
298- short_tx = tx * 10;
299 if (rx > 1125899906842624ull) {
300 short_rx /= 1125899906842624ull;
301 Rext = "PiB";
302@@ -874,6 +879,8 @@
303 short_rx /= 1024;
304 Rext = "KiB";
305 }
306+ tx = ptr->stats.tx_bytes;
307+ short_tx = tx * 10;
308 if (tx > 1125899906842624ull) {
309 short_tx /= 1125899906842624ull;
310 Text = "PiB";
311@@ -891,37 +898,50 @@
312 Text = "KiB";
313 }
314
315- printf(" ");
316- printf(_("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"),
317- ptr->stats.tx_packets, ptr->stats.tx_errors,
318- ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors,
319- ptr->stats.tx_carrier_errors);
320- printf(_(" collisions:%lu "), ptr->stats.collisions);
321- if (can_compress)
322- printf(_("compressed:%lu "), ptr->stats.tx_compressed);
323- if (ptr->tx_queue_len != -1)
324- printf(_("txqueuelen:%d "), ptr->tx_queue_len);
325- printf("\n ");
326- printf(_("RX bytes:%llu (%lu.%lu %s) TX bytes:%llu (%lu.%lu %s)\n"),
327+ printf(" ");
328+ printf(_("RX packets %llu bytes %llu (%lu.%lu %s)\n"),
329+ ptr->stats.rx_packets,
330 rx, (unsigned long)(short_rx / 10),
331- (unsigned long)(short_rx % 10), Rext,
332- tx, (unsigned long)(short_tx / 10),
333- (unsigned long)(short_tx % 10), Text);
334+ (unsigned long)(short_rx % 10), Rext);
335+ if (can_compress) {
336+ printf(" ");
337+ printf(_("RX compressed:%lu\n"), ptr->stats.rx_compressed);
338+ }
339+ printf(" ");
340+ printf(_("RX errors %lu dropped %lu overruns %lu frame %lu\n"),
341+ ptr->stats.rx_errors, ptr->stats.rx_dropped,
342+ ptr->stats.rx_fifo_errors, ptr->stats.rx_frame_errors);
343+
344+
345+ printf(" ");
346+ printf(_("TX packets %llu bytes %llu (%lu.%lu %s)\n"),
347+ ptr->stats.tx_packets,
348+ tx, (unsigned long)(short_tx / 10),
349+ (unsigned long)(short_tx % 10), Text);
350+ if (can_compress) {
351+ printf(" ");
352+ printf(_("TX compressed %lu\n"), ptr->stats.tx_compressed);
353+ }
354+ printf(" ");
355+ printf(_("TX errors %lu dropped %lu overruns %lu carrier %lu collisions %lu\n"),
356+ ptr->stats.tx_errors,
357+ ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors,
358+ ptr->stats.tx_carrier_errors, ptr->stats.collisions);
359 }
360
361 if ((ptr->map.irq || ptr->map.mem_start || ptr->map.dma ||
362 ptr->map.base_addr >= 0x100)) {
363- printf(" ");
364+ printf(" device ");
365 if (ptr->map.irq)
366- printf(_("Interrupt:%d "), ptr->map.irq);
367+ printf(_("interrupt %d "), ptr->map.irq);
368 if (ptr->map.base_addr >= 0x100) /* Only print devices using it for
369 I/O maps */
370- printf(_("Base address:0x%x "), ptr->map.base_addr);
371+ printf(_("base 0x%x "), ptr->map.base_addr);
372 if (ptr->map.mem_start) {
373- printf(_("Memory:%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end);
374+ printf(_("memory 0x%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end);
375 }
376 if (ptr->map.dma)
377- printf(_("DMA chan:%x "), ptr->map.dma);
378+ printf(_(" dma 0x%x"), ptr->map.dma);
379 printf("\n");
380 }
381 printf("\n");
diff --git a/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch b/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch
deleted file mode 100644
index 8be45ccac9..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch
+++ /dev/null
@@ -1,87 +0,0 @@
1From 08abfcd923e9f37d1902db26771b1dc6731eb265 Mon Sep 17 00:00:00 2001
2From: Jiri Popelka <jpopelka@redhat.com>
3Date: Fri, 27 Sep 2013 18:40:06 +0200
4Subject: [PATCH 1/1] lib/inet6.c:INET6_rresolve() - various fixes
5
61) Fall-back to numeric address if getnameinfo fails.
7 Reverse lookup is not mandatory, therefore its fail
8 is not an error. Just return numeric address in that case.
9 This makes netstat/route show IPv6 address instead of
10 [UNKNOWN] in case of DNS problems.
11
122) Pass length of 'name' buffer into function.
13 'name' is a pointer and therefore sizeof(name)
14 returns size of pointer and not size of the buffer.
15 see http://stackoverflow.com/questions/14298710/c-pointers-and-arrays-sizeof-operator
16 The sizeof() usage was added with commit 604785adc,
17 so I checked all the other changes in that commit
18 and they seem to be OK.
19
203) remove unused 's' variable
21
22Upstream-Status: Pending
23
24Signed-off-by: Shan Hai <shan.hai@windriver.com>
25Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
26---
27 lib/inet6.c | 21 ++++++++++-----------
28 1 file changed, 10 insertions(+), 11 deletions(-)
29
30diff --git a/lib/inet6.c b/lib/inet6.c
31index 9a484a0..2a9c459 100644
32--- a/lib/inet6.c
33+++ b/lib/inet6.c
34@@ -84,10 +84,9 @@ static int INET6_resolve(char *name, struct sockaddr_in6 *sin6)
35 #endif
36
37
38-static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
39+static int INET6_rresolve(char *name, size_t namelen,
40+ struct sockaddr_in6 *sin6, int numeric)
41 {
42- int s;
43-
44 /* Grmpf. -FvK */
45 if (sin6->sin6_family != AF_INET6) {
46 #ifdef DEBUG
47@@ -98,21 +97,20 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
48 return (-1);
49 }
50 if (numeric & 0x7FFF) {
51- inet_ntop( AF_INET6, &sin6->sin6_addr, name, 80);
52+ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
53 return (0);
54 }
55 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
56 if (numeric & 0x8000)
57- strcpy(name, "default");
58+ safe_strncpy(name, "default", namelen);
59 else
60- strcpy(name, "[::]");
61+ safe_strncpy(name, "[::]", namelen);
62 return (0);
63 }
64
65- if ((s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
66- name, 255 /* !! */ , NULL, 0, 0))) {
67- fputs("getnameinfo failed\n", stderr);
68- return -1;
69+ if (getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
70+ name, namelen , NULL, 0, 0)) {
71+ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
72 }
73 return (0);
74 }
75@@ -143,7 +141,8 @@ static char *INET6_sprint(struct sockaddr *sap, int numeric)
76
77 if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
78 return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
79- if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0)
80+ if (INET6_rresolve(buff, sizeof(buff),
81+ (struct sockaddr_in6 *) sap, numeric) != 0)
82 return safe_strncpy(buff, _("[UNKNOWN]"), sizeof(buff));
83 return (fix_v4_address(buff, &((struct sockaddr_in6 *)sap)->sin6_addr));
84 }
85--
861.8.5.2.233.g932f7e4
87
diff --git a/meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch b/meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch
new file mode 100644
index 0000000000..f15d3654c7
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch
@@ -0,0 +1,15 @@
1Description: Add missing headers
2
3Upstream-Status: Pending
4Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
5
6--- a/netstat.c
7+++ b/netstat.c
8@@ -88,6 +88,7 @@
9 #include <sys/stat.h>
10 #include <net/if.h>
11 #include <dirent.h>
12+#include <sys/types.h>
13
14 #include "net-support.h"
15 #include "pathnames.h"
diff --git a/meta/recipes-extended/net-tools/net-tools/Bug_443075-ifconfig.c-pointtopoint_spelling.patch b/meta/recipes-extended/net-tools/net-tools/Bug_443075-ifconfig.c-pointtopoint_spelling.patch
new file mode 100644
index 0000000000..74d74668ce
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools/Bug_443075-ifconfig.c-pointtopoint_spelling.patch
@@ -0,0 +1,26 @@
1Description: Accept "pointtopoint" as a synonym for "pointopoint"
2Bug-Debian: https://bugs.debian.org/443075
3Author: Justin Pryzby <pryzbyj@libra>
4
5Upstream-Status: Pending
6Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
7
8--- a/ifconfig.c
9+++ b/ifconfig.c
10@@ -644,14 +644,14 @@
11 spp++;
12 continue;
13 }
14- if (!strcmp(*spp, "-pointopoint")) {
15+ if (!strcmp(*spp, "-pointopoint") || !strcmp(*spp, "-pointtopoint")) {
16 goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT);
17 spp++;
18 if (test_flag(ifr.ifr_name, IFF_POINTOPOINT) > 0)
19 fprintf(stderr, _("Warning: Interface %s still in POINTOPOINT mode.\n"), ifr.ifr_name);
20 continue;
21 }
22- if (!strcmp(*spp, "pointopoint")) {
23+ if (!strcmp(*spp, "pointopoint") || !strcmp(*spp, "pointtopoint")) {
24 if (*(spp + 1) != NULL) {
25 spp++;
26 safe_strncpy(host, *spp, (sizeof host));
diff --git a/meta/recipes-extended/net-tools/net-tools/Bug_541172-netstat.c-exit-codes.patch b/meta/recipes-extended/net-tools/net-tools/Bug_541172-netstat.c-exit-codes.patch
new file mode 100644
index 0000000000..782b94bc61
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools/Bug_541172-netstat.c-exit-codes.patch
@@ -0,0 +1,22 @@
1Description: Bug#541172: netstat.c exit codes
2
3Upstream-Status: Pending
4Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
5
6--- a/netstat.c
7+++ b/netstat.c
8@@ -2237,12 +2237,14 @@
9 parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
10 #else
11 ENOSUPP("netstat", "AF INET");
12+ exit(1);
13 #endif
14 } else if(!strcmp(afname, "inet6")) {
15 #if HAVE_AFINET6
16 parsesnmp6(flag_raw, flag_tcp, flag_udp);
17 #else
18 ENOSUPP("netstat", "AF INET6");
19+ exit(1);
20 #endif
21 } else {
22 printf(_("netstat: No statistics support for specified address family: %s\n"), afname);
diff --git a/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch b/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
deleted file mode 100644
index 06f81420e9..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 81814dc2b14843009193efd307d814c26baa61f0 Mon Sep 17 00:00:00 2001
2From: Jiri Popelka <jpopelka@redhat.com>
3Date: Wed, 7 Dec 2011 19:14:09 +0100
4Subject: [PATCH] ifconfig interface:0 del <IP> will remove the aliased IP on IA64
5
6Upstream-Status: Backport
7
8commit 81814dc2b14843009193efd307d814c26baa61f0 from
9git://git.code.sf.net/p/net-tools/code
10
11---
12 ifconfig.c | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15diff --git a/ifconfig.c b/ifconfig.c
16index bc405c6..dae8922 100644
17--- a/ifconfig.c
18+++ b/ifconfig.c
19@@ -890,7 +890,9 @@ int main(int argc, char **argv)
20 continue;
21 }
22
23- memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long));
24+ /* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */
25+ ip = 0;
26+ memcpy(&ip, &sin.sin_addr.s_addr, sizeof(sin.sin_addr.s_addr));
27
28 if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
29 fprintf(stderr, _("Interface %s not initialized\n"),
30--
311.7.9.5
32
diff --git a/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch b/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
deleted file mode 100644
index f694d594bf..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
+++ /dev/null
@@ -1,100 +0,0 @@
1Adjust headers for non-glibc cases
2especially exposed by musl
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5Upstream-Status: Pending
6
7Index: net-tools-1.60/lib/inet6_gr.c
8===================================================================
9--- net-tools-1.60.orig/lib/inet6_gr.c
10+++ net-tools-1.60/lib/inet6_gr.c
11@@ -23,7 +23,7 @@
12 #include <string.h>
13 #include <stdio.h>
14 #include <unistd.h>
15-#ifndef __GLIBC__
16+#ifdef HAVE_IPV6_ROUTE_H
17 #include <netinet6/ipv6_route.h> /* glibc doesn't have this */
18 #endif
19 #include "version.h"
20Index: net-tools-1.60/lib/inet6_sr.c
21===================================================================
22--- net-tools-1.60.orig/lib/inet6_sr.c
23+++ net-tools-1.60/lib/inet6_sr.c
24@@ -23,10 +23,10 @@
25 #include <string.h>
26 #include <stdio.h>
27 #include <unistd.h>
28-#ifdef __GLIBC__
29-#include <net/route.h>
30-#else
31+#ifdef HAVE_IPV6_ROUTE_H
32 #include <netinet6/ipv6_route.h> /* glibc does not have this */
33+#else
34+#include <net/route.h>
35 #endif
36 #include "version.h"
37 #include "net-support.h"
38Index: net-tools-1.60/lib/inet_sr.c
39===================================================================
40--- net-tools-1.60.orig/lib/inet_sr.c
41+++ net-tools-1.60/lib/inet_sr.c
42@@ -26,6 +26,7 @@
43 #include <string.h>
44 #include <stdio.h>
45 #include <unistd.h>
46+#include <asm-generic/param.h>
47 #include "version.h"
48 #include "net-support.h"
49 #include "pathnames.h"
50Index: net-tools-1.60/lib/util-ank.c
51===================================================================
52--- net-tools-1.60.orig/lib/util-ank.c
53+++ net-tools-1.60/lib/util-ank.c
54@@ -14,6 +14,7 @@
55 * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
56 */
57
58+#include <limits.h>
59 #include <stdio.h>
60 #include <stdlib.h>
61 #include <unistd.h>
62Index: net-tools-1.60/mii-tool.c
63===================================================================
64--- net-tools-1.60.orig/mii-tool.c
65+++ net-tools-1.60/mii-tool.c
66@@ -47,10 +47,6 @@ static char Version[] = "$Id: mii-tool.c
67 #include <net/if.h>
68 #include <linux/sockios.h>
69
70-#ifndef __GLIBC__
71-#include <linux/if_arp.h>
72-#include <linux/if_ether.h>
73-#endif
74 #include "mii.h"
75 #include "version.h"
76
77Index: net-tools-1.60/netstat.c
78===================================================================
79--- net-tools-1.60.orig/netstat.c
80+++ net-tools-1.60/netstat.c
81@@ -87,6 +87,7 @@
82 #include <dirent.h>
83 #include <sys/stat.h>
84 #include <sys/types.h>
85+#include <asm-generic/param.h>
86
87 #include "net-support.h"
88 #include "pathnames.h"
89Index: net-tools-1.60/slattach.c
90===================================================================
91--- net-tools-1.60.orig/slattach.c
92+++ net-tools-1.60/slattach.c
93@@ -44,6 +44,7 @@
94 #include <string.h>
95 #include <unistd.h>
96 #include <getopt.h>
97+#include <termios.h>
98 #include <linux/if_slip.h>
99
100 #if defined(__GLIBC__)
diff --git a/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch b/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
deleted file mode 100644
index 78daf6c3ed..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
+++ /dev/null
@@ -1,635 +0,0 @@
1From 23276afe270009420cfbc52bffafdd25ac0817fe Mon Sep 17 00:00:00 2001
2From: Li Zhou <li.zhou@windriver.com>
3Date: Thu, 14 Jan 2016 17:01:29 +0800
4Subject: [PATCH 1/3] net-tools: add SCTP support for netstat
5
6Upstream-Status: pending
7
8Signed-off-by: Li Zhou <li.zhou@windriver.com>
9---
10 netstat.c | 411 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
11 statistics.c | 68 +++++++++-
12 2 files changed, 465 insertions(+), 14 deletions(-)
13
14Index: net-tools-1.60/netstat.c
15===================================================================
16--- net-tools-1.60.orig/netstat.c
17+++ net-tools-1.60/netstat.c
18@@ -58,6 +58,7 @@
19 *
20 *990420 {1.38} Tuan Hoang removed a useless assignment from igmp_do_one()
21 *20010404 {1.39} Arnaldo Carvalho de Melo - use setlocale
22+ *20050516 {1.40} Ivan Skytte Joergensen:Added SCTP support
23 *
24 * This program is free software; you can redistribute it
25 * and/or modify it under the terms of the GNU General
26@@ -106,7 +107,7 @@
27 #endif
28
29 /* prototypes for statistics.c */
30-void parsesnmp(int, int, int);
31+void parsesnmp(int, int, int, int);
32 void inittab(void);
33 void parsesnmp6(int, int, int);
34 void inittab6(void);
35@@ -119,6 +120,28 @@ typedef enum {
36 SS_DISCONNECTING /* in process of disconnecting */
37 } socket_state;
38
39+#define SCTP_NSTATES 9 /* The number of states in array*/
40+
41+static const char *sctp_state[] = {
42+ N_("EMPTY"),
43+ N_("CLOSED"),
44+ N_("COOKIE_WAIT"),
45+ N_("COOKIE_ECHOED"),
46+ N_("ESTABLISHED"),
47+ N_("SHUTDOWN_PENDING"),
48+ N_("SHUTDOWN_SENT"),
49+ N_("SHUTDOWN_RECEIVED"),
50+ N_("SHUTDOWN_ACK_SENT")
51+};
52+
53+#define SCTP_NTYPES 3 /* The number of types in array */
54+
55+static const char *sctp_type[] = {
56+ N_("udp"),
57+ N_("udp-high-bw"),
58+ N_("tcp")
59+};
60+
61 #define SO_ACCEPTCON (1<<16) /* performed a listen */
62 #define SO_WAITDATA (1<<17) /* wait data to read */
63 #define SO_NOSPACE (1<<18) /* no space to write */
64@@ -149,6 +172,7 @@ int flag_opt = 0;
65 int flag_raw = 0;
66 int flag_tcp = 0;
67 int flag_udp = 0;
68+int flag_sctp= 0;
69 int flag_igmp= 0;
70 int flag_rom = 0;
71 int flag_exp = 1;
72@@ -995,6 +1019,365 @@ static int udp_info(void)
73 udp_do_one);
74 }
75
76+static const char *sctp_socket_type_str(int type) {
77+ if(type>=0 && type<SCTP_NTYPES)
78+ return sctp_type[type];
79+ else {
80+ static char type_str_buf[64];
81+ sprintf(type_str_buf,"UNKNOWN(%d)",type);
82+ return type_str_buf;
83+ }
84+}
85+
86+static const char *sctp_state_str(int state)
87+{
88+ if(state>=0 && state<SCTP_NSTATES)
89+ return sctp_state[state];
90+ else {
91+ static char state_str_buf[64];
92+ sprintf(state_str_buf,"UNKNOWN(%d)",state);
93+ return state_str_buf;
94+ }
95+}
96+
97+static const char *sctp_socket_state_str(int state)
98+{
99+ if(state>=0 && state<=10)
100+ return tcp_state[state];
101+ else {
102+ static char state_str_buf[64];
103+ sprintf(state_str_buf,"UNKNOWN(%d)",state);
104+ return state_str_buf;
105+ }
106+}
107+
108+static struct aftype *process_sctp_addr_str(const char *addr_str, struct sockaddr *sa)
109+{
110+ if (strchr(addr_str,':')) {
111+#if HAVE_AFINET6
112+ extern struct aftype inet6_aftype;
113+ /* Demangle what the kernel gives us */
114+ struct in6_addr in6;
115+ char addr6_str[INET6_ADDRSTRLEN];
116+ unsigned u0,u1,u2,u3,u4,u5,u6,u7;
117+ sscanf(addr_str, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X",
118+ &u0, &u1, &u2, &u3, &u4, &u5, &u6, &u7);
119+ in6.s6_addr16[0] = htons(u0);
120+ in6.s6_addr16[1] = htons(u1);
121+ in6.s6_addr16[2] = htons(u2);
122+ in6.s6_addr16[3] = htons(u3);
123+ in6.s6_addr16[4] = htons(u4);
124+ in6.s6_addr16[5] = htons(u5);
125+ in6.s6_addr16[6] = htons(u6);
126+ in6.s6_addr16[7] = htons(u7);
127+
128+ inet_ntop(AF_INET6, &in6, addr6_str, sizeof(addr6_str));
129+ inet6_aftype.input(1, addr6_str, sa);
130+ sa->sa_family = AF_INET6;
131+#endif
132+ } else {
133+ ((struct sockaddr_in*)sa)->sin_addr.s_addr = inet_addr(addr_str);
134+ sa->sa_family = AF_INET;
135+ }
136+ return get_afntype(sa->sa_family);
137+}
138+
139+static void sctp_eps_do_one(int lnr, char *line)
140+{
141+ char buffer[1024];
142+ int type, state, port;
143+ int uid;
144+ unsigned long inode;
145+
146+ struct aftype *ap;
147+#if HAVE_AFINET6
148+ struct sockaddr_in6 localaddr;
149+#else
150+ struct sockaddr_in localaddr;
151+#endif
152+ const char *sty_str;
153+ const char *sst_str;
154+ const char *lport_str;
155+ const char *uid_str;
156+ const char *inode_str;
157+ const char *pladdr_str;
158+ char *laddrs_str;
159+
160+ if(lnr == 0) {
161+ /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/
162+ return;
163+ }
164+
165+ strtok(line," \t\n"); /*skip ptr*/
166+ strtok(0," \t\n"); /*skip ptr*/
167+ sty_str = strtok(0," \t\n");
168+ sst_str = strtok(0," \t\n");
169+ strtok(0," \t\n"); /*skip hash bucket*/
170+ lport_str=strtok(0," \t\n");
171+ uid_str = strtok(0," \t\n");
172+ inode_str = strtok(0," \t\n");
173+ pladdr_str = strtok(0," \t\n");
174+ laddrs_str=strtok(0,"\t\n");
175+
176+ type = atoi(sty_str);
177+ state = atoi(sst_str);
178+ port = atoi(lport_str);
179+ uid = atoi(uid_str);
180+ inode = strtoul(inode_str,0,0);
181+
182+ if(flag_sctp<=1) {
183+ /* only print the primary address */
184+ char local_addr[64];
185+ char local_port[16];
186+
187+ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
188+ if(ap)
189+ safe_strncpy(local_addr,
190+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
191+ sizeof(local_addr));
192+ else
193+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
194+
195+ snprintf(local_port, sizeof(local_port), "%s",
196+ get_sname(htons(port), "sctp",
197+ flag_not & FLAG_NUM_PORT));
198+
199+ printf("sctp ");
200+ sprintf(buffer,"%s:%s", local_addr, local_port);
201+ printf("%-47s", buffer);
202+ printf(" %-12s", sctp_socket_state_str(state));
203+ } else {
204+ /*print all addresses*/
205+ const char *this_local_addr;
206+ int first=1;
207+ char local_port[16];
208+ snprintf(local_port, sizeof(local_port), "%s",
209+ get_sname(htons(port), "sctp",
210+ flag_not & FLAG_NUM_PORT));
211+ for(this_local_addr=strtok(laddrs_str," \t\n");
212+ this_local_addr;
213+ this_local_addr=strtok(0," \t\n"))
214+ {
215+ char local_addr[64];
216+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
217+ if(ap)
218+ safe_strncpy(local_addr,
219+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
220+ sizeof(local_addr));
221+ else
222+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
223+
224+ if(!first) printf("\n");
225+ if(first)
226+ printf("sctp ");
227+ else
228+ printf(" ");
229+ sprintf(buffer,"%s:%s", local_addr, local_port);
230+ printf("%-47s", buffer);
231+ printf(" %-12s", first?sctp_socket_state_str(state):"");
232+ first = 0;
233+ }
234+ }
235+
236+ finish_this_one(uid,inode,"");
237+}
238+
239+static void sctp_assoc_do_one(int lnr, char *line)
240+{
241+ char buffer[1024];
242+ int type, state, state2, lport,rport;
243+ int uid;
244+ unsigned rxqueue,txqueue;
245+ unsigned long inode;
246+
247+ struct aftype *ap;
248+#if HAVE_AFINET6
249+ struct sockaddr_in6 localaddr,remoteaddr;
250+#else
251+ struct sockaddr_in localaddr,remoteaddr;
252+#endif
253+ const char *sty_str;
254+ const char *sst_str;
255+ const char *st_str;
256+ const char *txqueue_str;
257+ const char *rxqueue_str;
258+ const char *lport_str,*rport_str;
259+ const char *uid_str;
260+ const char *inode_str;
261+ const char *pladdr_str;
262+ char *laddrs_str;
263+ const char *praddr_str;
264+ char *raddrs_str;
265+
266+ if(lnr == 0) {
267+ /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/
268+ return;
269+ }
270+
271+ strtok(line," \t\n"); /*skip ptr*/
272+ strtok(0," \t\n"); /*skip ptr*/
273+ sty_str = strtok(0," \t\n");
274+ sst_str = strtok(0," \t\n");
275+ st_str = strtok(0," \t\n");
276+ strtok(0," \t\n"); /*skip hash bucket*/
277+ txqueue_str = strtok(0," \t\n");
278+ rxqueue_str = strtok(0," \t\n");
279+ uid_str = strtok(0," \t\n");
280+ inode_str = strtok(0," \t\n");
281+ lport_str=strtok(0," \t\n");
282+ rport_str=strtok(0," \t\n");
283+ pladdr_str = strtok(0," \t\n");
284+ praddr_str = strtok(0," \t\n");
285+ laddrs_str=strtok(0,"<->\t\n");
286+ raddrs_str=strtok(0,"<->\t\n");
287+
288+ type = atoi(sty_str);
289+ state = atoi(sst_str);
290+ state2 = atoi(st_str);
291+ txqueue = atoi(txqueue_str);
292+ rxqueue = atoi(rxqueue_str);
293+ uid = atoi(uid_str);
294+ inode = strtoul(inode_str,0,0);
295+ lport = atoi(lport_str);
296+ rport = atoi(rport_str);
297+
298+ if(flag_sctp<=1) {
299+ /* only print the primary addresses */
300+ char local_addr[64];
301+ char local_port[16];
302+ char remote_addr[64];
303+ char remote_port[16];
304+
305+ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
306+ if(ap)
307+ safe_strncpy(local_addr,
308+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
309+ sizeof(local_addr));
310+ else
311+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
312+
313+ snprintf(local_port, sizeof(local_port), "%s",
314+ get_sname(htons(lport), "sctp",
315+ flag_not & FLAG_NUM_PORT));
316+
317+ ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr);
318+ if(ap)
319+ safe_strncpy(remote_addr,
320+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
321+ sizeof(remote_addr));
322+ else
323+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
324+
325+ snprintf(remote_port, sizeof(remote_port), "%s",
326+ get_sname(htons(rport), "sctp",
327+ flag_not & FLAG_NUM_PORT));
328+
329+ printf("sctp");
330+ printf(" %6u %6u ", rxqueue, txqueue);
331+ sprintf(buffer,"%s:%s", local_addr, local_port);
332+ printf("%-23s", buffer);
333+ printf(" ");
334+ sprintf(buffer,"%s:%s", remote_addr, remote_port);
335+ printf("%-23s", buffer);
336+ printf(" %-12s", sctp_socket_state_str(state));
337+ } else {
338+ /*print all addresses*/
339+ const char *this_local_addr;
340+ const char *this_remote_addr;
341+ char *ss1,*ss2;
342+ int first=1;
343+ char local_port[16];
344+ char remote_port[16];
345+ snprintf(local_port, sizeof(local_port), "%s",
346+ get_sname(htons(lport), "sctp",
347+ flag_not & FLAG_NUM_PORT));
348+ snprintf(remote_port, sizeof(remote_port), "%s",
349+ get_sname(htons(rport), "sctp",
350+ flag_not & FLAG_NUM_PORT));
351+
352+ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
353+ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
354+ while(this_local_addr || this_remote_addr) {
355+ char local_addr[64];
356+ char remote_addr[64];
357+ if(this_local_addr) {
358+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
359+ if(ap)
360+ safe_strncpy(local_addr,
361+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
362+ sizeof(local_addr));
363+ else
364+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
365+ }
366+ if(this_remote_addr) {
367+ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
368+ if(ap)
369+ safe_strncpy(remote_addr,
370+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
371+ sizeof(remote_addr));
372+ else
373+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
374+ }
375+
376+ if(!first) printf("\n");
377+ if(first)
378+ printf("sctp %6u %6u ", rxqueue, txqueue);
379+ else
380+ printf(" ");
381+ if(this_local_addr) {
382+ if(first)
383+ sprintf(buffer,"%s:%s", local_addr, local_port);
384+ else
385+ sprintf(buffer,"%s", local_addr);
386+ printf("%-23s", buffer);
387+ } else
388+ printf("%-23s", "");
389+ printf(" ");
390+ if(this_remote_addr) {
391+ if(first)
392+ sprintf(buffer,"%s:%s", remote_addr, remote_port);
393+ else
394+ sprintf(buffer,"%s", remote_addr);
395+ printf("%-23s", buffer);
396+ } else
397+ printf("%-23s", "");
398+
399+ printf(" %-12s", first?sctp_socket_state_str(state):"");
400+
401+ first = 0;
402+ this_local_addr=strtok_r(0," \t\n",&ss1);
403+ this_remote_addr=strtok_r(0," \t\n",&ss2);
404+ }
405+ }
406+
407+ finish_this_one(uid,inode,"");
408+}
409+
410+static int sctp_info_eps(void)
411+{
412+#if !defined(_PATH_PROCNET_SCTP_EPS)
413+#define _PATH_PROCNET_SCTP_EPS "/proc/net/sctp/eps"
414+#endif
415+ INFO_GUTS(_PATH_PROCNET_SCTP_EPS, "AF INET (sctp)",
416+ sctp_eps_do_one);
417+}
418+
419+static int sctp_info_assocs(void)
420+{
421+#if !defined(_PATH_PROCNET_SCTP_ASSOCS)
422+#define _PATH_PROCNET_SCTP_ASSOCS "/proc/net/sctp/assocs"
423+#endif
424+ INFO_GUTS(_PATH_PROCNET_SCTP_ASSOCS, "AF INET (sctp)",
425+ sctp_assoc_do_one);
426+}
427+
428+static int sctp_info(void)
429+{
430+ if(flag_all)
431+ sctp_info_eps();
432+ return sctp_info_assocs();
433+}
434+
435 static void raw_do_one(int lnr, const char *line)
436 {
437 char buffer[8192], local_addr[64], rem_addr[64];
438@@ -1558,7 +1941,7 @@ static void usage(void)
439 fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n"));
440 fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n"));
441
442- fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
443+ fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
444 fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
445 fprintf(stderr, _(" List of possible address families (which support routing):\n"));
446 print_aflist(1); /* 1 = routeable */
447@@ -1583,6 +1966,7 @@ int main
448 {"protocol", 1, 0, 'A'},
449 {"tcp", 0, 0, 't'},
450 {"udp", 0, 0, 'u'},
451+ {"sctp", 0, 0, 'S' },
452 {"raw", 0, 0, 'w'},
453 {"unix", 0, 0, 'x'},
454 {"listening", 0, 0, 'l'},
455@@ -1613,7 +1997,7 @@ int main
456 getroute_init(); /* Set up AF routing support */
457
458 afname[0] = '\0';
459- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuWVv?wxl64", longopts, &lop)) != EOF)
460+ while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuSWVv?wxl64", longopts, &lop)) != EOF)
461 switch (i) {
462 case -1:
463 break;
464@@ -1705,10 +2089,12 @@ int main
465 case 't':
466 flag_tcp++;
467 break;
468-
469 case 'u':
470 flag_udp++;
471 break;
472+ case 'S':
473+ flag_sctp++;
474+ break;
475 case 'w':
476 flag_raw++;
477 break;
478@@ -1726,13 +2112,13 @@ int main
479 if (flag_int + flag_rou + flag_mas + flag_sta > 1)
480 usage();
481
482- if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_raw))
483- flag_tcp = flag_udp = flag_raw = 1;
484+ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
485+ flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
486
487- if ((flag_tcp || flag_udp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
488+ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
489 flag_inet = flag_inet6 = 1;
490
491- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
492+ flag_arg = flag_tcp + flag_udp + flag_sctp + flag_raw + flag_unx + flag_ipx
493 + flag_ax25 + flag_netrom + flag_igmp + flag_x25;
494
495 if (flag_mas) {
496@@ -1760,7 +2146,7 @@ int main
497 char buf[256];
498 if (!afname[0]) {
499 inittab();
500- parsesnmp(flag_raw, flag_tcp, flag_udp);
501+ parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
502 } else {
503 safe_strncpy(buf, afname, sizeof(buf));
504 tmp1 = buf;
505@@ -1815,7 +2201,7 @@ int main
506 return (i);
507 }
508 for (;;) {
509- if (!flag_arg || flag_tcp || flag_udp || flag_raw) {
510+ if (!flag_arg || flag_tcp || flag_udp || flag_sctp || flag_raw) {
511 #if HAVE_AFINET
512 prg_cache_load();
513 printf(_("Active Internet connections ")); /* xxx */
514@@ -1854,6 +2240,11 @@ int main
515 if (i)
516 return (i);
517 }
518+ if (!flag_arg || flag_sctp) {
519+ i = sctp_info();
520+ if (i)
521+ return (i);
522+ }
523 if (!flag_arg || flag_raw) {
524 i = raw_info();
525 if (i)
526Index: net-tools-1.60/statistics.c
527===================================================================
528--- net-tools-1.60.orig/statistics.c
529+++ net-tools-1.60/statistics.c
530@@ -21,7 +21,7 @@
531 #define UFWARN(x)
532 #endif
533
534-int print_static,f_raw,f_tcp,f_udp,f_unknown = 1;
535+int print_static,f_raw,f_tcp,f_udp,f_sctp,f_unknown = 1;
536
537 enum State {
538 number = 0, opt_number, i_forward, i_inp_icmp, i_outp_icmp, i_rto_alg,
539@@ -297,6 +297,27 @@ struct entry Tcpexttab[] =
540 { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number },
541 };
542
543+struct entry Sctptab[] =
544+{
545+ {"SctpCurrEstab", N_("%u Current Associations"), number},
546+ {"SctpActiveEstabs", N_("%u Active Associations"), number},
547+ {"SctpPassiveEstabs", N_("%u Passive Associations"), number},
548+ {"SctpAborteds", N_("%u Number of Aborteds "), number},
549+ {"SctpShutdowns", N_("%u Number of Graceful Terminations"), number},
550+ {"SctpOutOfBlues", N_("%u Number of Out of Blue packets"), number},
551+ {"SctpChecksumErrors", N_("%u Number of Packets with invalid Checksum"), number},
552+ {"SctpOutCtrlChunks", N_("%u Number of control chunks sent"), number},
553+ {"SctpOutOrderChunks", N_("%u Number of ordered chunks sent"), number},
554+ {"SctpOutUnorderChunks", N_("%u Number of Unordered chunks sent"), number},
555+ {"SctpInCtrlChunks", N_("%u Number of control chunks received"), number},
556+ {"SctpInOrderChunks", N_("%u Number of ordered chunks received"), number},
557+ {"SctpInUnorderChunks", N_("%u Number of Unordered chunks received"), number},
558+ {"SctpFragUsrMsgs", N_("%u Number of messages fragmented"), number},
559+ {"SctpReasmUsrMsgs", N_("%u Number of messages reassembled "), number},
560+ {"SctpOutSCTPPacks", N_("%u Number of SCTP packets sent"), number},
561+ {"SctpInSCTPPacks", N_("%u Number of SCTP packets received"), number},
562+};
563+
564 struct tabtab {
565 char *title;
566 struct entry *tab;
567@@ -310,6 +331,7 @@ struct tabtab snmptabs[] =
568 {"Icmp", Icmptab, sizeof(Icmptab), &f_raw},
569 {"Tcp", Tcptab, sizeof(Tcptab), &f_tcp},
570 {"Udp", Udptab, sizeof(Udptab), &f_udp},
571+ {"Sctp", Sctptab, sizeof(Sctptab), &f_sctp},
572 {"TcpExt", Tcpexttab, sizeof(Tcpexttab), &f_tcp},
573 {NULL}
574 };
575@@ -499,12 +521,40 @@ void process6_fd(FILE *f)
576
577 }
578
579-void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
580+/* Process a file with name-value lines (like /proc/net/sctp/snmp) */
581+void process_fd2(FILE *f, const char *filename)
582+{
583+ char buf1[1024];
584+ char *sp;
585+ struct tabtab *tab;
586+
587+ tab = newtable(snmptabs, "Sctp");
588+
589+ while (fgets(buf1, sizeof buf1, f)) {
590+ sp = buf1 + strcspn(buf1, " \t\n");
591+ if (!sp)
592+ goto formaterr;
593+ *sp = '\0';
594+ sp++;
595+
596+ sp += strspn(sp, " \t\n");
597+
598+ if (*sp != '\0' && *(tab->flag))
599+ printval(tab, buf1, strtoul(sp, 0, 10));
600+ }
601+ return;
602+
603+formaterr:
604+ fprintf(stderr,_("error parsing %s\n"), filename);
605+ return;
606+}
607+
608+void parsesnmp(int flag_raw, int flag_tcp, int flag_udp, int flag_sctp)
609 {
610 FILE *f;
611
612- f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp;
613-
614+ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; f_sctp = flag_sctp;
615+
616 f = proc_fopen("/proc/net/snmp");
617 if (!f) {
618 perror(_("cannot open /proc/net/snmp"));
619@@ -530,6 +580,16 @@ void parsesnmp(int flag_raw, int flag_tc
620
621 fclose(f);
622 }
623+
624+ f = fopen("/proc/net/sctp/snmp", "r");
625+ if (f) {
626+ process_fd2(f,"/proc/net/sctp/snmp");
627+ if (ferror(f))
628+ perror("/proc/net/sctp/snmp");
629+
630+ fclose(f);
631+ }
632+
633 return;
634 }
635
diff --git a/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch b/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch
deleted file mode 100644
index d34e651327..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 14287b594e1f02b811f889fb515c1a51b72c08d4 Mon Sep 17 00:00:00 2001
2From: Li Zhou <li.zhou@windriver.com>
3Date: Thu, 14 Jan 2016 17:07:48 +0800
4Subject: [PATCH 2/3] net-tools: add SCTP support for netstat
5
6Upstream-Status: pending
7
8Signed-off-by: Li Zhou <li.zhou@windriver.com>
9---
10 netstat.c | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/netstat.c b/netstat.c
14index 5d1a4a1..56a15c2 100644
15--- a/netstat.c
16+++ b/netstat.c
17@@ -2104,7 +2104,7 @@ int main
18 usage();
19
20 if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
21- flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
22+ flag_tcp = flag_udp = flag_raw = 1;
23
24 if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
25 flag_inet = flag_inet6 = 1;
26--
271.8.5.2.233.g932f7e4
28
diff --git a/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch b/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch
deleted file mode 100644
index 8b2ecab707..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch
+++ /dev/null
@@ -1,363 +0,0 @@
1From 1d386279a449a1a6b96b88a71f35bf13b14b2c2c Mon Sep 17 00:00:00 2001
2From: Li Zhou <li.zhou@windriver.com>
3Date: Thu, 14 Jan 2016 17:11:24 +0800
4Subject: [PATCH 3/3] net-tools: add SCTP support for netstat
5
6Upstream-Status: pending
7
8Signed-off-by: Li Zhou <li.zhou@windriver.com>
9---
10 netstat.c | 282 ++++++++++++++++++++++++--------------------------------------
11 1 file changed, 108 insertions(+), 174 deletions(-)
12
13diff --git a/netstat.c b/netstat.c
14index 56a15c2..86adadb 100644
15--- a/netstat.c
16+++ b/netstat.c
17@@ -1095,23 +1095,21 @@ static void sctp_eps_do_one(int lnr, char *line)
18 const char *lport_str;
19 const char *uid_str;
20 const char *inode_str;
21- const char *pladdr_str;
22 char *laddrs_str;
23
24 if(lnr == 0) {
25- /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/
26+ /* ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS */
27 return;
28 }
29
30- strtok(line," \t\n"); /*skip ptr*/
31- strtok(0," \t\n"); /*skip ptr*/
32+ strtok(line," \t\n"); /*skip endpt*/
33+ strtok(0," \t\n"); /*skip sock*/
34 sty_str = strtok(0," \t\n");
35 sst_str = strtok(0," \t\n");
36 strtok(0," \t\n"); /*skip hash bucket*/
37 lport_str=strtok(0," \t\n");
38 uid_str = strtok(0," \t\n");
39 inode_str = strtok(0," \t\n");
40- pladdr_str = strtok(0," \t\n");
41 laddrs_str=strtok(0,"\t\n");
42
43 type = atoi(sty_str);
44@@ -1119,61 +1117,35 @@ static void sctp_eps_do_one(int lnr, char *line)
45 port = atoi(lport_str);
46 uid = atoi(uid_str);
47 inode = strtoul(inode_str,0,0);
48-
49- if(flag_sctp<=1) {
50- /* only print the primary address */
51- char local_addr[64];
52- char local_port[16];
53-
54- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
55- if(ap)
56- safe_strncpy(local_addr,
57- ap->sprint((struct sockaddr *) &localaddr, flag_not),
58- sizeof(local_addr));
59- else
60- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
61-
62- snprintf(local_port, sizeof(local_port), "%s",
63- get_sname(htons(port), "sctp",
64- flag_not & FLAG_NUM_PORT));
65-
66- printf("sctp ");
67- sprintf(buffer,"%s:%s", local_addr, local_port);
68- printf("%-47s", buffer);
69- printf(" %-12s", sctp_socket_state_str(state));
70- } else {
71- /*print all addresses*/
72- const char *this_local_addr;
73- int first=1;
74- char local_port[16];
75- snprintf(local_port, sizeof(local_port), "%s",
76- get_sname(htons(port), "sctp",
77- flag_not & FLAG_NUM_PORT));
78- for(this_local_addr=strtok(laddrs_str," \t\n");
79- this_local_addr;
80- this_local_addr=strtok(0," \t\n"))
81- {
82- char local_addr[64];
83- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
84- if(ap)
85- safe_strncpy(local_addr,
86- ap->sprint((struct sockaddr *) &localaddr, flag_not),
87- sizeof(local_addr));
88- else
89- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
90
91- if(!first) printf("\n");
92- if(first)
93- printf("sctp ");
94- else
95- printf(" ");
96- sprintf(buffer,"%s:%s", local_addr, local_port);
97- printf("%-47s", buffer);
98- printf(" %-12s", first?sctp_socket_state_str(state):"");
99- first = 0;
100- }
101+ const char *this_local_addr;
102+ int first=1;
103+ char local_port[16];
104+ snprintf(local_port, sizeof(local_port), "%s",
105+ get_sname(htons(port), "sctp", flag_not & FLAG_NUM_PORT));
106+ for(this_local_addr=strtok(laddrs_str," \t\n");
107+ this_local_addr;
108+ this_local_addr=strtok(0," \t\n"))
109+ {
110+ char local_addr[64];
111+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
112+ if(ap)
113+ safe_strncpy(local_addr,
114+ ap->sprint((struct sockaddr *) &localaddr, flag_not),
115+ sizeof(local_addr));
116+ else
117+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
118+
119+ if(!first) printf("\n");
120+ if(first)
121+ printf("sctp ");
122+ else
123+ printf(" ");
124+ sprintf(buffer,"%s:%s", local_addr, local_port);
125+ printf("%-55s", buffer);
126+ printf(" %-12s", first?sctp_socket_state_str(state):"");
127+ first = 0;
128 }
129-
130 finish_this_one(uid,inode,"");
131 }
132
133@@ -1199,32 +1171,29 @@ static void sctp_assoc_do_one(int lnr, char *line)
134 const char *lport_str,*rport_str;
135 const char *uid_str;
136 const char *inode_str;
137- const char *pladdr_str;
138 char *laddrs_str;
139- const char *praddr_str;
140 char *raddrs_str;
141-
142+
143 if(lnr == 0) {
144- /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/
145+ /* ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS */
146 return;
147 }
148-
149- strtok(line," \t\n"); /*skip ptr*/
150- strtok(0," \t\n"); /*skip ptr*/
151+
152+ strtok(line," \t\n"); /*skip assoc*/
153+ strtok(0," \t\n"); /*skip sock*/
154 sty_str = strtok(0," \t\n");
155 sst_str = strtok(0," \t\n");
156 st_str = strtok(0," \t\n");
157 strtok(0," \t\n"); /*skip hash bucket*/
158+ strtok(0," \t\n"); /*skip hash assoc-id*/
159 txqueue_str = strtok(0," \t\n");
160 rxqueue_str = strtok(0," \t\n");
161 uid_str = strtok(0," \t\n");
162 inode_str = strtok(0," \t\n");
163 lport_str=strtok(0," \t\n");
164 rport_str=strtok(0," \t\n");
165- pladdr_str = strtok(0," \t\n");
166- praddr_str = strtok(0," \t\n");
167- laddrs_str=strtok(0,"<->\t\n");
168- raddrs_str=strtok(0,"<->\t\n");
169+ laddrs_str = strtok(0,"<->\t\n");
170+ raddrs_str = strtok(0,"<->\t\n");
171
172 type = atoi(sty_str);
173 state = atoi(sst_str);
174@@ -1235,116 +1204,81 @@ static void sctp_assoc_do_one(int lnr, char *line)
175 inode = strtoul(inode_str,0,0);
176 lport = atoi(lport_str);
177 rport = atoi(rport_str);
178-
179- if(flag_sctp<=1) {
180- /* only print the primary addresses */
181- char local_addr[64];
182- char local_port[16];
183- char remote_addr[64];
184- char remote_port[16];
185-
186- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
187- if(ap)
188- safe_strncpy(local_addr,
189- ap->sprint((struct sockaddr *) &localaddr, flag_not),
190- sizeof(local_addr));
191- else
192- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
193-
194- snprintf(local_port, sizeof(local_port), "%s",
195- get_sname(htons(lport), "sctp",
196- flag_not & FLAG_NUM_PORT));
197-
198- ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr);
199- if(ap)
200- safe_strncpy(remote_addr,
201- ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
202- sizeof(remote_addr));
203- else
204- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
205-
206- snprintf(remote_port, sizeof(remote_port), "%s",
207- get_sname(htons(rport), "sctp",
208- flag_not & FLAG_NUM_PORT));
209-
210- printf("sctp");
211- printf(" %6u %6u ", rxqueue, txqueue);
212- sprintf(buffer,"%s:%s", local_addr, local_port);
213- printf("%-23s", buffer);
214- printf(" ");
215- sprintf(buffer,"%s:%s", remote_addr, remote_port);
216- printf("%-23s", buffer);
217- printf(" %-12s", sctp_socket_state_str(state));
218- } else {
219- /*print all addresses*/
220- const char *this_local_addr;
221- const char *this_remote_addr;
222- char *ss1,*ss2;
223- int first=1;
224- char local_port[16];
225- char remote_port[16];
226- snprintf(local_port, sizeof(local_port), "%s",
227- get_sname(htons(lport), "sctp",
228- flag_not & FLAG_NUM_PORT));
229- snprintf(remote_port, sizeof(remote_port), "%s",
230- get_sname(htons(rport), "sctp",
231- flag_not & FLAG_NUM_PORT));
232-
233- this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
234- this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
235- while(this_local_addr || this_remote_addr) {
236- char local_addr[64];
237- char remote_addr[64];
238- if(this_local_addr) {
239- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
240- if(ap)
241- safe_strncpy(local_addr,
242- ap->sprint((struct sockaddr *) &localaddr, flag_not),
243- sizeof(local_addr));
244- else
245- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
246- }
247- if(this_remote_addr) {
248- ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
249- if(ap)
250- safe_strncpy(remote_addr,
251- ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
252- sizeof(remote_addr));
253- else
254- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
255- }
256
257- if(!first) printf("\n");
258- if(first)
259- printf("sctp %6u %6u ", rxqueue, txqueue);
260- else
261- printf(" ");
262- if(this_local_addr) {
263- if(first)
264- sprintf(buffer,"%s:%s", local_addr, local_port);
265+ /*print all addresses*/
266+ const char *this_local_addr;
267+ const char *this_remote_addr;
268+ char *ss1,*ss2;
269+ int first=1;
270+ char local_port[16];
271+ char remote_port[16];
272+ snprintf(local_port, sizeof(local_port), "%s",
273+ get_sname(htons(lport), "sctp",
274+ flag_not & FLAG_NUM_PORT));
275+ snprintf(remote_port, sizeof(remote_port), "%s",
276+ get_sname(htons(rport), "sctp",
277+ flag_not & FLAG_NUM_PORT));
278+
279+ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
280+ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
281+ while(this_local_addr || this_remote_addr) {
282+ char local_addr[64];
283+ char remote_addr[64];
284+
285+ if(this_local_addr) {
286+ if (this_local_addr[0] == '*') {
287+ /* skip * */
288+ this_local_addr++;
289+ }
290+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
291+ if(ap)
292+ safe_strncpy(local_addr,
293+ ap->sprint((struct sockaddr *) &localaddr, flag_not), sizeof(local_addr));
294 else
295- sprintf(buffer,"%s", local_addr);
296- printf("%-23s", buffer);
297- } else
298- printf("%-23s", "");
299- printf(" ");
300- if(this_remote_addr) {
301- if(first)
302- sprintf(buffer,"%s:%s", remote_addr, remote_port);
303+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
304+ }
305+ if(this_remote_addr) {
306+ if (this_remote_addr[0] == '*') {
307+ /* skip * */
308+ this_remote_addr++;
309+ }
310+ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
311+ if(ap)
312+ safe_strncpy(remote_addr,
313+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), sizeof(remote_addr));
314 else
315- sprintf(buffer,"%s", remote_addr);
316- printf("%-23s", buffer);
317- } else
318- printf("%-23s", "");
319-
320- printf(" %-12s", first?sctp_socket_state_str(state):"");
321+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
322+ }
323
324- first = 0;
325- this_local_addr=strtok_r(0," \t\n",&ss1);
326- this_remote_addr=strtok_r(0," \t\n",&ss2);
327- }
328+ if(!first) printf("\n");
329+ if(first)
330+ printf("sctp %6u %6u ", rxqueue, txqueue);
331+ else
332+ printf(" ");
333+ if(this_local_addr) {
334+ if(first)
335+ sprintf(buffer,"%s:%s", local_addr, local_port);
336+ else
337+ sprintf(buffer,"%s", local_addr);
338+ printf("%-27s", buffer);
339+ } else
340+ printf("%-27s", "");
341+ printf(" ");
342+ if(this_remote_addr) {
343+ if(first)
344+ sprintf(buffer,"%s:%s", remote_addr, remote_port);
345+ else
346+ sprintf(buffer,"%s", remote_addr);
347+ printf("%-27s", buffer);
348+ } else
349+ printf("%-27s", "");
350+
351+ printf(" %-12s", first?sctp_socket_state_str(state):"");
352+
353+ first = 0;
354+ this_local_addr=strtok_r(0," \t\n",&ss1);
355+ this_remote_addr=strtok_r(0," \t\n",&ss2);
356 }
357-
358 finish_this_one(uid,inode,"");
359 }
360
361--
3621.8.5.2.233.g932f7e4
363
diff --git a/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch b/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch
deleted file mode 100644
index 505eeb048a..0000000000
--- a/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1From 4d56645ea144a34f7cdd3e3ede6452d81fbae251 Mon Sep 17 00:00:00 2001
2From: Randy MacLeod <Randy.MacLeod@windriver.com>
3Date: Sat, 8 Oct 2016 14:42:54 +0800
4Subject: [PATCH] iptunnel.c: include linux/ip.h to fix building with linux-4.8
5
6Fix a build error when using the linux-4.8 headers that results in:
7
8In file included from
9.../sysroots/qemuarm64/usr/include/linux/if_tunnel.h:6:0,
10 from iptunnel.c:39:
11.../qemuarm64/usr/include/linux/ip.h:85:8: error: redefinition of
12'struct iphdr'
13 struct iphdr {
14 ^~~~~
15In file included from iptunnel.c:29:0:
16.../qemuarm64/usr/include/netinet/ip.h:44:8: note: originally defined here
17 struct iphdr
18 ^~~~~
19
20Upstream-Status: Submitted [1]
21
22[1] https://sourceforge.net/p/net-tools/mailman/message/35413022/
23
24Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
25Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
26---
27 iptunnel.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30diff --git a/iptunnel.c b/iptunnel.c
31index 4943d83..acfcbc7 100644
32--- a/iptunnel.c
33+++ b/iptunnel.c
34@@ -26,7 +26,6 @@
35 #include <sys/socket.h>
36 #include <sys/ioctl.h>
37 #include <netinet/in.h>
38-#include <netinet/ip.h>
39 #include <arpa/inet.h>
40 #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
41 #include <net/if.h>
42@@ -36,6 +35,7 @@
43 #include <linux/if_arp.h>
44 #endif
45 #include <linux/types.h>
46+#include <linux/ip.h>
47 #include <linux/if_tunnel.h>
48
49 #include "config.h"
50--
512.8.3
52
diff --git a/meta/recipes-extended/net-tools/net-tools_1.60-20181103.bb b/meta/recipes-extended/net-tools/net-tools_1.60-20181103.bb
new file mode 100644
index 0000000000..dcc2218e48
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools_1.60-20181103.bb
@@ -0,0 +1,108 @@
1SUMMARY = "Basic networking tools"
2DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system"
3HOMEPAGE = "http://net-tools.berlios.de/"
4BUGTRACKER = "http://bugs.debian.org/net-tools"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7 file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba"
8
9PV = "1.60-20181103+git${SRCPV}"
10SRCREV = "0eebece8c964e3cfa8a018f42b2e7e751a7009a0"
11SRC_URI = "git://git.code.sf.net/p/net-tools/code;protocol=https \
12 file://net-tools-config.h \
13 file://net-tools-config.make \
14 file://Add_missing_headers.patch \
15 file://Bug_443075-ifconfig.c-pointtopoint_spelling.patch \
16 file://Bug_541172-netstat.c-exit-codes.patch \
17"
18
19S = "${WORKDIR}/git"
20
21inherit gettext
22
23# The Makefile is lame, no parallel build
24PARALLEL_MAKE = ""
25
26PACKAGECONFIG ??= "hostname arp serial plip"
27PACKAGECONFIG[hostname] = ""
28PACKAGECONFIG[arp] = ""
29PACKAGECONFIG[serial] = ""
30PACKAGECONFIG[plip] = ""
31
32do_configure() {
33 # net-tools has its own config mechanism requiring "make config"
34 # we pre-generate desired options and copy to source directory instead
35 cp ${WORKDIR}/net-tools-config.h ${S}/config.h
36 cp ${WORKDIR}/net-tools-config.make ${S}/config.make
37
38 if [ "${USE_NLS}" = "no" ]; then
39 sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make
40 fi
41
42 if ${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'true', 'false', d)} ; then
43 echo "#define HAVE_HOSTNAME_TOOLS 1" >> ${S}/config.h
44 echo "#define HAVE_HOSTNAME_SYMLINKS 1" >> ${S}/config.h
45 echo "HAVE_HOSTNAME_TOOLS=1" >> ${S}/config.make
46 echo "HAVE_HOSTNAME_SYMLINKS=1" >> ${S}/config.make
47 fi
48 if ${@bb.utils.contains('PACKAGECONFIG', 'arp', 'true', 'false', d)} ; then
49 echo "#define HAVE_ARP_TOOLS 1" >> ${S}/config.h
50 echo "HAVE_ARP_TOOLS=1" >> ${S}/config.make
51 fi
52 if ${@bb.utils.contains('PACKAGECONFIG', 'serial', 'true', 'false', d)} ; then
53 echo "#define HAVE_SERIAL_TOOLS 1" >> ${S}/config.h
54 echo "HAVE_SERIAL_TOOLS=1" >> ${S}/config.make
55 fi
56 if ${@bb.utils.contains('PACKAGECONFIG', 'plip', 'true', 'false', d)} ; then
57 echo "#define HAVE_PLIP_TOOLS 1" >> ${S}/config.h
58 echo "HAVE_PLIP_TOOLS=1" >> ${S}/config.make
59 fi
60}
61
62do_compile() {
63 # net-tools use COPTS/LOPTS to allow adding custom options
64 oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS"
65}
66
67do_install() {
68 # We don't need COPTS or LOPTS, but let's be consistent.
69 oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" BASEDIR=${D} INSTALLNLSDIR=${D}${datadir}/locale mandir=${mandir} install
70
71 if [ "${base_bindir}" != "/bin" ]; then
72 mkdir -p ${D}/${base_bindir}
73 mv ${D}/bin/* ${D}/${base_bindir}/
74 rmdir ${D}/bin
75 fi
76 if [ "${base_sbindir}" != "/sbin" ]; then
77 mkdir ${D}/${base_sbindir}
78 mv ${D}/sbin/* ${D}/${base_sbindir}/
79 rmdir ${D}/sbin
80 fi
81}
82
83inherit update-alternatives
84
85base_sbindir_progs = "ipmaddr iptunnel mii-tool nameif \
86 ${@bb.utils.contains('PACKAGECONFIG', 'arp', 'arp rarp', '', d)} \
87 ${@bb.utils.contains('PACKAGECONFIG', 'plip', 'plipconfig', '', d)} \
88 ${@bb.utils.contains('PACKAGECONFIG', 'serial', 'slattach', '', d)} \
89"
90base_bindir_progs = "ifconfig netstat route \
91 ${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'dnsdomainname domainname hostname nisdomainname ypdomainname', '', d)} \
92"
93
94ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
95ALTERNATIVE_${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'hostname.1 dnsdomainname.1', '', d)}"
96ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
97ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1"
98ALTERNATIVE_PRIORITY[hostname.1] = "10"
99
100python __anonymous() {
101 for prog in d.getVar('base_sbindir_progs').split():
102 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
103 for prog in d.getVar('base_bindir_progs').split():
104 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
105}
106ALTERNATIVE_PRIORITY = "100"
107
108BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
deleted file mode 100644
index 8bd30fc6d9..0000000000
--- a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
+++ /dev/null
@@ -1,132 +0,0 @@
1SUMMARY = "Basic networking tools"
2DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system"
3HOMEPAGE = "http://net-tools.berlios.de/"
4BUGTRACKER = "http://bugs.debian.org/net-tools"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
7 file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba"
8
9SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \
10 http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \
11 file://net-tools-config.h \
12 file://net-tools-config.make \
13 file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \
14 file://musl-fixes.patch \
15 file://net-tools-1.60-sctp1.patch \
16 file://net-tools-1.60-sctp2-quiet.patch \
17 file://net-tools-1.60-sctp3-addrs.patch \
18 file://0001-lib-inet6.c-INET6_rresolve-various-fixes.patch \
19 file://net-tools-fix-building-with-linux-4.8.patch \
20 file://0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch \
21 "
22
23# for this package we're mostly interested in tracking debian patches,
24# and not in the upstream version where all development has effectively stopped
25UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
26
27S = "${WORKDIR}/net-tools-1.60"
28
29SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d"
30SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5"
31
32SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9"
33SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c"
34
35# the package is taken from snapshots.debian.org; that source is static and goes stale
36# so we check the latest upstream from a directory that does get updated
37UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/"
38
39inherit gettext
40
41do_patch[depends] += "quilt-native:do_populate_sysroot"
42
43# The Makefile is lame, no parallel build
44PARALLEL_MAKE = ""
45
46# Unlike other Debian packages, net-tools *.diff.gz contains another series of
47# patches maintained by quilt. So manually apply them before applying other local
48# patches. Also remove all temp files before leaving, because do_patch() will pop
49# up all previously applied patches in the start
50nettools_do_patch() {
51 cd ${S}
52 # it's important that we only pop the existing patches when they've
53 # been applied, otherwise quilt will climb the directory tree
54 # and reverse out some completely different set of patches
55 if [ -d ${S}/patches ]; then
56 # whilst this is the default directory, doing it like this
57 # defeats the directory climbing that quilt will otherwise
58 # do; note the directory must exist to defeat this, hence
59 # the test inside which we operate
60 QUILT_PATCHES=${S}/patches quilt pop -a
61 fi
62 if [ -d ${S}/.pc-nettools ]; then
63 rm -rf ${S}/.pc
64 mv ${S}/.pc-nettools ${S}/.pc
65 QUILT_PATCHES=${S}/debian/patches quilt pop -a
66 rm -rf ${S}/.pc ${S}/debian
67 fi
68 patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff
69 QUILT_PATCHES=${S}/debian/patches quilt push -a
70 mv ${S}/.pc ${S}/.pc-nettools
71}
72
73do_unpack[cleandirs] += "${S}"
74
75# We invoke base do_patch at end, to incorporate any local patch
76python do_patch() {
77 bb.build.exec_func('nettools_do_patch', d)
78 bb.build.exec_func('patch_do_patch', d)
79}
80
81do_configure() {
82 # net-tools has its own config mechanism requiring "make config"
83 # we pre-generate desired options and copy to source directory instead
84 cp ${WORKDIR}/net-tools-config.h ${S}/config.h
85 cp ${WORKDIR}/net-tools-config.make ${S}/config.make
86
87 if [ "${USE_NLS}" = "no" ]; then
88 sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make
89 fi
90}
91
92do_compile() {
93 # net-tools use COPTS/LOPTS to allow adding custom options
94 oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS"
95}
96
97do_install() {
98 # We don't need COPTS or LOPTS, but let's be consistent.
99 oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" BASEDIR=${D} INSTALLNLSDIR=${D}${datadir}/locale mandir=${mandir} install
100
101 if [ "${base_bindir}" != "/bin" ]; then
102 mkdir -p ${D}/${base_bindir}
103 mv ${D}/bin/* ${D}/${base_bindir}/
104 rmdir ${D}/bin
105 fi
106 if [ "${base_sbindir}" != "/sbin" ]; then
107 mkdir ${D}/${base_sbindir}
108 mv ${D}/sbin/* ${D}/${base_sbindir}/
109 rmdir ${D}/sbin
110 fi
111}
112
113inherit update-alternatives
114
115base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach"
116base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
117
118ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
119ALTERNATIVE_${PN}-doc += "hostname.1 dnsdomainname.1"
120ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
121ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1"
122ALTERNATIVE_PRIORITY[hostname.1] = "10"
123
124python __anonymous() {
125 for prog in d.getVar('base_sbindir_progs').split():
126 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
127 for prog in d.getVar('base_bindir_progs').split():
128 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
129}
130ALTERNATIVE_PRIORITY = "100"
131
132BBCLASSEXTEND = "native nativesdk"