On Fri, Aug 27, 2021 at 03:03:36PM +0200, Erling Westenvik wrote:
> Hello all,
> I have successfully set up a wg(4) based VPN tunnel from my laptop
> (current) to my home/office gateway (6.9) but have problems
> understanding how to access the LAN behind the gateway.
>
> [Laptop]
> - wg0 (10.0.0.42)
> - egress (trunk0 {em0 iwn0} dhcp)
> [Internet]
> [Gateway]
> - egress (em0 dhcp)
> - wg0 (10.0.0.1)
> - bridge0 {em1, (vether0 192.168.3.1 dhcpd)}
> [LAN]
> - various 192.168.3.0/24
>
> I can ping/ssh between wg(4) endpoints (10.0.0.1 to 10.0.0.42 and vica
> versa) and also from LAN clients (192.168.3.0/24) to gateway wg(4)
> endpoint (10.0.0.1), but the laptop (10.0.0.42) can only reach the
> gateway (10.0.0.1).
>
> Is it as easy as defining some routes? If so, where? There's a ton of
> more or less relevant and/or updated howto's out there but I have not
> found anyone dealing with a similar scenario. Any hints are appreciated.
Routes:
laptop: route add 192.168.3/24 10.0.0.1
"various 192.168.3.0/24": route add 10.0.0.42 192.168.3.1
(The latter is probably already the case if 192.168.3.1 is the default gw)
Alternatively, NAT the traffic from 10.0.0.42 onto the 192.168.3/24 network
Something like this late in the pf rules on Gateway:
match out on em1 from any received-on wg0 nat-to (em1)
/Alexander
>
> (My wg(4) setup is based on:
> https://www.tumfatig.net/20201202/a-mesh-vpn-using-openbsd-and-wireguard/)
>
> Best regards,
>
> Erling
>
Wednesday, September 01, 2021
Re: [patch] www/luakit fix printf("%n")
Stefan Hagen <sh+openbsd-ports@codevoid.de> wrote:
> Hi,
>
> This fixes:
> Aug 31 23:37:50 x230 luakit: *printf used %n: %s:%d%n
>
> It can be tested:
> 1. start luakit
> 2. type: ":lua foobar()<return>"
>
> An error text with a Traceback occurs. The text + alignment is created
> with the fixed function.
>
> OK?
>
> Best regards,
> Stefan
>
> Index: www/luakit/Makefile
> ===================================================================
> RCS file: /cvs/ports/www/luakit/Makefile,v
> retrieving revision 1.29
> diff -u -p -u -p -r1.29 Makefile
> --- www/luakit/Makefile 21 Mar 2021 14:16:21 -0000 1.29
> +++ www/luakit/Makefile 31 Aug 2021 21:53:30 -0000
> @@ -5,6 +5,7 @@ COMMENT = fast, small, webkit based brow
> GH_ACCOUNT = luakit
> GH_PROJECT = luakit
> GH_TAGNAME = 2.3
> +REVISION = 0
>
> EPOCH = 1
>
> Index: www/luakit/patches/patch-common_luautil_c
> ===================================================================
> RCS file: www/luakit/patches/patch-common_luautil_c
> diff -N www/luakit/patches/patch-common_luautil_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ www/luakit/patches/patch-common_luautil_c 31 Aug 2021 21:53:30 -0000
> @@ -0,0 +1,19 @@
> +$OpenBSD$
> +
> +Fix printf '%n'
> +
> +Index: common/luautil.c
> +--- common/luautil.c.orig
> ++++ common/luautil.c
> +@@ -72,7 +72,10 @@ luaH_traceback(lua_State *L, lua_State *T, gint min_le
> + } else {
> + const char *src = AR_SRC(ar);
> + int n;
> +- g_string_append_printf(tb, "%s:%d%n", src, ar.currentline, &n);
> ++ char tmp[10] = "";
> ++ sprintf(tmp, "%d", ar.currentline);
i guess these %n uses are a consequence of g_string_append_printf() being
void, rather than returning number of chars it added.
please use snprintf rather than sprintf
> ++ n = strlen(src) + strlen(tmp) + 1;
> ++ g_string_append_printf(tb, "%s:%d", src, ar.currentline);
> + g_string_append_printf(tb, "%*.*s", loc_pad-n, loc_pad-n, "");
> + }
> +
>
> Hi,
>
> This fixes:
> Aug 31 23:37:50 x230 luakit: *printf used %n: %s:%d%n
>
> It can be tested:
> 1. start luakit
> 2. type: ":lua foobar()<return>"
>
> An error text with a Traceback occurs. The text + alignment is created
> with the fixed function.
>
> OK?
>
> Best regards,
> Stefan
>
> Index: www/luakit/Makefile
> ===================================================================
> RCS file: /cvs/ports/www/luakit/Makefile,v
> retrieving revision 1.29
> diff -u -p -u -p -r1.29 Makefile
> --- www/luakit/Makefile 21 Mar 2021 14:16:21 -0000 1.29
> +++ www/luakit/Makefile 31 Aug 2021 21:53:30 -0000
> @@ -5,6 +5,7 @@ COMMENT = fast, small, webkit based brow
> GH_ACCOUNT = luakit
> GH_PROJECT = luakit
> GH_TAGNAME = 2.3
> +REVISION = 0
>
> EPOCH = 1
>
> Index: www/luakit/patches/patch-common_luautil_c
> ===================================================================
> RCS file: www/luakit/patches/patch-common_luautil_c
> diff -N www/luakit/patches/patch-common_luautil_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ www/luakit/patches/patch-common_luautil_c 31 Aug 2021 21:53:30 -0000
> @@ -0,0 +1,19 @@
> +$OpenBSD$
> +
> +Fix printf '%n'
> +
> +Index: common/luautil.c
> +--- common/luautil.c.orig
> ++++ common/luautil.c
> +@@ -72,7 +72,10 @@ luaH_traceback(lua_State *L, lua_State *T, gint min_le
> + } else {
> + const char *src = AR_SRC(ar);
> + int n;
> +- g_string_append_printf(tb, "%s:%d%n", src, ar.currentline, &n);
> ++ char tmp[10] = "";
> ++ sprintf(tmp, "%d", ar.currentline);
i guess these %n uses are a consequence of g_string_append_printf() being
void, rather than returning number of chars it added.
please use snprintf rather than sprintf
> ++ n = strlen(src) + strlen(tmp) + 1;
> ++ g_string_append_printf(tb, "%s:%d", src, ar.currentline);
> + g_string_append_printf(tb, "%*.*s", loc_pad-n, loc_pad-n, "");
> + }
> +
>
Subscribe to:
Posts (Atom)