proto: allow dumping protocol handlers without config_params When ubus invokes proto_dump_handlers, and a struct proto_handler has been added with a NULL config_params, a segmentation fault occurs. Avoid this segmentation fault by checking for a NULL config_params before further access. Signed-off-by: Olof Sivertsson <olof.sivertsson@zenterio.com>
proto: add point-to-point IPv4 address config support (FS#1037) Add config support support for point-to-point IPv4 addresses by providing the uci parameter ptpaddr. This allows to support a gateway being in a different subnet than the assigned IP by modeling the local IP having a point-to-point address. This is similar to the point-to-point IPv4 address support already present for the protocol handlers. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
proto: allow configuring deprecated static IPv6 addresses Add a new boolean attribute ip6deprecated to the static protocol which can be used to mark IPv6 addresses as deprecated (i.e., set the preferred lifetime to 0). This is useful to configure addresses that may be used for incoming, but not for outgoing connections unless bound explicitly. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
utils: Move IP address validation to parse_addr function Commit 7a51f23e adds IP address validation in the function parse_ip_and_netmask; however the added check is too restrictive as the function is used on several places resulting into the problem multicast routes cannot be added anymore via UCI. Therefore move the IP host address validation to the function parse_addr so experimantal/multicast addresses cannot be added as a host IP address while multicast routes can be added again. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
proto: Display proto flags when dumping the protocol handlers in ubus Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
proto: Fix possible segfaults Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
proto: Fix possible buffer overflow due to non null terminated string Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
netifd: Interface last error support Adds interface last error support which preserves the last reported error reported by the protocol handler till the interface is up; e.g. survives network reload and interface restarts. This is mainly usefull for tracking down why an interface fails to establish; eg auth failure/traffic limit for PPP interfaces Protocol handlers register last error support by setting lasterror=1 in the proto_init function Signed-off-by: Johan Peeters <johan.peeters111@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
netifd: Apply interface metric on configured interface gateway parameters Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
netifd: Reload proto on topology change Introduce a new device event "topology change" that gets signaled by bridges on adding/removing members. On "topology changes" the proto handlers are requested to "renew" which is most useful for DHCP. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
add validation rules to proto static Signed-off-by: John Crispin <blogic@openwrt.org>
get_proto_handlers now also dumps the validation info Signed-off-by: John Crispin <blogic@openwrt.org>
IPv6: add class support to regular IPv6 addresses
config: use the new uci_blob library code Signed-off-by: Felix Fietkau <nbd@openwrt.org>
IPv6: reorganize prefix assignment * put parameters in a more suitable place * add support for prefix classes
IPv6: fix wrap-arounds in address lifetimes
Add option to define target routing table for protocol routes. This unifies source-routing for both IPv6 and IPv4 (default off). Based on a patch by Kristian Evensen
IPv6: Use source-routing to allow multi-wan
IPv6: Use key=val format for prefix options
fix route sorting order New sorting order: - prefix length (descending) - metric (ascending) - flags - target address Signed-off-by: Felix Fietkau <nbd@openwrt.org>