summaryrefslogtreecommitdiff
path: root/system.h
diff options
context:
space:
mode:
authorNaresh Kumar Mehta <naresh@codeaurora.org>2016-02-23 11:23:15 +0530
committerFelix Fietkau <nbd@openwrt.org>2016-03-07 09:43:43 +0100
commit7a51f23e7034157dee8e00910513d95e935eeab6 (patch)
tree295909c064113c7fb1e4c4560ba27fdf67be5610 /system.h
parentda687c2689f7ff2af1dccc9a428806dd15c3d554 (diff)
downloadnetifd-7a51f23e7034157dee8e00910513d95e935eeab6.tar.gz
utils.c: Add ip address validation
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>
Diffstat (limited to 'system.h')
0 files changed, 0 insertions, 0 deletions