diff --git a/gnu/share/config.guess b/gnu/share/config.guess index 385ab36f7..596c3d2f5 100644 --- a/gnu/share/config.guess +++ b/gnu/share/config.guess @@ -858,7 +858,7 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; diff --git a/gnu/share/config.if b/gnu/share/config.if index bcc026908..5c4b3c234 100644 --- a/gnu/share/config.if +++ b/gnu/share/config.if @@ -55,9 +55,9 @@ then then dummy=if$$ cat >$dummy.c < +#include main(argc, argv) - int argc; + int argc; char *argv[]; { printf("%d\n", __GLIBC_MINOR__); diff --git a/gnu/share/configure b/gnu/share/configure index ea808d83e..a3d5e644a 100644 --- a/gnu/share/configure +++ b/gnu/share/configure @@ -10,12 +10,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -27,7 +27,7 @@ # preparation for compilation. # # If configure succeeds, it leaves its status in config.status. -# If configure fails after disturbing the status quo, +# If configure fails after disturbing the status quo, # config.status is removed. # @@ -188,7 +188,7 @@ do --*) ;; -*) option=-$option ;; esac - + # Split out the argument for options that take them case $option in --*=*) @@ -790,7 +790,7 @@ tooldir='$(exec_prefix)'/${target_alias} if [ "${host_alias}" != "${target_alias}" ] ; then if [ "${program_prefixoption}" = "" ] ; then - if [ "${program_suffixoption}" = "" ] ; then + if [ "${program_suffixoption}" = "" ] ; then if [ "${program_transform_nameoption}" = "" ] ; then program_prefix=${target_alias}- ; fi @@ -1144,7 +1144,7 @@ for subdir in . ${subdirs} ; do if [ ! -r ${srcdir}/${file} ] ; then if [ ! -r ${file} ] ; then - + echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2 exit 1 @@ -1160,7 +1160,7 @@ for subdir in . ${subdirs} ; do if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then true else - # We need to re-remove the file because Lynx leaves a + # We need to re-remove the file because Lynx leaves a # very strange directory there when it fails an NFS symlink. ${remove} -r -f ${link} ${hard_link} ${srcfile} ${link} @@ -1198,7 +1198,7 @@ EOF # code is order so as to try to sed the smallest input files we know. # so do these separately because I don't trust the order of sed -e expressions. - # the five makefile fragments MUST end up in the resulting Makefile in this order: + # the five makefile fragments MUST end up in the resulting Makefile in this order: # package macros, target, host, site, and package rules. if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then @@ -1422,7 +1422,7 @@ EOF -e "s:^DEFAULT_LEX[ ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \ -e "s:^DEFAULT_M4[ ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \ ${subdir}/Makefile.tem >> ${Makefile} - + sed -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem mv -f ${Makefile}.tem ${Makefile} @@ -1507,7 +1507,7 @@ ${progname}" ${arguments} " done # If there are subdirectories, then recur. -if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then +if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then for configdir in ${configdirs} ${extraconfigdirs} ; do # If configdir contains ',' it is @@ -1541,7 +1541,7 @@ if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then esac POPDIR=${PWD=`pwd`} - cd ${bld_dir} + cd ${bld_dir} ### figure out what to do with srcdir case "${srcdir}" in diff --git a/gnu/share/install-sh b/gnu/share/install-sh index e9de23842..eed95e3ec 100644 --- a/gnu/share/install-sh +++ b/gnu/share/install-sh @@ -115,7 +115,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: chmodcmd="" @@ -125,7 +125,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -135,7 +135,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -202,17 +202,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -243,7 +243,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/gnu/share/ltconfig b/gnu/share/ltconfig index 6b6134524..da06c6180 100644 --- a/gnu/share/ltconfig +++ b/gnu/share/ltconfig @@ -777,7 +777,7 @@ if test -n "$pic_flag"; then if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 - + case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they @@ -937,7 +937,7 @@ if test "$with_gcc" = yes; then else no_builtin_flag=' -fno-builtin' fi - + fi # Check for any special shared library compilation flags. @@ -1183,7 +1183,7 @@ EOF $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' - old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' + old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) @@ -1215,7 +1215,7 @@ EOF else ld_shlibs=no fi - ;; + ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' @@ -1469,8 +1469,8 @@ else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' @@ -1867,7 +1867,7 @@ cygwin* | mingw*) freebsd1*) dynamic_linker=no ;; - + freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat @@ -2429,10 +2429,10 @@ fi fi - + fi - + fi @@ -2538,7 +2538,7 @@ else fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null @@ -2611,7 +2611,7 @@ else fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null diff --git a/gnu/share/ltmain.sh b/gnu/share/ltmain.sh index c32939ee8..ac5ef0222 100644 --- a/gnu/share/ltmain.sh +++ b/gnu/share/ltmain.sh @@ -696,29 +696,29 @@ compiler." # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999 Free Software Foundation, Inc. -# +# # This file is part of GNU libtool. -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ -# +# # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ -# +# # static unsigned int # pe_get16 (fd, offset) # int fd; @@ -729,7 +729,7 @@ compiler." # read (fd, b, 2); # return b[0] + (b[1]<<8); # } -# +# # static unsigned int # pe_get32 (fd, offset) # int fd; @@ -740,7 +740,7 @@ compiler." # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } -# +# # static unsigned int # pe_as32 (ptr) # void *ptr; @@ -748,7 +748,7 @@ compiler." # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } -# +# # int # main (argc, argv) # int argc; @@ -760,32 +760,32 @@ compiler." # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; -# +# # filename = argv[1]; -# +# # dll = open(filename, O_RDONLY|O_BINARY); # if (!dll) # return 1; -# +# # dll_name = filename; -# +# # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; -# +# # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); -# +# # if (num_entries < 1) /* no exports */ # return 1; -# +# # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); -# +# # expptr = 0; # for (i = 0; i < nsections; i++) # { @@ -804,22 +804,22 @@ compiler." # break; # } # } -# +# # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; -# +# # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); -# +# # printf ("EXPORTS\n"); # for (i = 0; i/dev/null \ | grep " -> " >/dev/null; then - continue + continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. @@ -2051,7 +2051,7 @@ EOF library_names= old_library= dlname= - + # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Get the real and link names of the library. @@ -2250,7 +2250,7 @@ EOF gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec - wl= + wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then @@ -2378,9 +2378,9 @@ EOF if test "$dlopen" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi + fi fi - + if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do @@ -2544,7 +2544,7 @@ extern \"C\" { $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi - + if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' @@ -2687,7 +2687,7 @@ static const void *lt_preloaded_setup() { $show "$link_command" $run eval "$link_command" status=$? - + # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" @@ -2747,7 +2747,7 @@ static const void *lt_preloaded_setup() { # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" - + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else @@ -2767,7 +2767,7 @@ static const void *lt_preloaded_setup() { # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - + # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname @@ -2880,7 +2880,7 @@ else echo >> $output "\ program=lt-'$outputname' progdir=\"\$thisdir/$objdir\" - + if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then @@ -3011,7 +3011,7 @@ fi\ exit $status fi generated="$generated $gentop" - + # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. diff --git a/gnu/usr.bin/perl/Configure b/gnu/usr.bin/perl/Configure index 984b93808..94f22d38d 100644 --- a/gnu/usr.bin/perl/Configure +++ b/gnu/usr.bin/perl/Configure @@ -4100,7 +4100,7 @@ while test "$type"; do for fp in $gfpth; do if test "X$fp" = X.; then pf="$ansexp" - else + else pf="$fp/$ansexp" fi if test -f "$pf"; then @@ -4121,7 +4121,7 @@ while test "$type"; do if test "X$fp" = X.; then dir="$ans" direxp="$ansexp" - else + else dir="$fp/$ansexp" direxp="$fp/$ansexp" fi @@ -15773,7 +15773,7 @@ set gettimeofday d_gettimeod eval $inlibc case "$d_gettimeod" in "$undef") - set ftime d_ftime + set ftime d_ftime eval $inlibc ;; *) diff --git a/lib/libcrypto/cms/cms_sd.c b/lib/libcrypto/cms/cms_sd.c index 89ba5bf01..245822971 100644 --- a/lib/libcrypto/cms/cms_sd.c +++ b/lib/libcrypto/cms/cms_sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cms_sd.c,v 1.26 2023/07/08 08:26:26 beck Exp $ */ +/* $OpenBSD: cms_sd.c,v 1.28 2023/09/11 09:29:30 tb Exp $ */ /* * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. @@ -256,16 +256,16 @@ static int cms_sd_asn1_ctrl(CMS_SignerInfo *si, int cmd) { EVP_PKEY *pkey = si->pkey; - int i; + int ret; - if (!pkey->ameth || !pkey->ameth->pkey_ctrl) + if (pkey->ameth == NULL || pkey->ameth->pkey_ctrl == NULL) return 1; - i = pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_CMS_SIGN, cmd, si); - if (i == -2) { + ret = pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_CMS_SIGN, cmd, si); + if (ret == -2) { CMSerror(CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); return 0; } - if (i <= 0) { + if (ret <= 0) { CMSerror(CMS_R_CTRL_FAILURE); return 0; } @@ -721,119 +721,113 @@ cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain) int CMS_SignerInfo_sign(CMS_SignerInfo *si) { - EVP_MD_CTX *mctx = si->mctx; - EVP_PKEY_CTX *pctx = NULL; - unsigned char *abuf = NULL; - int alen; - size_t siglen; - const EVP_MD *md = NULL; + const EVP_MD *md; + unsigned char *buf = NULL, *sig = NULL; + int buf_len = 0; + size_t sig_len = 0; + int ret = 0; - md = EVP_get_digestbyobj(si->digestAlgorithm->algorithm); - if (md == NULL) - return 0; + if ((md = EVP_get_digestbyobj(si->digestAlgorithm->algorithm)) == NULL) + goto err; if (CMS_signed_get_attr_by_NID(si, NID_pkcs9_signingTime, -1) < 0) { if (!cms_add1_signingTime(si, NULL)) goto err; } - if (si->pctx) - pctx = si->pctx; - else { - EVP_MD_CTX_reset(mctx); - if (EVP_DigestSignInit(mctx, &pctx, md, NULL, si->pkey) <= 0) + if (si->pctx == NULL) { + EVP_MD_CTX_reset(si->mctx); + if (!EVP_DigestSignInit(si->mctx, &si->pctx, md, NULL, si->pkey)) goto err; - si->pctx = pctx; } - if (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN, + if (EVP_PKEY_CTX_ctrl(si->pctx, -1, EVP_PKEY_OP_SIGN, EVP_PKEY_CTRL_CMS_SIGN, 0, si) <= 0) { CMSerror(CMS_R_CTRL_ERROR); goto err; } - alen = ASN1_item_i2d((ASN1_VALUE *)si->signedAttrs, &abuf, - &CMS_Attributes_Sign_it); - if (!abuf) + if ((buf_len = ASN1_item_i2d((ASN1_VALUE *)si->signedAttrs, &buf, + &CMS_Attributes_Sign_it)) <= 0) { + buf_len = 0; goto err; - if (EVP_DigestSignUpdate(mctx, abuf, alen) <= 0) + } + if (!EVP_DigestSign(si->mctx, NULL, &sig_len, buf, buf_len)) goto err; - if (EVP_DigestSignFinal(mctx, NULL, &siglen) <= 0) + if ((sig = calloc(1, sig_len)) == NULL) goto err; - free(abuf); - abuf = malloc(siglen); - if (abuf == NULL) - goto err; - if (EVP_DigestSignFinal(mctx, abuf, &siglen) <= 0) + if (!EVP_DigestSign(si->mctx, sig, &sig_len, buf, buf_len)) goto err; - if (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN, + if (EVP_PKEY_CTX_ctrl(si->pctx, -1, EVP_PKEY_OP_SIGN, EVP_PKEY_CTRL_CMS_SIGN, 1, si) <= 0) { CMSerror(CMS_R_CTRL_ERROR); goto err; } - EVP_MD_CTX_reset(mctx); + ASN1_STRING_set0(si->signature, sig, sig_len); + sig = NULL; - ASN1_STRING_set0(si->signature, abuf, siglen); - - return 1; + ret = 1; err: - free(abuf); - EVP_MD_CTX_reset(mctx); + if (si->mctx != NULL) + EVP_MD_CTX_reset(si->mctx); + freezero(buf, buf_len); + freezero(sig, sig_len); - return 0; + return ret; } LCRYPTO_ALIAS(CMS_SignerInfo_sign); int CMS_SignerInfo_verify(CMS_SignerInfo *si) { - EVP_MD_CTX *mctx = NULL; - unsigned char *abuf = NULL; - int alen, r = -1; - const EVP_MD *md = NULL; + const EVP_MD *md; + unsigned char *buf = NULL; + int buf_len = 0; + int ret = -1; - if (!si->pkey) { + if ((md = EVP_get_digestbyobj(si->digestAlgorithm->algorithm)) == NULL) + goto err; + + if (si->pkey == NULL) { CMSerror(CMS_R_NO_PUBLIC_KEY); - return -1; + goto err; } - md = EVP_get_digestbyobj(si->digestAlgorithm->algorithm); - if (md == NULL) - return -1; - if (si->mctx == NULL && (si->mctx = EVP_MD_CTX_new()) == NULL) { + if (si->mctx == NULL) + si->mctx = EVP_MD_CTX_new(); + if (si->mctx == NULL) { CMSerror(ERR_R_MALLOC_FAILURE); - return -1; + goto err; } - mctx = si->mctx; - if (EVP_DigestVerifyInit(mctx, &si->pctx, md, NULL, si->pkey) <= 0) + + if (EVP_DigestVerifyInit(si->mctx, &si->pctx, md, NULL, si->pkey) <= 0) goto err; if (!cms_sd_asn1_ctrl(si, 1)) goto err; - alen = ASN1_item_i2d((ASN1_VALUE *)si->signedAttrs, &abuf, - &CMS_Attributes_Verify_it); - if (!abuf) - goto err; - r = EVP_DigestVerifyUpdate(mctx, abuf, alen); - free(abuf); - if (r <= 0) { - r = -1; + if ((buf_len = ASN1_item_i2d((ASN1_VALUE *)si->signedAttrs, &buf, + &CMS_Attributes_Verify_it)) <= 0) { + buf_len = 0; goto err; } - r = EVP_DigestVerifyFinal(mctx, si->signature->data, - si->signature->length); - if (r <= 0) + ret = EVP_DigestVerify(si->mctx, si->signature->data, si->signature->length, + buf, buf_len); + if (ret <= 0) { CMSerror(CMS_R_VERIFICATION_FAILURE); + goto err; + } err: - EVP_MD_CTX_reset(mctx); + if (si->mctx != NULL) + EVP_MD_CTX_reset(si->mctx); + freezero(buf, buf_len); - return r; + return ret; } LCRYPTO_ALIAS(CMS_SignerInfo_verify); diff --git a/lib/libcrypto/evp/evp_enc.c b/lib/libcrypto/evp/evp_enc.c index 27f753baa..7534b4c9d 100644 --- a/lib/libcrypto/evp/evp_enc.c +++ b/lib/libcrypto/evp/evp_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_enc.c,v 1.52 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: evp_enc.c,v 1.53 2023/09/10 16:53:56 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -78,8 +78,8 @@ int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv, int enc) { - if (cipher) - EVP_CIPHER_CTX_init(ctx); + if (cipher != NULL) + EVP_CIPHER_CTX_cleanup(ctx); return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); } diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index c53f38f92..23ec8e603 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.36 2023/09/02 04:15:39 tb Exp $ */ +/* $OpenBSD: p_lib.c,v 1.37 2023/09/10 17:32:17 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -449,13 +449,14 @@ EVP_PKEY_get0_RSA(EVP_PKEY *pkey) RSA * EVP_PKEY_get1_RSA(EVP_PKEY *pkey) { - if (pkey->type == EVP_PKEY_RSA || pkey->type == EVP_PKEY_RSA_PSS) { - RSA_up_ref(pkey->pkey.rsa); - return pkey->pkey.rsa; - } + RSA *rsa; - EVPerror(EVP_R_EXPECTING_AN_RSA_KEY); - return NULL; + if ((rsa = EVP_PKEY_get0_RSA(pkey)) == NULL) + return NULL; + + RSA_up_ref(rsa); + + return rsa; } int @@ -482,12 +483,14 @@ EVP_PKEY_get0_DSA(EVP_PKEY *pkey) DSA * EVP_PKEY_get1_DSA(EVP_PKEY *pkey) { - if (pkey->type != EVP_PKEY_DSA) { - EVPerror(EVP_R_EXPECTING_A_DSA_KEY); + DSA *dsa; + + if ((dsa = EVP_PKEY_get0_DSA(pkey)) == NULL) return NULL; - } - DSA_up_ref(pkey->pkey.dsa); - return pkey->pkey.dsa; + + DSA_up_ref(dsa); + + return dsa; } int @@ -514,12 +517,14 @@ EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) EC_KEY * EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) { - if (pkey->type != EVP_PKEY_EC) { - EVPerror(EVP_R_EXPECTING_A_EC_KEY); + EC_KEY *key; + + if ((key = EVP_PKEY_get0_EC_KEY(pkey)) == NULL) return NULL; - } - EC_KEY_up_ref(pkey->pkey.ec); - return pkey->pkey.ec; + + EC_KEY_up_ref(key); + + return key; } int @@ -547,12 +552,14 @@ EVP_PKEY_get0_DH(EVP_PKEY *pkey) DH * EVP_PKEY_get1_DH(EVP_PKEY *pkey) { - if (pkey->type != EVP_PKEY_DH) { - EVPerror(EVP_R_EXPECTING_A_DH_KEY); + DH *dh; + + if ((dh = EVP_PKEY_get0_DH(pkey)) == NULL) return NULL; - } - DH_up_ref(pkey->pkey.dh); - return pkey->pkey.dh; + + DH_up_ref(dh); + + return dh; } int diff --git a/lib/libcrypto/man/BIO_f_base64.3 b/lib/libcrypto/man/BIO_f_base64.3 index bbb68cf74..e4589de03 100644 --- a/lib/libcrypto/man/BIO_f_base64.3 +++ b/lib/libcrypto/man/BIO_f_base64.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: BIO_f_base64.3,v 1.14 2023/09/10 11:20:52 schwarze Exp $ +.\" $OpenBSD: BIO_f_base64.3,v 1.15 2023/09/11 04:00:40 jsg Exp $ .\" OpenSSL fc1d88f0 Wed Jul 2 22:42:40 2014 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,14 +49,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 10 2023 $ +.Dd $Mdocdate: September 11 2023 $ .Dt BIO_F_BASE64 3 .Os .Sh NAME .Nm BIO_f_base64 .\" .Nm EVP_ENCODE_LENGTH and .\" .Nm EVP_DECODE_LENGTH are intentionally undocumented -.\" because they are internal implemention details of BIO_f_base64(3) +.\" because they are internal implementation details of BIO_f_base64(3) .\" and practically unused outside evp/bio_b64.c. .Nd base64 BIO filter .Sh SYNOPSIS diff --git a/lib/libcrypto/x509/x509_addr.c b/lib/libcrypto/x509/x509_addr.c index 735891fd2..a0da2af6f 100644 --- a/lib/libcrypto/x509/x509_addr.c +++ b/lib/libcrypto/x509/x509_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_addr.c,v 1.88 2023/09/06 15:53:07 job Exp $ */ +/* $OpenBSD: x509_addr.c,v 1.89 2023/09/11 00:50:47 job Exp $ */ /* * Contributed to the OpenSSL Project by the American Registry for * Internet Numbers ("ARIN"). @@ -676,10 +676,9 @@ i2r_IPAddrBlocks(const X509V3_EXT_METHOD *method, void *ext, BIO *out, { const IPAddrBlocks *addr = ext; IPAddressFamily *af; - uint16_t afi = 0; - uint8_t safi = 0; - int safi_is_set = 0; - int i; + uint16_t afi; + uint8_t safi; + int i, safi_is_set; for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { af = sk_IPAddressFamily_value(addr, i); diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index 98c5f4722..9cd19b5ee 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.160 2023/04/18 09:57:51 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.161 2023/09/11 06:00:23 florian Exp $ */ /* @@ -920,6 +920,8 @@ resolve_done(struct uw_resolver *res, void *arg, int rcode, uint8_t *p, *data; uint8_t answer_imsg[MAX_IMSGSIZE - IMSG_HEADER_SIZE]; + log_debug("%s: %d", __func__, rcode); + clock_gettime(CLOCK_MONOTONIC, &tp); query_imsg = (struct query_imsg *)arg; @@ -1074,14 +1076,17 @@ resolve_done(struct uw_resolver *res, void *arg, int rcode, goto out; servfail: + log_debug("%s: foo: 1", __func__); /* try_next_resolver() might free rq */ if (try_next_resolver(rq) != 0 && running_res == 0) { /* we are the last one, send SERVFAIL */ answer_header->srvfail = 1; + log_debug("%s: foo: 2", __func__); resolver_imsg_compose_frontend(IMSG_ANSWER, 0, answer_imsg, sizeof(*answer_header)); } out: + log_debug("%s: foo: 3", __func__); free(query_imsg); sldns_buffer_free(buf); regional_destroy(region); diff --git a/share/man/man4/man4.arm64/aplns.4 b/share/man/man4/man4.arm64/aplns.4 index a6721f281..408603634 100644 --- a/share/man/man4/man4.arm64/aplns.4 +++ b/share/man/man4/man4.arm64/aplns.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: aplns.4,v 1.1 2021/05/28 04:49:44 dlg Exp $ +.\" $OpenBSD: aplns.4,v 1.2 2023/09/11 04:21:30 jsg Exp $ .\" .\" Copyright (c) 2021 David Gwynne .\" @@ -14,19 +14,19 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 28 2021 $ +.Dd $Mdocdate: September 11 2023 $ .Dt APLNS 4 arm64 .Os .Sh NAME .Nm aplns -.Nd Apple NVME Storage controller +.Nd Apple NVMe Storage controller .Sh SYNOPSIS .Cd "aplns* at fdt?" .Cd "nvme* at aplns?" .Sh DESCRIPTION The .Nm -driver provides support for the NVME Storage controller found on +driver provides support for the NVMe Storage controller found on various Apple SoCs. .Sh SEE ALSO .Xr intro 4 , diff --git a/share/man/man4/man4.i386/ie.4 b/share/man/man4/man4.i386/ie.4 index 996bb5305..38d789492 100644 --- a/share/man/man4/man4.i386/ie.4 +++ b/share/man/man4/man4.i386/ie.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ie.4,v 1.16 2008/09/07 06:55:35 jmc Exp $ +.\" $OpenBSD: ie.4,v 1.17 2023/09/11 04:56:31 jsg Exp $ .\" .\" Copyright (c) 1994 James A. Jegers .\" All rights reserved. @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 7 2008 $ +.Dd $Mdocdate: September 11 2023 $ .Dt IE 4 i386 .Os .Sh NAME @@ -41,7 +41,7 @@ This includes the following network adapters: .It 3Com 3C507 .It AT&T StarLAN 10 .It AT&T EN100 -.It AT&T StarLan Fiber +.It AT&T StarLAN Fiber .It Intel EtherExpress 16 .El .Pp diff --git a/share/man/man4/neo.4 b/share/man/man4/neo.4 index 6d0bb6494..3a09414ec 100644 --- a/share/man/man4/neo.4 +++ b/share/man/man4/neo.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: neo.4,v 1.13 2007/05/31 19:19:51 jmc Exp $ +.\" $OpenBSD: neo.4,v 1.14 2023/09/11 05:07:34 jsg Exp $ .\" .\" Copyright (c) 1998 Constantine Paul Sapuntzakis .\" All rights reserved @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: September 11 2023 $ .Dt NEO 4 .Os .Sh NAME @@ -61,7 +61,7 @@ The device driver appeared in .Ox 2.7 . .Sh BUGS -This driver has some bugs because Neomagic refuses to provide documentation, +This driver has some bugs because NeoMagic refuses to provide documentation, even though they are discontinuing their products. At the time of contact, all persons working at the company were hiding behind their receptionist as if in a stage of siege. diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index d219ba4c4..f19448cfd 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -36,7 +36,7 @@ umask 007 if [ ! -r version -o ! -s version ] then - echo 1337 > version + echo 0 > version fi touch version diff --git a/sys/dev/eisa/if_ep_eisa.c b/sys/dev/eisa/if_ep_eisa.c index 2b5a318fe..6b3458ab6 100644 --- a/sys/dev/eisa/if_ep_eisa.c +++ b/sys/dev/eisa/if_ep_eisa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_eisa.c,v 1.28 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_ep_eisa.c,v 1.29 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_ep_eisa.c,v 1.13 1997/04/18 00:50:33 cgd Exp $ */ /* @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/fdt/rkdrm.c b/sys/dev/fdt/rkdrm.c index 824ce1245..2680709b2 100644 --- a/sys/dev/fdt/rkdrm.c +++ b/sys/dev/fdt/rkdrm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rkdrm.c,v 1.16 2023/09/10 06:25:09 jsg Exp $ */ +/* $OpenBSD: rkdrm.c,v 1.17 2023/09/11 04:51:24 jsg Exp $ */ /* $NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -47,9 +47,6 @@ #define RK_DRM_MAX_WIDTH 3840 #define RK_DRM_MAX_HEIGHT 2160 -TAILQ_HEAD(, rkdrm_ports) rkdrm_ports = - TAILQ_HEAD_INITIALIZER(rkdrm_ports); - int rkdrm_match(struct device *, void *, void *); void rkdrm_attach(struct device *, struct device *, void *); void rkdrm_attachhook(struct device *); diff --git a/sys/dev/fdt/rkdrm.h b/sys/dev/fdt/rkdrm.h index 380f996a8..b7aed7b37 100644 --- a/sys/dev/fdt/rkdrm.h +++ b/sys/dev/fdt/rkdrm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rkdrm.h,v 1.3 2023/01/01 01:34:33 jsg Exp $ */ +/* $OpenBSD: rkdrm.h,v 1.4 2023/09/11 04:51:24 jsg Exp $ */ /* $NetBSD: rk_drm.h,v 1.1 2019/11/09 23:30:14 jmcneill Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -86,12 +86,6 @@ struct rkdrm_framebuffer { struct drm_gem_dma_object *obj; }; -struct rkdrm_ports { - int phandle; - struct drm_device *ddev; - TAILQ_ENTRY(rkdrm_ports) entries; -}; - struct rkdrm_fbdev { struct drm_fb_helper helper; }; diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index 8847252d5..fbbac2b07 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.95 2023/07/13 07:31:12 jsg Exp $ */ +/* $OpenBSD: aac.c,v 1.96 2023/09/11 12:10:47 mvs Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -53,7 +53,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/ic/aacvar.h b/sys/dev/ic/aacvar.h index 2faaca6d0..5fda8b34d 100644 --- a/sys/dev/ic/aacvar.h +++ b/sys/dev/ic/aacvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aacvar.h,v 1.17 2023/07/13 07:31:12 jsg Exp $ */ +/* $OpenBSD: aacvar.h,v 1.18 2023/09/11 08:40:25 mvs Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -395,7 +395,6 @@ struct aac_softc struct aac_aif_command aac_aifq[AAC_AIFQ_LENGTH]; int aac_aifq_head; int aac_aifq_tail; - struct selinfo aac_select; struct proc *aifthread; int aifflags; #define AAC_AIFFLAGS_RUNNING (1 << 0) diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 41b4f4bc0..a1b494096 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.177 2023/05/23 16:39:29 denis Exp $ */ +/* $OpenBSD: com.c,v 1.178 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c index 2af39ad73..fa9be26d8 100644 --- a/sys/dev/ic/cy.c +++ b/sys/dev/ic/cy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cy.c,v 1.41 2021/09/01 16:10:39 jan Exp $ */ +/* $OpenBSD: cy.c,v 1.42 2023/09/11 08:41:26 mvs Exp $ */ /* * Copyright (c) 1996 Timo Rossi. * All rights reserved. @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index bdb540bcf..4aa0ad045 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elink3.c,v 1.99 2023/04/11 00:45:08 jsg Exp $ */ +/* $OpenBSD: elink3.c,v 1.100 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */ /* @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/isa/if_ef_isapnp.c b/sys/dev/isa/if_ef_isapnp.c index d1d28341c..4f2e62c7b 100644 --- a/sys/dev/isa/if_ef_isapnp.c +++ b/sys/dev/isa/if_ef_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ef_isapnp.c,v 1.41 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_ef_isapnp.c,v 1.42 2023/09/11 08:41:26 mvs Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c index 53249f700..686eb1f2b 100644 --- a/sys/dev/isa/if_eg.c +++ b/sys/dev/isa/if_eg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_eg.c,v 1.51 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_eg.c,v 1.52 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_eg.c,v 1.26 1996/05/12 23:52:27 mycroft Exp $ */ /* @@ -47,7 +47,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/isa/if_ep_isa.c b/sys/dev/isa/if_ep_isa.c index 9ddcf3dca..b2ac7163c 100644 --- a/sys/dev/isa/if_ep_isa.c +++ b/sys/dev/isa/if_ep_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_isa.c,v 1.32 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_ep_isa.c,v 1.33 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_ep_isa.c,v 1.5 1996/05/12 23:52:36 mycroft Exp $ */ /* @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/isa/if_ep_isapnp.c b/sys/dev/isa/if_ep_isapnp.c index bb7f5b784..66fd636c3 100644 --- a/sys/dev/isa/if_ep_isapnp.c +++ b/sys/dev/isa/if_ep_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_isapnp.c,v 1.17 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_ep_isapnp.c,v 1.18 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_ep_isapnp.c,v 1.5 1996/05/12 23:52:36 mycroft Exp $ */ /* @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/isa/if_lc_isa.c b/sys/dev/isa/if_lc_isa.c index 91b0c4fb7..6e11f41ac 100644 --- a/sys/dev/isa/if_lc_isa.c +++ b/sys/dev/isa/if_lc_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lc_isa.c,v 1.14 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_lc_isa.c,v 1.15 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_lc_isa.c,v 1.10 2001/06/13 10:46:03 wiz Exp $ */ /*- @@ -42,7 +42,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/isa/if_ne_isa.c b/sys/dev/isa/if_ne_isa.c index ceda5b786..846f2f2bc 100644 --- a/sys/dev/isa/if_ne_isa.c +++ b/sys/dev/isa/if_ne_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ne_isa.c,v 1.18 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_ne_isa.c,v 1.19 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_ne_isa.c,v 1.6 1998/07/05 06:49:13 jonathan Exp $ */ /*- @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/isa/if_ne_isapnp.c b/sys/dev/isa/if_ne_isapnp.c index a7386a14c..dcba6fd0b 100644 --- a/sys/dev/isa/if_ne_isapnp.c +++ b/sys/dev/isa/if_ne_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ne_isapnp.c,v 1.17 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_ne_isapnp.c,v 1.18 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_ne_isapnp.c,v 1.7 1998/07/23 19:30:45 christos Exp $ */ /*- @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/isa/if_sm_isa.c b/sys/dev/isa/if_sm_isa.c index 57fde2b76..e2212d504 100644 --- a/sys/dev/isa/if_sm_isa.c +++ b/sys/dev/isa/if_sm_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sm_isa.c,v 1.16 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: if_sm_isa.c,v 1.17 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_sm_isa.c,v 1.4 1998/07/05 06:49:14 jonathan Exp $ */ /*- @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/pci/aac_pci.c b/sys/dev/pci/aac_pci.c index df15033af..fe2a6dfaf 100644 --- a/sys/dev/pci/aac_pci.c +++ b/sys/dev/pci/aac_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac_pci.c,v 1.27 2023/07/13 07:31:12 jsg Exp $ */ +/* $OpenBSD: aac_pci.c,v 1.28 2023/09/11 08:40:25 mvs Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -44,7 +44,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c index 56306a69b..e9f221655 100644 --- a/sys/dev/pci/auixp.c +++ b/sys/dev/pci/auixp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auixp.c,v 1.51 2022/10/26 20:19:08 kn Exp $ */ +/* $OpenBSD: auixp.c,v 1.52 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */ /* @@ -50,7 +50,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/pci/com_pci.c b/sys/dev/pci/com_pci.c index 2ae409d22..745b7ccde 100644 --- a/sys/dev/pci/com_pci.c +++ b/sys/dev/pci/com_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_pci.c,v 1.2 2022/04/06 18:59:29 naddy Exp $ */ +/* $OpenBSD: com_pci.c,v 1.3 2023/09/11 08:41:26 mvs Exp $ */ /* * Copyright (c) 2020 Patrick Wildt * @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index 86f92bd1a..603294058 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esa.c,v 1.41 2022/10/26 20:19:08 kn Exp $ */ +/* $OpenBSD: esa.c,v 1.42 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */ /* @@ -50,7 +50,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/pci/if_ep_pci.c b/sys/dev/pci/if_ep_pci.c index e89878cd9..93fed4ef8 100644 --- a/sys/dev/pci/if_ep_pci.c +++ b/sys/dev/pci/if_ep_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_pci.c,v 1.36 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: if_ep_pci.c,v 1.37 2023/09/11 08:41:26 mvs Exp $ */ /* $NetBSD: if_ep_pci.c,v 1.13 1996/10/21 22:56:38 thorpej Exp $ */ /* @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/pcmcia/aic_pcmcia.c b/sys/dev/pcmcia/aic_pcmcia.c index 70afb0490..e0bd83291 100644 --- a/sys/dev/pcmcia/aic_pcmcia.c +++ b/sys/dev/pcmcia/aic_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic_pcmcia.c,v 1.19 2022/04/06 18:59:30 naddy Exp $ */ +/* $OpenBSD: aic_pcmcia.c,v 1.20 2023/09/11 08:41:27 mvs Exp $ */ /* $NetBSD: aic_pcmcia.c,v 1.6 1998/07/19 17:28:15 christos Exp $ */ /* @@ -32,7 +32,6 @@ #include #include -#include #include #include diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c index 9f957a346..fac4aafc9 100644 --- a/sys/dev/pcmcia/com_pcmcia.c +++ b/sys/dev/pcmcia/com_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_pcmcia.c,v 1.59 2022/04/06 18:59:30 naddy Exp $ */ +/* $OpenBSD: com_pcmcia.c,v 1.60 2023/09/11 08:41:27 mvs Exp $ */ /* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */ /* @@ -91,7 +91,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/pcmcia/if_ep_pcmcia.c b/sys/dev/pcmcia/if_ep_pcmcia.c index 5e8c7d6d9..b4edd3f13 100644 --- a/sys/dev/pcmcia/if_ep_pcmcia.c +++ b/sys/dev/pcmcia/if_ep_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_pcmcia.c,v 1.50 2022/04/06 18:59:30 naddy Exp $ */ +/* $OpenBSD: if_ep_pcmcia.c,v 1.51 2023/09/11 08:41:27 mvs Exp $ */ /* $NetBSD: if_ep_pcmcia.c,v 1.16 1998/08/17 23:20:40 thorpej Exp $ */ /*- @@ -69,7 +69,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/pcmcia/if_ne_pcmcia.c b/sys/dev/pcmcia/if_ne_pcmcia.c index 62a576358..130ef733f 100644 --- a/sys/dev/pcmcia/if_ne_pcmcia.c +++ b/sys/dev/pcmcia/if_ne_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ne_pcmcia.c,v 1.101 2022/04/06 18:59:30 naddy Exp $ */ +/* $OpenBSD: if_ne_pcmcia.c,v 1.102 2023/09/11 08:41:27 mvs Exp $ */ /* $NetBSD: if_ne_pcmcia.c,v 1.17 1998/08/15 19:00:04 thorpej Exp $ */ /* @@ -32,7 +32,6 @@ #include #include -#include #include #include diff --git a/sys/dev/pcmcia/if_sm_pcmcia.c b/sys/dev/pcmcia/if_sm_pcmcia.c index 4d3c32fd0..905a4d5b8 100644 --- a/sys/dev/pcmcia/if_sm_pcmcia.c +++ b/sys/dev/pcmcia/if_sm_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sm_pcmcia.c,v 1.39 2022/04/06 18:59:30 naddy Exp $ */ +/* $OpenBSD: if_sm_pcmcia.c,v 1.40 2023/09/11 08:41:27 mvs Exp $ */ /* $NetBSD: if_sm_pcmcia.c,v 1.11 1998/08/15 20:47:32 thorpej Exp $ */ /*- @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/puc/com_puc.c b/sys/dev/puc/com_puc.c index 94d413143..3144b7258 100644 --- a/sys/dev/puc/com_puc.c +++ b/sys/dev/puc/com_puc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_puc.c,v 1.27 2022/04/06 18:59:30 naddy Exp $ */ +/* $OpenBSD: com_puc.c,v 1.28 2023/09/11 08:41:27 mvs Exp $ */ /* * Copyright (c) 1997 - 1999, Jason Downs. All rights reserved. @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 9cbbf7f03..4e8502d0a 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_subr.c,v 1.158 2022/02/16 06:23:42 anton Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.159 2023/09/11 08:41:27 mvs Exp $ */ /* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -37,7 +37,6 @@ #include #include #include -#include #include #include diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index 6ad841c83..2c2342edf 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.258 2023/09/08 05:56:13 djm Exp $ */ +/* $OpenBSD: scp.c,v 1.259 2023/09/10 23:12:32 djm Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -158,7 +158,7 @@ size_t sftp_nrequests; /* Needed for sftp */ volatile sig_atomic_t interrupted = 0; -int remote_glob(struct sftp_conn *, const char *, int, +int sftp_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */ static void @@ -1507,7 +1507,7 @@ sink_sftp(int argc, char *dst, const char *src, struct sftp_conn *conn) } debug3_f("copying remote %s to local %s", abs_src, dst); - if ((r = remote_glob(conn, abs_src, GLOB_NOCHECK|GLOB_MARK, + if ((r = sftp_glob(conn, abs_src, GLOB_NOCHECK|GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) error("%s: too many glob matches", src); @@ -1932,7 +1932,7 @@ throughlocal_sftp(struct sftp_conn *from, struct sftp_conn *to, } debug3_f("copying remote %s to remote %s", abs_src, target); - if ((r = remote_glob(from, abs_src, GLOB_NOCHECK|GLOB_MARK, + if ((r = sftp_glob(from, abs_src, GLOB_NOCHECK|GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) error("%s: too many glob matches", src); diff --git a/usr.bin/ssh/sftp-glob.c b/usr.bin/ssh/sftp-glob.c index 435acb904..a54a05c2e 100644 --- a/usr.bin/ssh/sftp-glob.c +++ b/usr.bin/ssh/sftp-glob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-glob.c,v 1.32 2023/09/08 05:56:13 djm Exp $ */ +/* $OpenBSD: sftp-glob.c,v 1.33 2023/09/10 23:12:32 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -29,7 +29,7 @@ #include "sftp-common.h" #include "sftp-client.h" -int remote_glob(struct sftp_conn *, const char *, int, +int sftp_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); struct SFTP_OPENDIR { @@ -107,7 +107,7 @@ fudge_stat(const char *path, struct stat *st) } int -remote_glob(struct sftp_conn *conn, const char *pattern, int flags, +sftp_glob(struct sftp_conn *conn, const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) { int r; diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index baa309db6..5a9921cda 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/sftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.235 2023/09/08 05:56:13 djm Exp $ */ +/* $OpenBSD: sftp.c,v 1.236 2023/09/10 23:12:32 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -91,7 +91,7 @@ struct complete_ctx { char **remote_pathp; }; -int remote_glob(struct sftp_conn *, const char *, int, +int sftp_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */ /* Separators for interactive commands */ @@ -634,7 +634,7 @@ process_get(struct sftp_conn *conn, const char *src, const char *dst, memset(&g, 0, sizeof(g)); debug3("Looking up %s", abs_src); - if ((r = remote_glob(conn, abs_src, GLOB_MARK, NULL, &g)) != 0) { + if ((r = sftp_glob(conn, abs_src, GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) { error("Too many matches for \"%s\".", abs_src); } else { @@ -950,7 +950,7 @@ do_globbed_ls(struct sftp_conn *conn, const char *path, memset(&g, 0, sizeof(g)); - if ((r = remote_glob(conn, path, + if ((r = sftp_glob(conn, path, GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE|GLOB_KEEPSTAT|GLOB_NOSORT, NULL, &g)) != 0 || (g.gl_pathc && !g.gl_matchc)) { @@ -1591,7 +1591,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd, break; case I_RM: path1 = make_absolute_pwd_glob(path1, *pwd); - remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); + sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!quiet) mprintf("Removing %s\n", g.gl_pathv[i]); @@ -1695,7 +1695,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd, attrib_clear(&a); a.flags |= SSH2_FILEXFER_ATTR_PERMISSIONS; a.perm = n_arg; - remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); + sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!quiet) mprintf("Changing mode on %s\n", @@ -1709,7 +1709,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd, case I_CHOWN: case I_CHGRP: path1 = make_absolute_pwd_glob(path1, *pwd); - remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); + sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if ((hflag ? sftp_lstat : sftp_stat)(conn, g.gl_pathv[i], 0, &aa) != 0) { @@ -1989,7 +1989,7 @@ complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path, memset(&g, 0, sizeof(g)); if (remote != LOCAL) { tmp = make_absolute_pwd_glob(tmp, remote_path); - remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g); + sftp_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g); } else (void)glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g); diff --git a/usr.sbin/npppd/l2tp/l2tp_subr.c b/usr.sbin/npppd/l2tp/l2tp_subr.c index da1a0fe8c..a312d7bc5 100644 --- a/usr.sbin/npppd/l2tp/l2tp_subr.c +++ b/usr.sbin/npppd/l2tp/l2tp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: l2tp_subr.c,v 1.4 2012/05/08 13:15:11 yasuoka Exp $ */ +/* $OpenBSD: l2tp_subr.c,v 1.5 2023/09/11 07:33:07 yasuoka Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* $Id: l2tp_subr.c,v 1.4 2012/05/08 13:15:11 yasuoka Exp $ */ +/* $Id: l2tp_subr.c,v 1.5 2023/09/11 07:33:07 yasuoka Exp $ */ /**@file L2TP related sub-routines */ #include #include @@ -80,10 +80,10 @@ avp_enum(struct l2tp_avp *avp, const u_char *pkt, int pktlen, int filldata) avp->attr_type |= *(pkt + 1); pkt += 2; - if (avp->length > pktlen) + if (avp->length < 6 || avp->length > pktlen) return -1; - if (filldata != 0) + if (avp->length > 6 && filldata != 0) memcpy(avp->attr_value, pkt, avp->length - 6); return avp->length; @@ -285,9 +285,8 @@ avp_find(struct l2tp_avp *avp, const u_char *pkt, int pktlen, while (pktlen >= 6 && (avpsz = avp_enum(avp, pkt, pktlen, fill_data)) > 0) { + L2TP_SUBR_ASSERT(avpsz >= 6); if (avp->vendor_id != vendor_id || avp->attr_type != attr_type) { - if (avpsz < 6) - return NULL; pkt += avpsz; pktlen -= avpsz; continue; diff --git a/usr.sbin/unbound/doc/Changelog b/usr.sbin/unbound/doc/Changelog index a7c9c4002..be48561d8 100644 --- a/usr.sbin/unbound/doc/Changelog +++ b/usr.sbin/unbound/doc/Changelog @@ -1,3 +1,8 @@ +8 September 2023: Wouter + - Fix send of udp retries when ENOBUFS is returned. It stops looping + and also waits for the condition to go away. Reported by Florian + Obser. + 25 August 2023: Wouter - Fix compile error on NetBSD in util/netevent.h. diff --git a/usr.sbin/unbound/util/netevent.c b/usr.sbin/unbound/util/netevent.c index 204e4883c..b9395a899 100644 --- a/usr.sbin/unbound/util/netevent.c +++ b/usr.sbin/unbound/util/netevent.c @@ -116,6 +116,8 @@ /** timeout in millisec to wait for write to unblock, packets dropped after.*/ #define SEND_BLOCKED_WAIT_TIMEOUT 200 +/** max number of times to wait for write to unblock, packets dropped after.*/ +#define SEND_BLOCKED_MAX_RETRY 5 /** Let's make timestamping code cleaner and redefine SO_TIMESTAMP* */ #ifndef SO_TIMESTAMP @@ -402,9 +404,10 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK) { #endif + int retries = 0; /* if we set the fd blocking, other threads suddenly * have a blocking fd that they operate on */ - while(sent == -1 && ( + while(sent == -1 && retries < SEND_BLOCKED_MAX_RETRY && ( #ifndef USE_WINSOCK errno == EAGAIN || errno == EINTR || # ifdef EWOULDBLOCK @@ -419,6 +422,13 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, #endif )) { #if defined(HAVE_POLL) || defined(USE_WINSOCK) + int send_nobufs = ( +#ifndef USE_WINSOCK + errno == ENOBUFS +#else + WSAGetLastError() == WSAENOBUFS +#endif + ); struct pollfd p; int pret; memset(&p, 0, sizeof(p)); @@ -457,8 +467,48 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, log_err("poll udp out failed: %s", sock_strerror(errno)); return 0; + } else if((pret < 0 && +#ifndef USE_WINSOCK + errno == ENOBUFS +#else + WSAGetLastError() == WSAENOBUFS +#endif + ) || (send_nobufs && retries > 0)) { + /* ENOBUFS, and poll returned without + * a timeout. Or the retried send call + * returned ENOBUFS. It is good to + * wait a bit for the error to clear. */ + /* The timeout is 20*(2^(retries+1)), + * it increases exponentially, starting + * at 40 msec. After 5 tries, 1240 msec + * have passed in total, when poll + * returned the error, and 1200 msec + * when send returned the errors. */ +#ifndef USE_WINSOCK + pret = poll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1)); +#else + pret = WSAPoll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1)); +#endif + if(pret < 0 && +#ifndef USE_WINSOCK + errno != EAGAIN && errno != EINTR && +# ifdef EWOULDBLOCK + errno != EWOULDBLOCK && +# endif + errno != ENOBUFS +#else + WSAGetLastError() != WSAEINPROGRESS && + WSAGetLastError() != WSAEINTR && + WSAGetLastError() != WSAENOBUFS && + WSAGetLastError() != WSAEWOULDBLOCK +#endif + ) { + log_err("poll udp out timer failed: %s", + sock_strerror(errno)); + } } #endif /* defined(HAVE_POLL) || defined(USE_WINSOCK) */ + retries++; if (!is_connected) { sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), sldns_buffer_remaining(packet), 0, @@ -665,7 +715,8 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, WSAGetLastError() == WSAENOBUFS || WSAGetLastError() == WSAEWOULDBLOCK) { #endif - while(sent == -1 && ( + int retries = 0; + while(sent == -1 && retries < SEND_BLOCKED_MAX_RETRY && ( #ifndef USE_WINSOCK errno == EAGAIN || errno == EINTR || # ifdef EWOULDBLOCK @@ -680,6 +731,13 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, #endif )) { #if defined(HAVE_POLL) || defined(USE_WINSOCK) + int send_nobufs = ( +#ifndef USE_WINSOCK + errno == ENOBUFS +#else + WSAGetLastError() == WSAENOBUFS +#endif + ); struct pollfd p; int pret; memset(&p, 0, sizeof(p)); @@ -718,8 +776,48 @@ comm_point_send_udp_msg_if(struct comm_point *c, sldns_buffer* packet, log_err("poll udp out failed: %s", sock_strerror(errno)); return 0; + } else if((pret < 0 && +#ifndef USE_WINSOCK + errno == ENOBUFS +#else + WSAGetLastError() == WSAENOBUFS +#endif + ) || (send_nobufs && retries > 0)) { + /* ENOBUFS, and poll returned without + * a timeout. Or the retried send call + * returned ENOBUFS. It is good to + * wait a bit for the error to clear. */ + /* The timeout is 20*(2^(retries+1)), + * it increases exponentially, starting + * at 40 msec. After 5 tries, 1240 msec + * have passed in total, when poll + * returned the error, and 1200 msec + * when send returned the errors. */ +#ifndef USE_WINSOCK + pret = poll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1)); +#else + pret = WSAPoll(NULL, 0, (SEND_BLOCKED_WAIT_TIMEOUT/10)<<(retries+1)); +#endif + if(pret < 0 && +#ifndef USE_WINSOCK + errno != EAGAIN && errno != EINTR && +# ifdef EWOULDBLOCK + errno != EWOULDBLOCK && +# endif + errno != ENOBUFS +#else + WSAGetLastError() != WSAEINPROGRESS && + WSAGetLastError() != WSAEINTR && + WSAGetLastError() != WSAENOBUFS && + WSAGetLastError() != WSAEWOULDBLOCK +#endif + ) { + log_err("poll udp out timer failed: %s", + sock_strerror(errno)); + } } #endif /* defined(HAVE_POLL) || defined(USE_WINSOCK) */ + retries++; sent = sendmsg(c->fd, &msg, 0); } }