)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"a1074c2f0d9ffc9c9a9ba19cd1d19f9d06d594c9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"608107e8_e1fb2bbb","updated":"2024-12-11 17:13:20.000000000","message":"For the record: long discussion on the underlying problem - Linux has a different `IN6_ARE_ADDR_EQUAL()` macro than \"the rest of the world\" - doing 4x 32bit compares, instead of a `memcmp()` underneath.  Which is faster if aligned, and bombs if not.\n\nWe could make the header aligned by misaligning the underlying `buf` for the TAP case (14/18 byte ethernet header...) but decided that this would be a serious undertaking, possibly needing new buffers to get the crypto stuff aligned, and there be dragons.\n\nSo, just use `memcmp()` for both v4 and v6, on the base pointer, which appeases clang.  If the compiler wants to turn this into machine code that does 32 or 64 bit compares, it can :-)","commit_id":"5194e5bb00a3ed42cdf2f458f82d7835adcef80c"}],"src/openvpn/forward.c":[{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"5ac033bcd649168d77e97e8dcb95dc9304da8bb9","unresolved":true,"context_lines":[{"line_number":1403,"context_line":"        }"},{"line_number":1404,"context_line":""},{"line_number":1405,"context_line":"        struct openvpn_iphdr pip;"},{"line_number":1406,"context_line":"        memcpy(\u0026pip, BPTR(buf) + ip_hdr_offset, sizeof(struct openvpn_iphdr));"},{"line_number":1407,"context_line":""},{"line_number":1408,"context_line":"        /* drop packets with same dest addr as gateway */"},{"line_number":1409,"context_line":"        if (tun_sa.addr.in4.sin_addr.s_addr \u003d\u003d pip.daddr)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"70a6dbae_af15a5b9","line":1406,"updated":"2024-12-11 14:23:26.000000000","message":"I don\u0027t like that.  We\u0027re in the per-packet fast path here, and this is executed for every single packet - so we shouldn\u0027t memcpy() the whole I header around.\n\nI\u0027d suggest doing a `memcmp(pip-\u003edaddr, ..., sizeof(pip-\u003edaddr))`.  That should be of similar cost.","commit_id":"c807bd87a9990b20efb967e07308fd559e2980d3"},{"author":{"_account_id":1000001,"name":"flichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."},"change_message_id":"faae2cd38dd3c1b93b6cd58b0399ee44996befe3","unresolved":false,"context_lines":[{"line_number":1403,"context_line":"        }"},{"line_number":1404,"context_line":""},{"line_number":1405,"context_line":"        struct openvpn_iphdr pip;"},{"line_number":1406,"context_line":"        memcpy(\u0026pip, BPTR(buf) + ip_hdr_offset, sizeof(struct openvpn_iphdr));"},{"line_number":1407,"context_line":""},{"line_number":1408,"context_line":"        /* drop packets with same dest addr as gateway */"},{"line_number":1409,"context_line":"        if (tun_sa.addr.in4.sin_addr.s_addr \u003d\u003d pip.daddr)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"dfd760fb_ed8dd6d9","line":1406,"in_reply_to":"70a6dbae_af15a5b9","updated":"2024-12-11 16:29:37.000000000","message":"Done","commit_id":"c807bd87a9990b20efb967e07308fd559e2980d3"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"5ac033bcd649168d77e97e8dcb95dc9304da8bb9","unresolved":true,"context_lines":[{"line_number":1429,"context_line":"        memcpy(\u0026pip6, BPTR(buf) + ip_hdr_offset, sizeof(struct openvpn_ipv6hdr));"},{"line_number":1430,"context_line":""},{"line_number":1431,"context_line":"        /* drop packets with same dest addr as gateway */"},{"line_number":1432,"context_line":"        if (IN6_ARE_ADDR_EQUAL(\u0026tun_sa.addr.in6.sin6_addr, \u0026pip6.daddr))"},{"line_number":1433,"context_line":"        {"},{"line_number":1434,"context_line":"            drop \u003d true;"},{"line_number":1435,"context_line":"        }"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"d54bde03_5397571d","line":1432,"updated":"2024-12-11 14:23:26.000000000","message":"This is doing the `memcmp()` already, so we should be fine here...\n\n```\n#define IN6_ARE_ADDR_EQUAL(a, b)                        \\\n    (memcmp(\u0026(a)-\u003es6_addr[0], \u0026(b)-\u003es6_addr[0], sizeof(struct in6_addr)) \u003d\u003d 0)\n```","commit_id":"c807bd87a9990b20efb967e07308fd559e2980d3"},{"author":{"_account_id":1000001,"name":"flichtenheld","display_name":"Frank Lichtenheld","email":"frank@lichtenheld.com","username":"flichtenheld","status":"OpenVPN Inc."},"change_message_id":"faae2cd38dd3c1b93b6cd58b0399ee44996befe3","unresolved":false,"context_lines":[{"line_number":1429,"context_line":"        memcpy(\u0026pip6, BPTR(buf) + ip_hdr_offset, sizeof(struct openvpn_ipv6hdr));"},{"line_number":1430,"context_line":""},{"line_number":1431,"context_line":"        /* drop packets with same dest addr as gateway */"},{"line_number":1432,"context_line":"        if (IN6_ARE_ADDR_EQUAL(\u0026tun_sa.addr.in6.sin6_addr, \u0026pip6.daddr))"},{"line_number":1433,"context_line":"        {"},{"line_number":1434,"context_line":"            drop \u003d true;"},{"line_number":1435,"context_line":"        }"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"8481bc6e_0b647139","line":1432,"in_reply_to":"b2c04e4e_a1a773c1","updated":"2024-12-11 16:29:37.000000000","message":"Done","commit_id":"c807bd87a9990b20efb967e07308fd559e2980d3"},{"author":{"_account_id":1000002,"name":"cron2","display_name":"Gert Doering","email":"gert@greenie.muc.de","username":"cron2"},"change_message_id":"64f59d9bd8be7cd15bd96629f2a284bcd263ef4d","unresolved":true,"context_lines":[{"line_number":1429,"context_line":"        memcpy(\u0026pip6, BPTR(buf) + ip_hdr_offset, sizeof(struct openvpn_ipv6hdr));"},{"line_number":1430,"context_line":""},{"line_number":1431,"context_line":"        /* drop packets with same dest addr as gateway */"},{"line_number":1432,"context_line":"        if (IN6_ARE_ADDR_EQUAL(\u0026tun_sa.addr.in6.sin6_addr, \u0026pip6.daddr))"},{"line_number":1433,"context_line":"        {"},{"line_number":1434,"context_line":"            drop \u003d true;"},{"line_number":1435,"context_line":"        }"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"b2c04e4e_a1a773c1","line":1432,"in_reply_to":"d54bde03_5397571d","updated":"2024-12-11 14:25:53.000000000","message":"OK, I now see that it\u0027s complaining about the in6_addr part, which I find surprising - `s6_addr[]` is `uint8_t[16]`...?","commit_id":"c807bd87a9990b20efb967e07308fd559e2980d3"}]}
