[FS#3789] odhcpd: ra_mtu default value '0' causes error on config_parse_interface

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Fri May 7 17:37:33 PDT 2021


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - morohe (morohe) 

Attached to Project - OpenWrt/LEDE Project
Summary - odhcpd: ra_mtu default value '0' causes error on config_parse_interface
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - All
Due in Version - Undecided
Due Date - Undecided
Details - Name the tree/revision/version
from 9dd5316deae6402de68ddc8a08d1a6b496101828

Currently the default value of ra_mtu is 0, but it causes an error in parsing the config file. 

        int config_parse_interface(void *data, size_t len, const char *name, bool overwrite)
        ~ To line number 780~
        if ((c = tb[IFACE_ATTR_RA_MTU])) {
                uint32_t ra_mtu = blobmsg_get_u32(c);
                if (ra_mtu < 1280 || ra_mtu > 65535)
                        goto err;
                iface->ra_mtu = ra_mtu;
        }


ra_mtu is checked with the following and it looks fine.

        static int send_router_advert(struct interface *iface, const struct in6_addr *from)
        ~to line number 477~
        if (mtu == 0)
                mtu = odhcpd_get_interface_config(iface->ifname, "mtu");
        if (mtu < 1280)
                mtu = 1280;

To fix this issue, my suggest is

1. Add write to syslog on parse error detail in config_parse_interface.
2. Fix README.md ra_mtu default value is not zero, It's 1280.
3. Remove detailed error check on parse, if always checked at the time of use.
4. Or set to default value on error.

Thanks.

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3789

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list