@@ -918,6 +918,10 @@ int address_configure(
918918 if (r < 0 )
919919 return log_link_error_errno (link , r , "Could not append IFA_CACHEINFO attribute: %m" );
920920
921+ r = sd_netlink_message_append_u32 (req , IFA_RT_PRIORITY , address -> route_metric );
922+ if (r < 0 )
923+ return log_link_error_errno (link , r , "Could not append IFA_RT_PRIORITY attribute: %m" );
924+
921925 k = address_add (link , address , & a );
922926 if (k < 0 )
923927 return log_link_error_errno (link , k , "Could not add address: %m" );
@@ -1801,6 +1805,48 @@ int config_parse_address_scope(
18011805 return 0 ;
18021806}
18031807
1808+ int config_parse_address_route_metric (
1809+ const char * unit ,
1810+ const char * filename ,
1811+ unsigned line ,
1812+ const char * section ,
1813+ unsigned section_line ,
1814+ const char * lvalue ,
1815+ int ltype ,
1816+ const char * rvalue ,
1817+ void * data ,
1818+ void * userdata ) {
1819+
1820+ Network * network = userdata ;
1821+ _cleanup_ (address_free_or_set_invalidp ) Address * n = NULL ;
1822+ int r ;
1823+
1824+ assert (filename );
1825+ assert (section );
1826+ assert (lvalue );
1827+ assert (rvalue );
1828+ assert (data );
1829+
1830+ r = address_new_static (network , filename , section_line , & n );
1831+ if (r == - ENOMEM )
1832+ return log_oom ();
1833+ if (r < 0 ) {
1834+ log_syntax (unit , LOG_WARNING , filename , line , r ,
1835+ "Failed to allocate new address, ignoring assignment: %m" );
1836+ return 0 ;
1837+ }
1838+
1839+ r = safe_atou32 (rvalue , & n -> route_metric );
1840+ if (r < 0 ) {
1841+ log_syntax (unit , LOG_WARNING , filename , line , r ,
1842+ "Could not parse %s=, ignoring assignment: %s" , lvalue , rvalue );
1843+ return 0 ;
1844+ }
1845+
1846+ TAKE_PTR (n );
1847+ return 0 ;
1848+ }
1849+
18041850int config_parse_duplicate_address_detection (
18051851 const char * unit ,
18061852 const char * filename ,
0 commit comments