SCCS-vsn: sys/netinet/in_pcb.c 7.14
SCCS-vsn: sys/netinet/in.c 7.17
- * Copyright (c) 1982, 1986 Regents of the University of California.
+ * Copyright (c) 1982, 1986, 1991 Regents of the University of California.
* All rights reserved.
*
* %sccs.include.redist.c%
*
* All rights reserved.
*
* %sccs.include.redist.c%
*
- * @(#)in.c 7.16 (Berkeley) %G%
+ * @(#)in.c 7.17 (Berkeley) %G%
*/
#include "param.h"
#include "ioctl.h"
#include "mbuf.h"
*/
#include "param.h"
#include "ioctl.h"
#include "mbuf.h"
#include "socket.h"
#include "socketvar.h"
#include "socket.h"
#include "socketvar.h"
-#include "../net/if.h"
-#include "../net/route.h"
-#include "../net/af.h"
+#include "net/if.h"
+#include "net/route.h"
+#include "net/af.h"
#include "in.h"
#include "in_var.h"
#include "in.h"
#include "in_var.h"
case SIOCSIFADDR:
case SIOCSIFNETMASK:
case SIOCSIFDSTADDR:
case SIOCSIFADDR:
case SIOCSIFNETMASK:
case SIOCSIFDSTADDR:
- if (error = suser(u.u_cred, &u.u_acflag))
- return (error);
+ if ((so->so_state & SS_PRIV) == 0)
+ return (EPERM);
if (ifp == 0)
panic("in_control");
if (ifp == 0)
panic("in_control");
break;
case SIOCSIFBRDADDR:
break;
case SIOCSIFBRDADDR:
- if (error = suser(u.u_cred, &u.u_acflag))
- return (error);
+ if ((so->so_state & SS_PRIV) == 0)
+ return (EPERM);
/* FALLTHROUGH */
case SIOCGIFADDR:
/* FALLTHROUGH */
case SIOCGIFADDR:
- * Copyright (c) 1982, 1986 Regents of the University of California.
+ * Copyright (c) 1982, 1986, 1991 Regents of the University of California.
* All rights reserved.
*
* %sccs.include.redist.c%
*
* All rights reserved.
*
* %sccs.include.redist.c%
*
- * @(#)in_pcb.c 7.13 (Berkeley) %G%
+ * @(#)in_pcb.c 7.14 (Berkeley) %G%
*/
#include "param.h"
#include "systm.h"
*/
#include "param.h"
#include "systm.h"
#include "malloc.h"
#include "mbuf.h"
#include "malloc.h"
#include "mbuf.h"
#include "socket.h"
#include "socketvar.h"
#include "ioctl.h"
#include "socket.h"
#include "socketvar.h"
#include "ioctl.h"
#include "../net/if.h"
#include "../net/route.h"
#include "../net/if.h"
#include "../net/route.h"
#include "in.h"
#include "in_systm.h"
#include "ip.h"
#include "in_pcb.h"
#include "in_var.h"
#include "in.h"
#include "in_systm.h"
#include "ip.h"
#include "in_pcb.h"
#include "in_var.h"
struct in_addr zeroin_addr;
struct in_addr zeroin_addr;
int wild = 0;
/* GROSS */
int wild = 0;
/* GROSS */
- if (aport < IPPORT_RESERVED && u.u_uid != 0)
+ if (aport < IPPORT_RESERVED && (so->so_state & SS_PRIV) == 0)
return (EACCES);
/* even GROSSER, but this is the Internet */
if ((so->so_options & SO_REUSEADDR) == 0 &&
return (EACCES);
/* even GROSSER, but this is the Internet */
if ((so->so_options & SO_REUSEADDR) == 0 &&