libc/resolv: Add no-debug and no-rotate options
These are simply the reverse of the debug and rotate options.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57926
libc/resolv: Reimplement the sortlist parser
When we switched from the BIND4 resolver to the BIND9 resolver, the
sortlist parser was inadvertently disabled due to a missing #define, and
nobody seemed to notice. The sorting code remained enabled in the
resolver, but there was no way to set a sort order.
Reimplement the sortlist parser, but correctly, and update the manual
accordingly. The new parser accepts IPv4 and IPv6 addresses with or
without a mask or prefix length, just like the old one, except IPv6
support was a bit wonky in the original code.
Fixes: 5342d17f09a8 ("Update the resolver in libc to BIND9's one.")
Relnotes: yes
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57925
libc/resolv: Refactor the configuration parser
This was previously all a single loop in res_init(), apart from option
parsing which we cleaned up in a previous commit. Break it out into
separate functions for reading the configuration line by line, setting
the default domain, setting the search list, and adding a nameserver
to the nameserver list. Sprinkle bounds checks and code comments all
around.
The sortlist code, which has been disabled for the past 20 years, will
be dealt with in a separate commit.
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57924
libc/resolv: Refactor the option parser
Start the loop by finding the end of the option name, the name-value
separator (if any), and the end of the option. Use those pointers to
simplify matching the option name and parsing the option value, and
validate option names and values more strictly. This means that:
* We no longer accept trailing garbage in an option name or value. For
instance, we would previously interpret “edns0123” as “edns0” and
“timeout:3xyz” as “timeout:3”. This was actually quite lucky because
we also failed to recognize the newline at the end of the option line
as a whitespace character.
* For options that take a numerical argument, we would previously accept
negative values and treat non-numerical arguments as 0, while large
numerical arguments would be capped to the option's maximum permitted
value. Now, any failure to parse the argument, including overflow,
results in the option being left unchanged.
[4 lines not shown]
resolver(5): Overhaul
* Modernize the markup
* Describe the comment syntax
* Drop obsolete advice
* Capitalize sentences
* Improve the language
* Replace no_tld_query with no-tld-query; both are supported, but all the
other multi-word options use hyphens rather than underscores.
* Add missing ENVIRONMENT section
* Redo the example
[3 lines not shown]
sound: track kqueue low watermark per-knote for mmaped channels
Use kn->kn_sdata to track the last bs->total value for each knote
attached to an mmaped channel. An event is delivered only when the total
byte counter has advanced by at least c->lw since the last delivery.
After delivery kn_sdata is updated to the current total.
Each knote tracks its own watermark independently, so multiple knotes
attached to the same mmaped channel all receive events correctly.
Non-mmap channels keep the existing level-triggered behavior via
chn_polltrigger().
MFC after: 1 week
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D57833
ibcore: Fix GID sysctl fallback formatting
When a GID table entry is empty or not yet present in the cache,
show_port_gid() falls back to printing a zero GID. Use the existing
GID_PRINT_FMT/GID_PRINT_ARGS helpers instead of Linux's %pI6 format,
which FreeBSD printf treats as a pointer followed by "I6".
This makes empty GID sysctl entries consistently report
0000:0000:0000:0000:0000:0000:0000:0000.
Tested by: Wafa Hamzah <wafah at nvidia.com> (mlx5_ib)
Reviewed by: jhb, kib
Sponsored by: NVIDIA Networking
Fixes: 6a75471dbcf0 ("OFED: Various changes from Linux 4.19")
Differential Revision: https://reviews.freebsd.org/D58042
gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd
After the conversion to using netlink, the kgssapi had
no way of knowing if the gssd daemon was running.
As such, a boot where the kgssapi is loaded, but the
gssd is not enabled would hang the nfsd for a very
long time. (Many timeouts at 300sec each.)
This patch adds a Null RPC upcall with a 200msec
timeout to check to see if the gssd is running.
If the gssd is not running, the nfsd starts up
(without Kerberos support) with only a 200msec
delay.)
Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c
to before the daemon() call, so they are guaranteed to have
been done before the nfsd(8) daemon is started by
the rc scripts.
[3 lines not shown]