version 1.20, 1995/06/12 06:46:40 |
version 1.24, 1995/08/12 23:59:42 |
Line 184 udp_input(m, iphlen) |
|
Line 184 udp_input(m, iphlen) |
|
* (Algorithm copied from raw_intr().) |
* (Algorithm copied from raw_intr().) |
*/ |
*/ |
last = NULL; |
last = NULL; |
for (inp = udbtable.inpt_list.lh_first; inp != 0; |
for (inp = udbtable.inpt_queue.cqh_first; |
inp = inp->inp_list.le_next) { |
inp != (struct inpcb *)&udbtable.inpt_queue; |
|
inp = inp->inp_queue.cqe_next) { |
if (inp->inp_lport != uh->uh_dport) |
if (inp->inp_lport != uh->uh_dport) |
continue; |
continue; |
if (inp->inp_laddr.s_addr != INADDR_ANY) { |
if (inp->inp_laddr.s_addr != INADDR_ANY) { |
Line 365 udp_ctlinput(cmd, sa, ip) |
|
Line 366 udp_ctlinput(cmd, sa, ip) |
|
{ |
{ |
register struct udphdr *uh; |
register struct udphdr *uh; |
extern struct in_addr zeroin_addr; |
extern struct in_addr zeroin_addr; |
extern int inetctlerrmap[], errno; |
extern int inetctlerrmap[]; |
void (*notify) __P((struct inpcb *, int)) = udp_notify; |
void (*notify) __P((struct inpcb *, int)) = udp_notify; |
|
int errno; |
|
|
if ((unsigned)cmd >= PRC_NCMDS) |
if ((unsigned)cmd >= PRC_NCMDS) |
return; |
return; |
Line 375 udp_ctlinput(cmd, sa, ip) |
|
Line 377 udp_ctlinput(cmd, sa, ip) |
|
notify = in_rtchange, ip = 0; |
notify = in_rtchange, ip = 0; |
else if (cmd == PRC_HOSTDEAD) |
else if (cmd == PRC_HOSTDEAD) |
ip = 0; |
ip = 0; |
else if (errno = 0) |
else if (errno == 0) |
return; |
return; |
if (ip) { |
if (ip) { |
uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2)); |
uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2)); |
Line 408 udp_output(inp, m, addr, control) |
|
Line 410 udp_output(inp, m, addr, control) |
|
/* |
/* |
* Must block input while temporarily connected. |
* Must block input while temporarily connected. |
*/ |
*/ |
s = splnet(); |
s = splsoftnet(); |
error = in_pcbconnect(inp, addr); |
error = in_pcbconnect(inp, addr); |
if (error) { |
if (error) { |
splx(s); |
splx(s); |
Line 506 udp_usrreq(so, req, m, addr, control) |
|
Line 508 udp_usrreq(so, req, m, addr, control) |
|
error = EINVAL; |
error = EINVAL; |
break; |
break; |
} |
} |
s = splnet(); |
s = splsoftnet(); |
error = in_pcballoc(so, &udbtable); |
error = in_pcballoc(so, &udbtable); |
splx(s); |
splx(s); |
if (error) |
if (error) |
Line 522 udp_usrreq(so, req, m, addr, control) |
|
Line 524 udp_usrreq(so, req, m, addr, control) |
|
break; |
break; |
|
|
case PRU_BIND: |
case PRU_BIND: |
s = splnet(); |
s = splsoftnet(); |
error = in_pcbbind(inp, addr); |
error = in_pcbbind(inp, addr); |
splx(s); |
splx(s); |
break; |
break; |
Line 536 udp_usrreq(so, req, m, addr, control) |
|
Line 538 udp_usrreq(so, req, m, addr, control) |
|
error = EISCONN; |
error = EISCONN; |
break; |
break; |
} |
} |
s = splnet(); |
s = splsoftnet(); |
error = in_pcbconnect(inp, addr); |
error = in_pcbconnect(inp, addr); |
splx(s); |
splx(s); |
if (error == 0) |
if (error == 0) |
Line 556 udp_usrreq(so, req, m, addr, control) |
|
Line 558 udp_usrreq(so, req, m, addr, control) |
|
error = ENOTCONN; |
error = ENOTCONN; |
break; |
break; |
} |
} |
s = splnet(); |
s = splsoftnet(); |
in_pcbdisconnect(inp); |
in_pcbdisconnect(inp); |
inp->inp_laddr.s_addr = INADDR_ANY; |
inp->inp_laddr.s_addr = INADDR_ANY; |
splx(s); |
splx(s); |
|
|
udp_detach(inp) |
udp_detach(inp) |
struct inpcb *inp; |
struct inpcb *inp; |
{ |
{ |
int s = splnet(); |
int s = splsoftnet(); |
|
|
if (inp == udp_last_inpcb) |
if (inp == udp_last_inpcb) |
udp_last_inpcb = 0; |
udp_last_inpcb = 0; |