Problem
ConfigParseRouteSectionOptionValue implements the route Type enum grammar
(unicast, blackhole, unreachable, …), but in AiGenerated it is registered for
nine config_parse_route_section ltypes — only one of which (ROUTE_TYPE) actually
takes that enum. The rest take numbers, booleans, or different enums, so their valid
values are mis-flagged as invalid.
Discovered while adding Gateway coverage (#475); the experimental key-marker (#474) makes
these easy to spot.
Mis-registered ltypes (correctness bug)
All of these currently resolve to the route-Type word list, which is wrong:
| ltype |
.network key(s) |
actually accepts |
example wrongly flagged |
ROUTE_PRIORITY |
Route.Metric |
unsigned integer |
Metric=100 |
ROUTE_PROTOCOL |
Route.Protocol |
kernel/boot/static/dhcp or 0–255 |
Protocol=static |
ROUTE_PREFERENCE |
Route.IPv6Preference |
low/medium/high |
IPv6Preference=high |
ROUTE_NEXTHOP |
Route.NextHop |
nexthop id (unsigned int) |
NextHop=1 |
ROUTE_METRIC_HOPLIMIT |
Route.HopLimit |
unsigned integer |
HopLimit=64 |
ROUTE_METRIC_INITRWND |
Route.InitialAdvertisedReceiveWindow |
unsigned integer |
InitialAdvertisedReceiveWindow=10 |
ROUTE_METRIC_QUICKACK |
Route.QuickAck |
boolean |
QuickAck=true |
ROUTE_METRIC_FASTOPEN_NO_COOKIE |
Route.FastOpenNoCookie |
boolean |
FastOpenNoCookie=yes |
Only ROUTE_TYPE (Route.Type) is correctly served by the enum grammar.
Also: unregistered ltypes (coverage gaps — no validation today)
These config_parse_route_section ltypes appear in the networkd gperf but have no entry
in AiGenerated, so their values aren't validated at all (same situation Gateway was in
before #475):
ROUTE_DESTINATION — Route.Destination, Route.Source (address/prefix)
ROUTE_SCOPE — Route.Scope (global/site/link/host/nowhere or number)
ROUTE_PREFERRED_SOURCE — Route.PreferredSource (address)
ROUTE_TABLE — Route.Table (default/main/local or number)
ROUTE_GATEWAY_ONLINK — Route.GatewayOnLink / Route.GatewayOnlink (boolean)
ROUTE_MULTIPATH — Route.MultiPathRoute
ROUTE_METRIC_MTU — Route.MTUBytes (size)
ROUTE_METRIC_ADVMSS — Route.TCPAdvertisedMaximumSegmentSize (size)
ROUTE_METRIC_INITCWND — Route.InitialCongestionWindow (unsigned int)
ROUTE_METRIC_RTO_MIN — Route.TCPRetransmissionTimeoutSec (time)
ROUTE_METRIC_CC_ALGO — Route.TCPCongestionControlAlgorithm (string)
Suggested fix
Give each ltype its own correct grammar (as done for the gateway ltypes in #475) rather
than sharing the Type-enum validator. The mis-registrations are the priority (they cause
false errors on valid configs); the unregistered ltypes are latent gaps. The key-marker
behind the experimental flag is handy for verifying each one lights up once covered.
Refs #467 #475
Problem
ConfigParseRouteSectionOptionValueimplements the route Type enum grammar(
unicast,blackhole,unreachable, …), but inAiGeneratedit is registered fornine
config_parse_route_sectionltypes — only one of which (ROUTE_TYPE) actuallytakes that enum. The rest take numbers, booleans, or different enums, so their valid
values are mis-flagged as invalid.
Discovered while adding Gateway coverage (#475); the experimental key-marker (#474) makes
these easy to spot.
Mis-registered ltypes (correctness bug)
All of these currently resolve to the route-Type word list, which is wrong:
ROUTE_PRIORITYRoute.MetricMetric=100ROUTE_PROTOCOLRoute.Protocolkernel/boot/static/dhcpor 0–255Protocol=staticROUTE_PREFERENCERoute.IPv6Preferencelow/medium/highIPv6Preference=highROUTE_NEXTHOPRoute.NextHopNextHop=1ROUTE_METRIC_HOPLIMITRoute.HopLimitHopLimit=64ROUTE_METRIC_INITRWNDRoute.InitialAdvertisedReceiveWindowInitialAdvertisedReceiveWindow=10ROUTE_METRIC_QUICKACKRoute.QuickAckQuickAck=trueROUTE_METRIC_FASTOPEN_NO_COOKIERoute.FastOpenNoCookieFastOpenNoCookie=yesOnly
ROUTE_TYPE(Route.Type) is correctly served by the enum grammar.Also: unregistered ltypes (coverage gaps — no validation today)
These
config_parse_route_sectionltypes appear in the networkd gperf but have no entryin
AiGenerated, so their values aren't validated at all (same situation Gateway was inbefore #475):
ROUTE_DESTINATION—Route.Destination,Route.Source(address/prefix)ROUTE_SCOPE—Route.Scope(global/site/link/host/nowhereor number)ROUTE_PREFERRED_SOURCE—Route.PreferredSource(address)ROUTE_TABLE—Route.Table(default/main/localor number)ROUTE_GATEWAY_ONLINK—Route.GatewayOnLink/Route.GatewayOnlink(boolean)ROUTE_MULTIPATH—Route.MultiPathRouteROUTE_METRIC_MTU—Route.MTUBytes(size)ROUTE_METRIC_ADVMSS—Route.TCPAdvertisedMaximumSegmentSize(size)ROUTE_METRIC_INITCWND—Route.InitialCongestionWindow(unsigned int)ROUTE_METRIC_RTO_MIN—Route.TCPRetransmissionTimeoutSec(time)ROUTE_METRIC_CC_ALGO—Route.TCPCongestionControlAlgorithm(string)Suggested fix
Give each ltype its own correct grammar (as done for the gateway ltypes in #475) rather
than sharing the Type-enum validator. The mis-registrations are the priority (they cause
false errors on valid configs); the unregistered ltypes are latent gaps. The key-marker
behind the experimental flag is handy for verifying each one lights up once covered.
Refs #467 #475