Message-ID: Date: Mon, 20 Mar 2023 18:02:14 +0100 MIME-Version: 1.0 Content-Language: en-GB References: <20230214135658.1034787-1-arne@...1227...> From: Arne Schwabe In-Reply-To: Subject: Re: [Openvpn-devel] [PATCH] Add missing check for nl_socket_alloc failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Gert Doering Cc: openvpn-devel@lists.sourceforge.net Am 14.02.23 um 15:01 schrieb Gert Doering: > Hi, > > On Tue, Feb 14, 2023 at 02:56:58PM +0100, Arne Schwabe wrote: >> resolve_ovpn_netlink_id(int msglevel) >> { >> - int ret; >> struct nl_sock *nl_sock = nl_socket_alloc(); >> >> - ret = genl_connect(nl_sock); >> + if (!nl_sock) >> + { >> + msg(msglevel, "Allocating net link socket failed"); >> + } > > ... shouldn't we abort in this case, aka, M_FATAL (or "return -errno")? I don't think so. This function is called from two code paths: - dco_available: I don't think if detection of dco fails, we should quit openvpn completely. - ovpn_dco_init_netlink: Here we already call it with M_ERR, which is (M_FATAL | M_ERRNO) Arne