Deleted Added
full compact
ipx.c (24204) ipx.c (25345)
1/*
2 * Copyright (c) 1995, Mike Mitchell
3 * Copyright (c) 1984, 1985, 1986, 1987, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)ipx.c
35 *
1/*
2 * Copyright (c) 1995, Mike Mitchell
3 * Copyright (c) 1984, 1985, 1986, 1987, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)ipx.c
35 *
36 * $Id: ipx.c,v 1.7 1997/02/22 09:41:51 peter Exp $
36 * $Id: ipx.c,v 1.8 1997/03/24 11:33:31 bde Exp $
37 */
38
39#include <sys/param.h>
40#include <sys/queue.h>
41#include <sys/systm.h>
42#include <sys/mbuf.h>
43#include <sys/sockio.h>
37 */
38
39#include <sys/param.h>
40#include <sys/queue.h>
41#include <sys/systm.h>
42#include <sys/mbuf.h>
43#include <sys/sockio.h>
44#include <sys/proc.h>
44#include <sys/protosw.h>
45#include <sys/errno.h>
46#include <sys/socket.h>
47#include <sys/socketvar.h>
48
49#include <net/if.h>
50#include <net/route.h>
51

--- 5 unchanged lines hidden (view full) ---

57struct ipx_ifaddr *ipx_ifaddr;
58int ipx_interfaces;
59
60/*
61 * Generic internet control operations (ioctl's).
62 */
63/* ARGSUSED */
64int
45#include <sys/protosw.h>
46#include <sys/errno.h>
47#include <sys/socket.h>
48#include <sys/socketvar.h>
49
50#include <net/if.h>
51#include <net/route.h>
52

--- 5 unchanged lines hidden (view full) ---

58struct ipx_ifaddr *ipx_ifaddr;
59int ipx_interfaces;
60
61/*
62 * Generic internet control operations (ioctl's).
63 */
64/* ARGSUSED */
65int
65ipx_control(so, cmd, data, ifp)
66ipx_control(so, cmd, data, ifp, p)
66 struct socket *so;
67 int cmd;
68 caddr_t data;
69 register struct ifnet *ifp;
67 struct socket *so;
68 int cmd;
69 caddr_t data;
70 register struct ifnet *ifp;
71 struct proc *p;
70{
71 register struct ifreq *ifr = (struct ifreq *)data;
72 register struct ipx_aliasreq *ifra = (struct ipx_aliasreq *)data;
73 register struct ipx_ifaddr *ia;
74 struct ifaddr *ifa;
75 struct ipx_ifaddr *oia;
76 int dstIsNew, hostIsNew;
77 int error = 0;

--- 27 unchanged lines hidden (view full) ---

105 if (ia == (struct ipx_ifaddr *)0)
106 return (EADDRNOTAVAIL);
107 if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
108 return (EINVAL);
109 *(struct sockaddr_ipx *)&ifr->ifr_dstaddr = ia->ia_dstaddr;
110 return (0);
111 }
112
72{
73 register struct ifreq *ifr = (struct ifreq *)data;
74 register struct ipx_aliasreq *ifra = (struct ipx_aliasreq *)data;
75 register struct ipx_ifaddr *ia;
76 struct ifaddr *ifa;
77 struct ipx_ifaddr *oia;
78 int dstIsNew, hostIsNew;
79 int error = 0;

--- 27 unchanged lines hidden (view full) ---

107 if (ia == (struct ipx_ifaddr *)0)
108 return (EADDRNOTAVAIL);
109 if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
110 return (EINVAL);
111 *(struct sockaddr_ipx *)&ifr->ifr_dstaddr = ia->ia_dstaddr;
112 return (0);
113 }
114
113 if ((so->so_state & SS_PRIV) == 0)
114 return (EPERM);
115 if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0)
116 return (error);
115
116 switch (cmd) {
117 case SIOCAIFADDR:
118 case SIOCDIFADDR:
119 if (ifra->ifra_addr.sipx_family == AF_IPX)
120 for (oia = ia; ia; ia = ia->ia_next) {
121 if (ia->ia_ifp == ifp &&
122 ipx_neteq(ia->ia_addr.sipx_addr,

--- 238 unchanged lines hidden ---
117
118 switch (cmd) {
119 case SIOCAIFADDR:
120 case SIOCDIFADDR:
121 if (ifra->ifra_addr.sipx_family == AF_IPX)
122 for (oia = ia; ia; ia = ia->ia_next) {
123 if (ia->ia_ifp == ifp &&
124 ipx_neteq(ia->ia_addr.sipx_addr,

--- 238 unchanged lines hidden ---