Encoding bug with interfaces speciefied #117

Open
opened 2023-04-17 14:06:44 +08:00 by Janik-Haag · 0 comments
Janik-Haag commented 2023-04-17 14:06:44 +08:00 (Migrated from github.com)

Clicking on a peering in alice-lg should open the detail view like this one. But in my case the alice webinterface throws this error:

Alice has trouble connecting to the API of rs1.example.com (IPv6) (got GENERIC_ERROR).

If this problem persist, we suggest you try again later.

The systemd-unit shows this error message:

Apr 17 08:00:30 testHost alice-lg[1519]: 2023/04/17 08:00:30 API ERROR :: rs1.example.com (IPv6).routes_filtered(manawyrm_v6) :: parse "http://[::]:29184/routes/peer/fe80::1299:e%dn42peer": invalid URL escape "%dn

When sending a request with the right encoding it looks like this:

curl http://[::]:29184/routes/peer/fe80::1299:e%25dn42peer -v
*   Trying [::]:29184...
* Connected to :: (::1) port 29184 (#0)
> GET /routes/peer/fe80::1299:e%25dn42peer HTTP/1.1
> Host: [::]:29184
> User-Agent: curl/7.87.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Mon, 17 Apr 2023 06:03:52 GMT
< Content-Length: 197
< 
{"api":{"Version":"2.0.0","result_from_cache":false,"cache_status":{"cached_at":{"date":"0001-01-01T00:00:00Z","timezone_type":"UTC","timezone":"UTC"}}},"error":"Invalid character in param value"}
* Connection #0 to host :: left intact

Which also seems to not be the correct response and is probably a separate issue for birdwatcher, I'm also a bit irritated that it gives the status code 200 but in the json response it says error.

How to reproduce:
Create a peering with a for example link-local address. This requires you to specify a interface and might look like this: fe80::1299:e%dn42peer

My bird peering config looks like this:

      template bgp dnpeers {
          local as OWNAS;
          path metric 1;
          ipv6 {   
              import filter {
                if is_valid_network_v6() && !is_self_net_v6() then {
                  if (roa_check(dn42_roa_v6, net, bgp_path.last) != ROA_VALID) then {
                    print "[dn42] ROA check failed for ", net, " ASN ", bgp_path.last;
                    reject;
                  } else accept;
                } else reject;
              };
              export filter { if is_valid_network_v6() && source ~ [RTS_STATIC, RTS_BGP] then accept; else reject; };
              import limit 1000 action block; 
          };
      }
      protocol bgp manawyrm_v6 from dnpeers {
        neighbor fe80::1299:e%dn42peer as 76190;
      }
Clicking on a peering in alice-lg should open the detail view like [this one](https://lg.de-cix.net/routeservers/rs1_fra_ipv4/protocols/R194_42/routes). But in my case the alice webinterface throws this error: ``` Alice has trouble connecting to the API of rs1.example.com (IPv6) (got GENERIC_ERROR). If this problem persist, we suggest you try again later. ``` The systemd-unit shows this error message: ``` Apr 17 08:00:30 testHost alice-lg[1519]: 2023/04/17 08:00:30 API ERROR :: rs1.example.com (IPv6).routes_filtered(manawyrm_v6) :: parse "http://[::]:29184/routes/peer/fe80::1299:e%dn42peer": invalid URL escape "%dn ``` When sending a request with the right encoding it looks like this: ``` curl http://[::]:29184/routes/peer/fe80::1299:e%25dn42peer -v * Trying [::]:29184... * Connected to :: (::1) port 29184 (#0) > GET /routes/peer/fe80::1299:e%25dn42peer HTTP/1.1 > Host: [::]:29184 > User-Agent: curl/7.87.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Content-Type: application/json < Date: Mon, 17 Apr 2023 06:03:52 GMT < Content-Length: 197 < {"api":{"Version":"2.0.0","result_from_cache":false,"cache_status":{"cached_at":{"date":"0001-01-01T00:00:00Z","timezone_type":"UTC","timezone":"UTC"}}},"error":"Invalid character in param value"} * Connection #0 to host :: left intact ``` Which also seems to not be the correct response and is probably a separate issue for birdwatcher, I'm also a bit irritated that it gives the status code 200 but in the json response it says error. How to reproduce: Create a peering with a for example link-local address. This requires you to specify a interface and might look like this: `fe80::1299:e%dn42peer` My bird peering config looks like this: ``` template bgp dnpeers { local as OWNAS; path metric 1; ipv6 { import filter { if is_valid_network_v6() && !is_self_net_v6() then { if (roa_check(dn42_roa_v6, net, bgp_path.last) != ROA_VALID) then { print "[dn42] ROA check failed for ", net, " ASN ", bgp_path.last; reject; } else accept; } else reject; }; export filter { if is_valid_network_v6() && source ~ [RTS_STATIC, RTS_BGP] then accept; else reject; }; import limit 1000 action block; }; } protocol bgp manawyrm_v6 from dnpeers { neighbor fe80::1299:e%dn42peer as 76190; } ```
Sign in to join this conversation.
No description provided.