freebsd-dev/share
Alexander V. Chernikov f4d3aa7490 netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent
Netlink has a confirmation/error reporting mechanism for the sent
messages. Kernel explicitly acks each messages if requested (NLM_F_ACK)
 or if message processing results in an error.
Similarly, for multipart messages - typically dumps, where each message
 represents a single object like an interface or a route - another
 message, NLMSG_DONE is used to indicate the end of dump and the
 resulting status.
As a result, successfull dump ends with both NLMSG_DONE and NLMSG_ERROR
 messages.
RFC 3549 does not say anything specific about such case.
Linux adopted an optimisation which suppresses NLMSG_ERROR message
 when NLMSG_DONE is already sent. Certain libraries/applications like
 libnl depends on such behavior.

Suppress sending NLMSG_ERROR if NLMSG_DONE is already sent, by
 setting newly-added 'suppress_ack' flag in the writer and checking
 this flag when generating ack.

This change restores libnl compatibility.

Before:
```
~ nl-link-list
Error: Unable to allocate link cache: Message sequence number mismatch
````

After:
```
~ nl-link-list
vtnet0 ether 52:54:00:14:e3:19 <broadcast,multicast,up,running>
lo0 ieee1394 <loopback,multicast,up,running>
```

Reviewed by:	bapt,pauamma
Tested by:	bapt
Differential Revision: https://reviews.freebsd.org/D37565
2022-11-30 13:24:38 +00:00
..
colldef locales: fix installation of some collation files 2022-04-05 09:19:31 +02:00
colldef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
ctypedef locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
dict Add "heard" to the dictionary 2022-08-09 12:03:24 -04:00
doc usd: Fix two typos 2022-04-02 15:16:02 +02:00
dtrace dtrace: fix ipfw_rule_info_t translator 2021-09-02 16:35:01 +03:00
examples rc.sendmail: remove unused script 2022-11-09 16:55:18 +01:00
i18n share: i18n: fix mismatch in BIG5 esdb generation 2022-11-15 22:09:22 -06:00
keys pkgbase: Add a FreeBSD-pkg-bootstrap package 2021-12-21 10:17:48 +01:00
man netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent 2022-11-30 13:24:38 +00:00
misc Add corvink to the src committers and manu as my mentor 2022-11-02 16:58:00 +01:00
mk Use __freebsd_kprintf__ with GCC 12+ similar to clang. 2022-11-22 08:36:12 -08:00
monetdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
monetdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
msgdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
msgdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
numericdef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
numericdef_unicode locales: Update to CLDR 41.0 and Unicode 14.0 2022-04-21 14:16:40 +02:00
security
sendmail
skel sh(1): fix home/del key on mobaxterm env 2021-10-20 14:00:20 +02:00
snmp pkgbase: Put the mibs and defs in the bnsmp package 2021-06-19 17:50:03 +02:00
syscons Correct typos: s/mit Aksenten/mit Akzenten 2022-09-14 11:53:44 +02:00
tabset
termcap Fix mergemaster(8) breakage in the 6ad780caa. 2022-09-13 13:36:22 -07:00
tests
timedef pkgbase: locales: Also tag the files dir 2021-08-06 14:37:45 +02:00
vt Correct typos: s/mit Aksenten/mit Akzenten 2022-09-14 11:53:44 +02:00
zoneinfo share/zoneinfo: don't build obsolete SystemV zones 2022-09-25 13:54:20 +08:00
Makefile locales: now that C.UTF-8 is the default locale, always install it 2021-07-23 16:58:20 +02:00
Makefile.inc