summaryrefslogtreecommitdiff
path: root/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* utils: Move IP address validation to parse_addr functionHans Dedecker2016-08-111-18/+1
| | | | | | | | | | | 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>
* utils.c: Add ip address validationNaresh Kumar Mehta2016-03-071-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | Do not allow configuring invalid IPv4/IPv6 addresses. Curently if I configure LAN IP Address as 224.1.1.1, netifd will configure it. e.g. uci set network.lan.ipaddr='224.1.1.1' uci commit /etc/init.d/network restart Now ifconfig br-lan returns br-lan Link encap:Ethernet HWaddr 00:03:7F:13:BA:17 inet addr:224.1.1.1 Bcast:224.1.1.255 Mask:255.255.255.0 which is wrong. If I use ifconfig eth1 224.1.1.1, I will get ifconfig: SIOCSIFADDR: Invalid argument it means ifconfig is working fine, whereas netifd not. Proposed patch will test IPv4 address to make sure it is class A/B/C only. Similarly IPv6 multicast addresses will not be allowed. Signed-off-by: Naresh Kumar Mehta <naresh@codeaurora.org>
* utils.c: add missing includeFelix Fietkau2015-02-161-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* add a helper to convert blobmsg types to luci validate rulesJohn Crispin2014-02-171-0/+19
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* utils: add a function for checking if a process given by pid is still aliveFelix Fietkau2013-10-221-0/+27
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* Only update resolv.conf if changed (avoid logspam)Steven Barth2013-02-191-0/+28
|
* utils.c: add helper function to format mac addresses as stringsJo-Philipp Wich2012-09-281-0/+11
|
* Move IP address parsing functions to utils.Stéphan Kochen2012-06-181-0/+63
| | | | | | | | | This is a patch series against the netifd repository. This first patch moves some previously static functions to utils, so that the follow up patch may use them from system-linux.c. Signed-off-by: Stéphan Kochen <stephan@kochen.nl>
* vlist is now part of libuboxFelix Fietkau2012-05-261-65/+0
|
* avl_strcmp is now part of libuboxFelix Fietkau2012-05-261-6/+0
|
* flush list in vlist_replace()Felix Fietkau2012-05-201-0/+2
|
* move dns server/search list parsing to interface core to support peerdns=0 + ↵Felix Fietkau2012-05-191-0/+11
| | | | static entries
* add copyright headersFelix Fietkau2012-05-041-0/+13
|
* vlist: add a special node version -1 for nodes that should not be flushed on ↵Felix Fietkau2012-03-041-4/+6
| | | | updates
* simplify vlist, move avl key handling to vlist_add()Felix Fietkau2012-03-041-5/+2
|
* vlist: fix node version update for tree->keep_old/no_deleteFelix Fietkau2012-02-031-1/+3
|
* add a simplified vlist typeFelix Fietkau2012-01-151-0/+40
|
* fix a logic error leading to segfaults on updatesFelix Fietkau2011-10-241-1/+1
|
* utils: fix existing node check when keep_old/no_delete is enabledFelix Fietkau2011-10-031-1/+1
|
* add a new vlist flag for avoiding automatic delete of entriesFelix Fietkau2011-10-021-2/+3
|
* vlist: store a pointer to the real key to make lookups easierFelix Fietkau2011-10-021-2/+2
|
* extend vlist code to allow keeping the old data structure instead of the new ↵Felix Fietkau2011-10-021-0/+5
| | | | one on updates
* make versioned lists more flexible by using an external comparatorFelix Fietkau2011-10-021-13/+7
|
* add code for versioned lists and use it to manage addresses and routesFelix Fietkau2011-09-071-1/+65
|
* move some code to utils.[ch]Felix Fietkau2011-09-071-0/+8