Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200930064845.28022-1-jan.seeger@thenybble.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21110.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
| ... | ... |
@@ -709,10 +709,10 @@ instances. |
| 709 | 709 |
A set of variables which define each IPv6 route to be added, and are |
| 710 | 710 |
set prior to **--up** script execution. |
| 711 | 711 |
|
| 712 |
- ``parm`` will be one of :code:`network` or :code:`gateway` |
|
| 713 |
- (:code:`netmask` is contained as :code:`/nnn` in the |
|
| 714 |
- ``route_ipv6_network_{n}``, unlike IPv4 where it is passed in a
|
|
| 715 |
- separate environment variable). |
|
| 712 |
+ ``parm`` will be one of :code:`network`, :code:`gateway` or |
|
| 713 |
+ :code:`metric`. ``route_ipv6_network_{n}`` contains :code:`netmask`
|
|
| 714 |
+ as :code:`/nnn`, unlike IPv4 where it is passed in a separate environment |
|
| 715 |
+ variable. |
|
| 716 | 716 |
|
| 717 | 717 |
``n`` is the OpenVPN route number, starting from 1. |
| 718 | 718 |
|
| ... | ... |
@@ -1479,6 +1479,13 @@ setenv_route_ipv6(struct env_set *es, const struct route_ipv6 *r6, int i) |
| 1479 | 1479 |
|
| 1480 | 1480 |
buf_printf( &name2, "route_ipv6_gateway_%d", i ); |
| 1481 | 1481 |
setenv_str( es, BSTR(&name2), print_in6_addr( r6->gateway, 0, &gc )); |
| 1482 |
+ |
|
| 1483 |
+ if (r6->flags & RT_METRIC_DEFINED) |
|
| 1484 |
+ {
|
|
| 1485 |
+ struct buffer name3 = alloc_buf_gc( 256, &gc ); |
|
| 1486 |
+ buf_printf( &name3, "route_ipv6_metric_%d", i) ; |
|
| 1487 |
+ setenv_int( es, BSTR(&name3), r6->metric); |
|
| 1488 |
+ } |
|
| 1482 | 1489 |
} |
| 1483 | 1490 |
gc_free(&gc); |
| 1484 | 1491 |
} |