diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-05-13 10:17:14 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-05-13 10:17:14 +0000 |
commit | d32796a55c78fab34d73da533e546d5c94704089 (patch) | |
tree | 7534074e25254a14256880b9fb1afdb60405fdc1 /sys/netinet | |
parent | f89af55c25377109fbffa815e4e4ebbb97f3b897 (diff) |
Make SIOCSIFDSTMASK and SIOCSIFNETMASK fail if there is no previous
address configured on the interface just like SIOCSIFBRDADDR does.
This prevent the global IPv4 address list and the per-interface list
to be out of sync until one of SIOCAIFADDR or SIOCSIFADDR ioctl(2)
is issued.
ok mikeb@, sthen@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 29bcaae5953..b8f72cd8051 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.75 2013/04/17 08:25:37 mpi Exp $ */ +/* $OpenBSD: in.c,v 1.76 2013/05/13 10:17:13 mpi Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -234,8 +234,6 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) return (EADDRNOTAVAIL); /* FALLTHROUGH */ case SIOCSIFADDR: - case SIOCSIFNETMASK: - case SIOCSIFDSTADDR: if ((so->so_state & SS_PRIV) == 0) return (EPERM); @@ -264,6 +262,8 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) newifaddr = 0; break; + case SIOCSIFNETMASK: + case SIOCSIFDSTADDR: case SIOCSIFBRDADDR: if ((so->so_state & SS_PRIV) == 0) return (EPERM); |