From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1757141363; bh=6BHCilMhN+GuOOFTbRDLt2I1cZjAUW7YflkUqK7pkUE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=hT8pQTi9W1jrSiT0bTsaes1kKMrNaQULgD4jTameKIkCWs920brTPvBtkVN+8IsFQ QQ52S0EyYDR5Z20EElxSrKo5C7Ja5oG2eA3zmxBXVvmt9sX4S0TCTcUTeAaTFeFJoH OMJR/IEKfAhTLatZ2LYDe2or5iJXspUmZfQrkPGZqocxMJmQAku88C/DlLjTgy4xyN CvnxangYGIxE3zTIe69LyriRdLlnK5ugTx2sg572oGERT2yhFzSJTjxJjNvKV23EJl XrXATBdtDkb27EfLm94t4xBMmuVmjEEihaMc2USLmCirTI29ZueAWNAv+OYruILPaF N4bsx2SAd3IQQ== Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id A597B3127AA2 for ; Sat, 6 Sep 2025 06:49:23 +0000 (UTC) Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-336dc57f3f2so27686021fa.3 for ; Fri, 05 Sep 2025 23:49:23 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWBeoRd37lMtGn0ABltJimMQJkUZ7fh1fOC3gco6/gdvUilW84AwXvCzyy8cJiuD1RGjt6c@vger.gnuweeb.org X-Gm-Message-State: AOJu0Yxvw2F6tjVEvbLGFhJnKE/g2AoTEUZHF1WqIV4rGImoPyYqBQw1 VpzKnFG6NcAQVkkP2g43JwDVzFK63WzKD6mBS1OMp4jNOI7obj5IEOS0z96MDKYn66+IVWo7Hc8 qOhfoMu3C/SIfDJOg5MmRoRrDR8wborU= X-Google-Smtp-Source: AGHT+IEWK/uE3x/vCMat9BwVIuF7pxugjLJiWDldHu81FcHA69SnA6RcwcQ5bnlCgeiqAJeGXv1Ek3UPyQs1LV753OA= X-Received: by 2002:a05:651c:3254:20b0:332:57b8:92eb with SMTP id 38308e7fff4ca-33b50f97cbamr2753861fa.10.1757141363098; Fri, 05 Sep 2025 23:49:23 -0700 (PDT) MIME-Version: 1.0 References: <20250829075557.598176-1-reyuki@gnuweeb.org> <20250829075557.598176-3-reyuki@gnuweeb.org> In-Reply-To: From: Ahmad Gani Date: Sat, 6 Sep 2025 13:48:45 +0700 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXzmd5vENVDxJn5pwEV2ZVVWwxwa6pRP6cj-pu1r-t9X3vPFd8pKF6xVA7A Message-ID: Subject: Re: [PATCH gwproxy v8 2/2] gwproxy: refactor code base to add experimental raw DNS backend To: Alviro Iskandar Setiawan Cc: Ammar Faizi , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: On Sat, Sep 6, 2025 at 1:17=E2=80=AFPM Ahmad Gani wrote: > On Sat, Sep 6, 2025 at 11:32=E2=80=AFAM Ahmad Gani wrote: > > > On Fri, Aug 29, 2025 at 2:56 PM Ahmad Gani wrote: > > >> +void cp_nsaddr(struct gwp_dns_ctx *ctx, struct gwp_sockaddr *addr, = uint8_t *addrlen) > > >> +{ > > >> + *addr =3D ctx->ns_addr; > > >> + *addrlen =3D ctx->ns_addrlen; > > >> +} > > > > > > Why is this exposed globally? I don't think it's worth a function > > > call. Better be inlined. > > > > I can't access members of the gwp_dns_ctx struct directly from another > > file, as it seems to be treated as an opaque pointer outside of dns.c. = If > > I make it an inline function, it would only be accessible within dns.c. > > Should I move the full declaration of the struct to the header file? > > Oh, wait=E2=80=94I just realized you were talking about the inline keywor= d, not > static. My previous reply was unrelated; I misunderstood. In that case, > I'll add the inline keyword if it's not worth a function call. Actually, it's related, using the inline keyword in the header file required the gwp_dns_ctx struct to be defined in the header file as well. I just get this error: ``` ./src/gwproxy/dns.h:112:20: error: invalid use of undefined type =E2=80=98struct gwp_dns_ctx=E2=80=99 112 | *addr =3D ctx->ns_addr; | ^~ ./src/gwproxy/dns.h:113:23: error: invalid use of undefined type =E2=80=98struct gwp_dns_ctx=E2=80=99 113 | *addrlen =3D ctx->ns_addrlen; ``` -- Ahmad Gani