)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"97f7fd470ca503dde11a19c5d304e7270aa2e8a5","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"228690e3_990fd946","updated":"2025-10-07 16:47:57.000000000","message":"code duplication","commit_id":"a99c0800eeb5d2e92f7c962ac28ea540d401d0bd"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"555ebbdbe18fb95923f92f3c54f854d9b1494983","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5f72704c_9ecaa51b","in_reply_to":"228690e3_990fd946","updated":"2025-10-07 19:17:59.000000000","message":"Done","commit_id":"a99c0800eeb5d2e92f7c962ac28ea540d401d0bd"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"1388712bcbe7e8b8a132d486dc09adab3aba8e12","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"cd4dfdd5_9fd9d38c","updated":"2025-10-12 11:18:28.000000000","message":"I like this latest version, and it should work nicely.\n\nThere might be a missing `free()` - this needs to be checked.  While at it, I\u0027ve found a few other things that could use a bit of polishing.","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"7dfe87d83129a1168c51f1fa9a3c258227b7dedf","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"b3ee282d_8be5d4aa","updated":"2025-10-13 10:42:09.000000000","message":"Aaaah, partly there.\n\nSo, the *first* \"PUSH_UPDATE,ifconfig...\" works as expected\n - new IP address is pinging\n - old IP address is logged as \"unlearn_addr()\"\n - packets for new IP are sent to the client, packets for old IP are no longer sent  (verified with tcpdump on the client tun)\n \nThis works for both IPv4 and IPv6.\n \nThen, another \"PUSH_UPDATE,ifconfig...\" and it correctly learns the \"new new\" IP address, but does not unlearn the second address, and tcpdump shows packets for 2 IPs arrive (.99 is the \"first PUSH_UPDATE\", .146 is the \"second PUSH_UPDATE\")\n\n```\n12:39:48.791099 IP 10.204.2.1 \u003e 10.204.2.99: ICMP echo request, id 50521, seq 90, length 64\n12:39:48.791109 IP 10.204.2.1 \u003e 10.204.2.99: ICMP echo request, id 50521, seq 90, length 64\n12:39:48.791122 IP 10.204.2.1 \u003e 10.204.2.146: ICMP echo request, id 64784, seq 90, length 64\n```\n\npackets are logged twice because the client has routing enabled and just sends the packet back (the server will then log `MULTI: bad source address from client [10.204.2.1], packet dropped`).","commit_id":"7484ab51d43ad95d25e25301234b42d100b1cf69"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"3df7639f3cb4f6ac2bc98fb5fffb172efb3c8d46","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"8f485db3_b7926b46","in_reply_to":"b3ee282d_8be5d4aa","updated":"2025-10-13 13:19:59.000000000","message":"Done","commit_id":"7484ab51d43ad95d25e25301234b42d100b1cf69"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"9c466a368e429b680354b18030040ce142048d5b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"f28250a9_01fec84c","updated":"2025-10-17 20:18:52.000000000","message":"This looks good now.  Tested a sequence of \"change ifconfig, change ifconfig, change to -ifconfig, send new ifconfig\" and it always learned/unlearned the expected things\n\n```\nOct 17 22:11:37 gentoo tun-udp-p2mp[13761]: MULTI: Learn: 10.204.2.46 -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\nOct 17 22:11:37 gentoo tun-udp-p2mp[13761]: MULTI: primary virtual IP for freebsd-14-amd64/udp6:194.97.140.5:60204: 10.204.2.46\nOct 17 22:11:37 gentoo tun-udp-p2mp[13761]: MULTI: Learn: fd00:abcd:204:2::100a -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\nOct 17 22:11:37 gentoo tun-udp-p2mp[13761]: MULTI: primary virtual IPv6 for freebsd-14-amd64/udp6:194.97.140.5:60204: fd00:abcd:204:2::100a\nOct 17 22:13:15 gentoo tun-udp-p2mp[13761]: MULTI: Unlearn: 10.204.2.46 -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\nOct 17 22:13:15 gentoo tun-udp-p2mp[13761]: MULTI: Learn: 10.204.2.99 -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\nOct 17 22:13:38 gentoo tun-udp-p2mp[13761]: MULTI: Unlearn: 10.204.2.99 -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\nOct 17 22:13:38 gentoo tun-udp-p2mp[13761]: MULTI: Learn: 10.204.2.146 -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\nOct 17 22:14:40 gentoo tun-udp-p2mp[13761]: MULTI: Unlearn: 10.204.2.146 -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\nOct 17 22:14:57 gentoo tun-udp-p2mp[13761]: MULTI: Learn: 10.204.2.99 -\u003e freebsd-14-amd64/udp6:194.97.140.5:60204\n```\n\nalso the logging is symmetric now (thanks again).  Very nice.\n\nI also tested IPv6, though it mains me to send \"PUSH_UPDATE,-ifconfig-ipv6\" - but it still works :-)","commit_id":"d2dd1bb694ab72e06f2fad142151102c2c318baf"}],"src/openvpn/multi.c":[{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"1388712bcbe7e8b8a132d486dc09adab3aba8e12","unresolved":true,"context_lines":[{"line_number":4293,"context_line":""},{"line_number":4294,"context_line":"    struct gc_arena gc \u003d gc_new();"},{"line_number":4295,"context_line":"    dmsg(D_MULTI_DEBUG, \"MULTI: DEL %s\", mroute_addr_print(\u0026r-\u003eaddr, \u0026gc));"},{"line_number":4296,"context_line":"    msg(D_MULTI_LOW, \"MULTI: Remove: %s -\u003e %s\", mroute_addr_print(\u0026r-\u003eaddr, \u0026gc), multi_instance_string(mi, false, \u0026gc));"},{"line_number":4297,"context_line":"    learn_address_script(m, NULL, \"delete\", \u0026r-\u003eaddr);"},{"line_number":4298,"context_line":"    hash_remove_by_value(m-\u003evhash, r);"},{"line_number":4299,"context_line":"    route_quota_dec(mi);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"723a899a_4779f06b","line":4296,"updated":"2025-10-12 11:18:28.000000000","message":"this is too much logging ;-)\n\nI\u0027d remove one of them, and change the other to include something like `MULTI: multi_unlearn_addr(): DEL %s` so it\u0027s clear it\u0027s not the normal \"MULTI: DEL\" path.\n\nAlso, if we want to be totally fancy, we could use the mi prefix code here\n\n```\nset_prefix(mi);\nmsg(...)  // no multi_instance_string() needed, as that\u0027s handled by msg_set_prefix()\nclear_prefix();\n```\n\nas for the message level, I\u0027d use `D_MULTI_LOW` (as that is used by multi.c for the \"Learn\" message).","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"a85e5986b1b2b220e70c5b359d10644f6e70298b","unresolved":false,"context_lines":[{"line_number":4293,"context_line":""},{"line_number":4294,"context_line":"    struct gc_arena gc \u003d gc_new();"},{"line_number":4295,"context_line":"    dmsg(D_MULTI_DEBUG, \"MULTI: DEL %s\", mroute_addr_print(\u0026r-\u003eaddr, \u0026gc));"},{"line_number":4296,"context_line":"    msg(D_MULTI_LOW, \"MULTI: Remove: %s -\u003e %s\", mroute_addr_print(\u0026r-\u003eaddr, \u0026gc), multi_instance_string(mi, false, \u0026gc));"},{"line_number":4297,"context_line":"    learn_address_script(m, NULL, \"delete\", \u0026r-\u003eaddr);"},{"line_number":4298,"context_line":"    hash_remove_by_value(m-\u003evhash, r);"},{"line_number":4299,"context_line":"    route_quota_dec(mi);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"669873c8_f711dc79","line":4296,"in_reply_to":"723a899a_4779f06b","updated":"2025-10-13 08:59:48.000000000","message":"Done","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"1388712bcbe7e8b8a132d486dc09adab3aba8e12","unresolved":true,"context_lines":[{"line_number":4298,"context_line":"    hash_remove_by_value(m-\u003evhash, r);"},{"line_number":4299,"context_line":"    route_quota_dec(mi);"},{"line_number":4300,"context_line":"    multi_instance_dec_refcount(mi);"},{"line_number":4301,"context_line":""},{"line_number":4302,"context_line":"    gc_free(\u0026gc);"},{"line_number":4303,"context_line":"}"},{"line_number":4304,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"80047d20_27d7418e","line":4301,"updated":"2025-10-12 11:18:28.000000000","message":"we might have a memleak here.  I looked at the code in \"multi.c\" that deletes mroutes (check_stale_routes(), multi_reap_range()), and those call `multi_route_del(r)` to do\n\n```\n    route_quota_dec(mi);\n    multi_instance_dec_refcount(mi);\n    free(route);\n```\n\nso you have the first two here, but not the `free()` - not 100% sure if this is required, but it smells like it.\n\n(`hash_remove_by_value()` seems to not do anything about the thing pointed to)\n\nMaybe just calling `multi_route_del(r)` here is the right thing (after the hash_remove_by_value() call, to avoid a use-after-free)?","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"a85e5986b1b2b220e70c5b359d10644f6e70298b","unresolved":false,"context_lines":[{"line_number":4298,"context_line":"    hash_remove_by_value(m-\u003evhash, r);"},{"line_number":4299,"context_line":"    route_quota_dec(mi);"},{"line_number":4300,"context_line":"    multi_instance_dec_refcount(mi);"},{"line_number":4301,"context_line":""},{"line_number":4302,"context_line":"    gc_free(\u0026gc);"},{"line_number":4303,"context_line":"}"},{"line_number":4304,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"94ace8fa_436f6223","line":4301,"in_reply_to":"80047d20_27d7418e","updated":"2025-10-13 08:59:48.000000000","message":"Done","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"1388712bcbe7e8b8a132d486dc09adab3aba8e12","unresolved":true,"context_lines":[{"line_number":4317,"context_line":"    remote_si.addr.in4.sin_family \u003d AF_INET;"},{"line_number":4318,"context_line":"    remote_si.addr.in4.sin_addr.s_addr \u003d a;"},{"line_number":4319,"context_line":"    addr.proto \u003d 0;"},{"line_number":4320,"context_line":"    ASSERT(mroute_extract_openvpn_sockaddr(\u0026addr, \u0026remote_si, false));"},{"line_number":4321,"context_line":""},{"line_number":4322,"context_line":"    multi_unlearn_addr(m, mi, \u0026addr);"},{"line_number":4323,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"f301c3e7_e77a6296","line":4320,"updated":"2025-10-12 11:18:28.000000000","message":"This works, but feels more clumsy than needed - looking through mroute.c, I find\n\n`mroute_get_in_addr_t(struct mroute_addr *out, const in_addr_t in, int mask)`\n\nwhich should do the same with less lines of intermediate structure filling :-)  (have not tested this, just compared code)","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"d207b80ca28ce17c09d08de53eaf50e7d84605ea","unresolved":false,"context_lines":[{"line_number":4317,"context_line":"    remote_si.addr.in4.sin_family \u003d AF_INET;"},{"line_number":4318,"context_line":"    remote_si.addr.in4.sin_addr.s_addr \u003d a;"},{"line_number":4319,"context_line":"    addr.proto \u003d 0;"},{"line_number":4320,"context_line":"    ASSERT(mroute_extract_openvpn_sockaddr(\u0026addr, \u0026remote_si, false));"},{"line_number":4321,"context_line":""},{"line_number":4322,"context_line":"    multi_unlearn_addr(m, mi, \u0026addr);"},{"line_number":4323,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"08a5a1e5_12b1e3b5","line":4320,"in_reply_to":"cf4e61f7_f768ee6d","updated":"2025-10-13 09:19:25.000000000","message":"Ah, how annoying.  Didn\u0027t notice the `static inline`.  Yeah, it\u0027s only used inside mroute.c today - we could export it, or make it non-inline, but this would make the scope of the patch much larger.","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"a85e5986b1b2b220e70c5b359d10644f6e70298b","unresolved":false,"context_lines":[{"line_number":4317,"context_line":"    remote_si.addr.in4.sin_family \u003d AF_INET;"},{"line_number":4318,"context_line":"    remote_si.addr.in4.sin_addr.s_addr \u003d a;"},{"line_number":4319,"context_line":"    addr.proto \u003d 0;"},{"line_number":4320,"context_line":"    ASSERT(mroute_extract_openvpn_sockaddr(\u0026addr, \u0026remote_si, false));"},{"line_number":4321,"context_line":""},{"line_number":4322,"context_line":"    multi_unlearn_addr(m, mi, \u0026addr);"},{"line_number":4323,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"cf4e61f7_f768ee6d","line":4320,"in_reply_to":"f301c3e7_e77a6296","updated":"2025-10-13 08:59:48.000000000","message":"mroute_get_in_addr_t() and mroute_get_in6_add6() are a static inline (and i suppose there is a reason for that, but even if not, why bother), anyway i got your point and i tried to make the helper less clumsy and more symmetric.","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"1388712bcbe7e8b8a132d486dc09adab3aba8e12","unresolved":true,"context_lines":[{"line_number":4336,"context_line":"    addr.type \u003d MR_ADDR_IPV6;"},{"line_number":4337,"context_line":"    addr.netbits \u003d 0;"},{"line_number":4338,"context_line":"    addr.v6.addr \u003d a6;"},{"line_number":4339,"context_line":""},{"line_number":4340,"context_line":"    multi_unlearn_addr(m, mi, \u0026addr);"},{"line_number":4341,"context_line":"}"},{"line_number":4342,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"8290fc03_3b80051e","line":4339,"updated":"2025-10-12 11:18:28.000000000","message":"`mroute_get_in6_addr(\u0026addr, a6, 0)` does this for you","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"a85e5986b1b2b220e70c5b359d10644f6e70298b","unresolved":false,"context_lines":[{"line_number":4336,"context_line":"    addr.type \u003d MR_ADDR_IPV6;"},{"line_number":4337,"context_line":"    addr.netbits \u003d 0;"},{"line_number":4338,"context_line":"    addr.v6.addr \u003d a6;"},{"line_number":4339,"context_line":""},{"line_number":4340,"context_line":"    multi_unlearn_addr(m, mi, \u0026addr);"},{"line_number":4341,"context_line":"}"},{"line_number":4342,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"cec62582_b1eddb2e","line":4339,"in_reply_to":"8290fc03_3b80051e","updated":"2025-10-13 08:59:48.000000000","message":"Acknowledged","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"1388712bcbe7e8b8a132d486dc09adab3aba8e12","unresolved":true,"context_lines":[{"line_number":4363,"context_line":"        /* Remove old IP */"},{"line_number":4364,"context_line":"        if (mi-\u003econtext.c2.push_ifconfig_defined)"},{"line_number":4365,"context_line":"        {"},{"line_number":4366,"context_line":"            old_addr.s_addr \u003d ntohl(mi-\u003econtext.c2.push_ifconfig_local);"},{"line_number":4367,"context_line":""},{"line_number":4368,"context_line":"            multi_unlearn_in_addr_t(m, mi, old_addr.s_addr);"},{"line_number":4369,"context_line":"            mi-\u003econtext.c2.push_ifconfig_defined \u003d false;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"cbc56eb6_41bab12b","line":4366,"updated":"2025-10-12 11:18:28.000000000","message":"we could just do `in_addr_t old_addr \u003d ...` here and save the detour via `struct in_addr`?","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"a85e5986b1b2b220e70c5b359d10644f6e70298b","unresolved":false,"context_lines":[{"line_number":4363,"context_line":"        /* Remove old IP */"},{"line_number":4364,"context_line":"        if (mi-\u003econtext.c2.push_ifconfig_defined)"},{"line_number":4365,"context_line":"        {"},{"line_number":4366,"context_line":"            old_addr.s_addr \u003d ntohl(mi-\u003econtext.c2.push_ifconfig_local);"},{"line_number":4367,"context_line":""},{"line_number":4368,"context_line":"            multi_unlearn_in_addr_t(m, mi, old_addr.s_addr);"},{"line_number":4369,"context_line":"            mi-\u003econtext.c2.push_ifconfig_defined \u003d false;"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"5bac7178_9e782090","line":4366,"in_reply_to":"cbc56eb6_41bab12b","updated":"2025-10-13 08:59:48.000000000","message":"Done","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000007,"name":"ordex","display_name":"Antonio Quartulli","email":"antonio@mandelbit.com","username":"ordex"},"change_message_id":"d834dc1164de048bd6e0f12967cb41a8c87c1189","unresolved":true,"context_lines":[{"line_number":4387,"context_line":"            \u0026\u0026 multi_learn_in_addr_t(m, mi, ntohl(new_addr.s_addr), -1, true))"},{"line_number":4388,"context_line":"        {"},{"line_number":4389,"context_line":"            mi-\u003econtext.c2.push_ifconfig_defined \u003d true;"},{"line_number":4390,"context_line":"            mi-\u003econtext.c2.push_ifconfig_local \u003d htonl(new_addr.s_addr);"},{"line_number":4391,"context_line":"        }"},{"line_number":4392,"context_line":"    }"},{"line_number":4393,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"88c29763_372fcfb0","line":4390,"updated":"2025-10-14 12:36:03.000000000","message":"something is weird here. if we are calling ntohl(s_addr) a few lines above, we can\u0027t just call htonl(s_addr) here.... @marco@mandelbit.com you said you printed the values *byte by byte*?","commit_id":"9ccc746ac6f5efabf3a0da2485b2bd4cb0b73c6d"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"12bb05d2ee14e18b5c32c5a7134914d95d1017bd","unresolved":true,"context_lines":[{"line_number":4387,"context_line":"            \u0026\u0026 multi_learn_in_addr_t(m, mi, ntohl(new_addr.s_addr), -1, true))"},{"line_number":4388,"context_line":"        {"},{"line_number":4389,"context_line":"            mi-\u003econtext.c2.push_ifconfig_defined \u003d true;"},{"line_number":4390,"context_line":"            mi-\u003econtext.c2.push_ifconfig_local \u003d htonl(new_addr.s_addr);"},{"line_number":4391,"context_line":"        }"},{"line_number":4392,"context_line":"    }"},{"line_number":4393,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"fc5a283e_68bf4b30","line":4390,"in_reply_to":"88c29763_372fcfb0","updated":"2025-10-14 16:05:02.000000000","message":"yes I printed bit by bit and they are the same and I don\u0027t understand why htonl fixes things and I don\u0027t understand why (addr.s_addr \u003d\u003d htonl(add.s_addr)) statement is false.\n\nuint32\n\n2025-10-14 17:40:06 us\u003d422285 MANAGEMENT: CMD \u0027push-update-cid 0 \"ifconfig 10.10.10.55 255.255.255.0\"\u0027\n2025-10-14 17:40:06 us\u003d422386 SENT CONTROL [client0]: \u0027PUSH_UPDATE,ifconfig 10.10.10.55 255.255.255.0\u0027 (status\u003d1)\n2025-10-14 17:40:06 us\u003d422409 MULTI: Unlearn: 10.10.10.2 -\u003e client0/udp6:92.168.3.1:37467\n2025-10-14 17:40:06 us\u003d422422 MULTI: Learn: 10.10.10.55 -\u003e client0/udp6:92.168.3.1:37467\n\n\n2025-10-14 17:40:06 us\u003d422432 New IPv4 Address Analysis:\n2025-10-14 17:40:06 us\u003d422437   Original s_addr:     0x370a0a0a \u003d 923404810 \u003d 00110111000010100000101000001010\n2025-10-14 17:40:06 us\u003d422442   ntohl(s_addr):       0x0a0a0a37 \u003d 168430135 \u003d 00001010000010100000101000110111\n2025-10-14 17:40:06 us\u003d422448   htonl(s_addr):       0x0a0a0a37 \u003d 168430135 \u003d 00001010000010100000101000110111\n2025-10-14 17:40:06 us\u003d422454   As IP address: 10.10.10.55\n\nuint64\n\n2025-10-14 17:49:28 us\u003d407391 MANAGEMENT: CMD \u0027push-update-cid 0 \"ifconfig 10.10.10.55 255.255.255.0\"\u0027\n2025-10-14 17:49:28 us\u003d407531 SENT CONTROL [client0]: \u0027PUSH_UPDATE,ifconfig 10.10.10.55 255.255.255.0\u0027 (status\u003d1)\n2025-10-14 17:49:28 us\u003d407565 MULTI: Unlearn: 10.10.10.2 -\u003e client0/udp6:92.168.3.1:37923\n2025-10-14 17:49:28 us\u003d407581 MULTI: Learn: 10.10.10.55 -\u003e client0/udp6:92.168.3.1:37923\n\n\n2025-10-14 17:49:28 us\u003d407592 New IPv4 Address Analysis:\n2025-10-14 17:49:28 us\u003d407600   Original s_addr:     0x370a0a0a \u003d 923404810 \u003d 0000000000000000000000000000000000110111000010100000101000001010\n2025-10-14 17:49:28 us\u003d407606   ntohl(s_addr):       0x0a0a0a37 \u003d 168430135 \u003d 0000000000000000000000000000000000001010000010100000101000110111\n2025-10-14 17:49:28 us\u003d407613   htonl(s_addr):       0x0a0a0a37 \u003d 168430135 \u003d 0000000000000000000000000000000000001010000010100000101000110111\n2025-10-14 17:49:28 us\u003d407619   As IP address: 10.10.10.55","commit_id":"9ccc746ac6f5efabf3a0da2485b2bd4cb0b73c6d"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"c59320d08a275db32ba53310a31ffd83aa66a176","unresolved":false,"context_lines":[{"line_number":4387,"context_line":"            \u0026\u0026 multi_learn_in_addr_t(m, mi, ntohl(new_addr.s_addr), -1, true))"},{"line_number":4388,"context_line":"        {"},{"line_number":4389,"context_line":"            mi-\u003econtext.c2.push_ifconfig_defined \u003d true;"},{"line_number":4390,"context_line":"            mi-\u003econtext.c2.push_ifconfig_local \u003d htonl(new_addr.s_addr);"},{"line_number":4391,"context_line":"        }"},{"line_number":4392,"context_line":"    }"},{"line_number":4393,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"336a1785_981fff39","line":4390,"in_reply_to":"fc5a283e_68bf4b30","updated":"2025-10-14 20:20:37.000000000","message":"Actually the problem was: push_ifconfig needed ntohl, not htonl but they do the same thing so it worked and i also was convinced for some reason that push_ifconfig needed network order, silly me.","commit_id":"9ccc746ac6f5efabf3a0da2485b2bd4cb0b73c6d"}],"src/openvpn/push_util.c":[{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"97f7fd470ca503dde11a19c5d304e7270aa2e8a5","unresolved":true,"context_lines":[{"line_number":87,"context_line":"    }"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    return ret;"},{"line_number":90,"context_line":"}"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"#ifdef ENABLE_MANAGEMENT"},{"line_number":93,"context_line":"/**"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"f66e2fcf_a5816c90","line":90,"updated":"2025-10-07 16:47:57.000000000","message":"This is code duplication of the finest sort - please do not do that. This function is practically identical to `process_incoming_push_update()`, except for the \"throw signal\" branch.  Please do not do that.\n\nIf you want to make clear that this is not \"incoming\" only, rename it to `process_push_update()`.","commit_id":"a99c0800eeb5d2e92f7c962ac28ea540d401d0bd"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"555ebbdbe18fb95923f92f3c54f854d9b1494983","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    }"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    return ret;"},{"line_number":90,"context_line":"}"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"#ifdef ENABLE_MANAGEMENT"},{"line_number":93,"context_line":"/**"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"94ade16a_b3ca4ef2","line":90,"in_reply_to":"f66e2fcf_a5816c90","updated":"2025-10-07 19:17:59.000000000","message":"Done","commit_id":"a99c0800eeb5d2e92f7c962ac28ea540d401d0bd"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"1388712bcbe7e8b8a132d486dc09adab3aba8e12","unresolved":true,"context_lines":[{"line_number":155,"context_line":"    struct context *c \u003d \u0026mi-\u003econtext;"},{"line_number":156,"context_line":"    struct options o;"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    memset(\u0026o, 0, sizeof(struct options));"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    while (msgs[++i].data \u0026\u0026 *(msgs[i].data))"},{"line_number":161,"context_line":"    {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"07ab8769_ed9bfa83","line":158,"updated":"2025-10-12 11:18:28.000000000","message":"please use `CLEAR(o);` for that.  It does exactly the same, but we use it in this situation so it\u0027s clear \"this is not just a random memset() but to 0-initialize the options struct\".","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"a85e5986b1b2b220e70c5b359d10644f6e70298b","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    struct context *c \u003d \u0026mi-\u003econtext;"},{"line_number":156,"context_line":"    struct options o;"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    memset(\u0026o, 0, sizeof(struct options));"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    while (msgs[++i].data \u0026\u0026 *(msgs[i].data))"},{"line_number":161,"context_line":"    {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"79224a68_ad59ff25","line":158,"in_reply_to":"07ab8769_ed9bfa83","updated":"2025-10-13 08:59:48.000000000","message":"Done","commit_id":"59a929423d8fea11272689645ab87555e2be16ae"},{"author":{"_account_id":1000007,"name":"ordex","display_name":"Antonio Quartulli","email":"antonio@mandelbit.com","username":"ordex"},"change_message_id":"c3bea092b6d6a37d6cf59aa458d87a9bfdc1e1c9","unresolved":true,"context_lines":[{"line_number":162,"context_line":"     * push-update."},{"line_number":163,"context_line":"     */"},{"line_number":164,"context_line":"    const char *canary \u003d \"canary\";"},{"line_number":165,"context_line":"    o.ifconfig_local \u003d canary;"},{"line_number":166,"context_line":"    o.ifconfig_ipv6_local \u003d canary;"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    while (msgs[++i].data \u0026\u0026 *(msgs[i].data))"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"ffcc2b41_1a82ecae","line":165,"updated":"2025-10-14 12:31:29.000000000","message":"in other parts of the code we use having a bool named like `$option_defined` (in this case it would be `o.ifconfig_local_defined`) which is set to `true` when the option is present, but the value is ambiguous.\n\nMay it make sense to do the same here instead of going the \"canary\" logic which would be unique to this piece of code?\n\n@gert@greenie.muc.de any opinion?","commit_id":"732d0ab13d82ed8299a85157c77655475aabbc1f"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"9c466a368e429b680354b18030040ce142048d5b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"     * push-update."},{"line_number":163,"context_line":"     */"},{"line_number":164,"context_line":"    const char *canary \u003d \"canary\";"},{"line_number":165,"context_line":"    o.ifconfig_local \u003d canary;"},{"line_number":166,"context_line":"    o.ifconfig_ipv6_local \u003d canary;"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    while (msgs[++i].data \u0026\u0026 *(msgs[i].data))"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"831de5dd_a3d9baac","line":165,"in_reply_to":"bd5cee56_ee31112f","updated":"2025-10-17 20:18:52.000000000","message":"Done","commit_id":"732d0ab13d82ed8299a85157c77655475aabbc1f"},{"author":{"_account_id":1000040,"name":"mrbff","email":"marco@mandelbit.com","username":"mrbff"},"change_message_id":"12bb05d2ee14e18b5c32c5a7134914d95d1017bd","unresolved":true,"context_lines":[{"line_number":162,"context_line":"     * push-update."},{"line_number":163,"context_line":"     */"},{"line_number":164,"context_line":"    const char *canary \u003d \"canary\";"},{"line_number":165,"context_line":"    o.ifconfig_local \u003d canary;"},{"line_number":166,"context_line":"    o.ifconfig_ipv6_local \u003d canary;"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    while (msgs[++i].data \u0026\u0026 *(msgs[i].data))"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"bd5cee56_ee31112f","line":165,"in_reply_to":"ffcc2b41_1a82ecae","updated":"2025-10-14 16:05:02.000000000","message":"the canary is mostly to be less invasive as possible. I know it\u0027s a bit weird but it works well and minimizes the scope for this logic without having to touch other functions that are also used in other parts of the code in different logic. Adding ifconfig_local_defined to the options struct and modifying add_option() and remove_option(), just to handle -ifconfig(-ipv6) in the server looks a little overkill to me.","commit_id":"732d0ab13d82ed8299a85157c77655475aabbc1f"},{"author":{"_account_id":1000007,"name":"ordex","display_name":"Antonio Quartulli","email":"antonio@mandelbit.com","username":"ordex"},"change_message_id":"c3bea092b6d6a37d6cf59aa458d87a9bfdc1e1c9","unresolved":true,"context_lines":[{"line_number":163,"context_line":"     */"},{"line_number":164,"context_line":"    const char *canary \u003d \"canary\";"},{"line_number":165,"context_line":"    o.ifconfig_local \u003d canary;"},{"line_number":166,"context_line":"    o.ifconfig_ipv6_local \u003d canary;"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    while (msgs[++i].data \u0026\u0026 *(msgs[i].data))"},{"line_number":169,"context_line":"    {"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"fdd76947_101b92fc","line":166,"updated":"2025-10-14 12:31:29.000000000","message":"same for this obviously.","commit_id":"732d0ab13d82ed8299a85157c77655475aabbc1f"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"9c466a368e429b680354b18030040ce142048d5b","unresolved":false,"context_lines":[{"line_number":163,"context_line":"     */"},{"line_number":164,"context_line":"    const char *canary \u003d \"canary\";"},{"line_number":165,"context_line":"    o.ifconfig_local \u003d canary;"},{"line_number":166,"context_line":"    o.ifconfig_ipv6_local \u003d canary;"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    while (msgs[++i].data \u0026\u0026 *(msgs[i].data))"},{"line_number":169,"context_line":"    {"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"baeb5012_d8c04c16","line":166,"in_reply_to":"fdd76947_101b92fc","updated":"2025-10-17 20:18:52.000000000","message":"While I agree that this is not pretty, I would still leave it at that (and mrbff admitted that \"it is ugly\").  I do like the rest of the code a lot in this latest iteration, and want to move it forward so it\u0027s in beta4...  so I\u0027m willing to accept this part of limited beauty.  We can improve it later - right now it\u0027s \"not working\" which is definitely less useful ;-)","commit_id":"732d0ab13d82ed8299a85157c77655475aabbc1f"}]}
