# brintOS wasm32-hwjs: the router-advertisement configuration radvd reads at # startup, and the subject of `radvd -c -C /etc/radvd.conf'. # # UPSTREAM SHIPS THIS FILE ENTIRELY COMMENTED OUT, AND radvd ITSELF REJECTS THAT. # meta-networking's radvd/files/radvd.conf is a worked example with every line # commented, so readin_config() parses it, builds no interface and returns a NULL # IfaceList -- which radvd.c reads as `exiting, failed to read config file' and # exits 1. A stock image therefore has NO configuration that `radvd -c' accepts, # and the criterion this port was taken on has no subject at all. This file is # one radvd accepts, so that the configuration path can be exercised. # # IT NAMES `lo' BECAUSE THAT IS THE ONLY INTERFACE THIS IMAGE HAS. Nothing here # depends on that: the config parser never resolves an interface name (gram.y's # ifacehead only checks for a duplicate), and IgnoreIfMissing defaults on, so a # name that is not there is tolerated rather than fatal. Naming the one interface # that does exist keeps the file honest about the machine it ships to. # # NOTHING IS EVER ADVERTISED FROM IT ON THIS IMAGE. radvd opens # socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6) immediately after reading this file # and exits when that fails; this kernel is built `# CONFIG_IPV6 is not set' # (brintos/linux#54), so the address family does not exist. That is the platform # and not the configuration -- see 88-radvd.test, which scores the two apart. # # EVERY VALUE BELOW IS DELIBERATELY NON-DEFAULT, against defaults.h. A suite that # asserts a configured value against a value radvd would have defaulted to proves # nothing, so each number here differs from what radvd would have chosen: the # DFLT_ macro it displaces is named in the comment beside it. interface lo { # Off by default (DFLT_AdvSendAdv 0). Without it radvd holds the # interface but sends nothing, so it is the flag that makes this a # router-advertisement configuration rather than an inert one. AdvSendAdvert on; # DFLT_MaxRtrAdvInterval 600; DFLT_MinRtrAdvInterval is 0.33 * Max, # i.e. 39.6 s against the 120/30 set here. MaxRtrAdvInterval 120; MinRtrAdvInterval 30; # DFLT_AdvDefaultLifetime is 3 * MaxRtrAdvInterval = 360 s here, so 300 # is a value only this file can have set. AdvDefaultLifetime 300; # Both default off (DFLT_AdvManagedFlag / DFLT_AdvOtherConfigFlag 0). # Together they say "address and other configuration come from DHCPv6", # which is a coherent thing to advertise beside an on-link prefix. AdvManagedFlag on; AdvOtherConfigFlag on; # DFLT_AdvLinkMTU 0 (advertise no MTU option); 1280 is the IPv6 minimum # link MTU, so advertising it is meaningful as well as non-default. AdvLinkMTU 1280; # DFLT_AdvCurHopLimit is the kernel's default hop limit, 64. AdvCurHopLimit 48; # RFC 3849 reserves 2001:db8::/32 for documentation, so this prefix can # never collide with a real network a machine of ours is attached to. prefix 2001:db8:d5f0:1::/64 { # Defaults on (DFLT_AdvOnLinkFlag / DFLT_AdvAutonomousFlag 1). # Set explicitly because they are two of the three flags the # prefix option carries and a configuration that leaves them # implicit says nothing about them. AdvOnLink on; AdvAutonomous on; # DFLT_AdvRouterAddr is off: with it on the prefix option # carries this router's full address rather than the prefix # alone, which is what Mobile IPv6 home agents look for. AdvRouterAddr on; # DFLT_AdvValidLifetime 86400, DFLT_AdvPreferredLifetime 14400. # Valid must exceed preferred -- gram.y rejects the file at # parse time otherwise, which is the check 88-radvd.test uses to # establish that BOTH numbers reached the parser by value. AdvValidLifetime 7200; AdvPreferredLifetime 3600; }; };