SCCS-vsn: sys/netinet/in_pcb.c 4.38
SCCS-vsn: sys/netinet/ip_input.c 1.61
SCCS-vsn: sys/netinet/tcp_output.c 4.50
SCCS-vsn: sys/netinet/tcp_subr.c 4.38
SCCS-vsn: sys/netinet/tcp_timer.c 4.29
SCCS-vsn: sys/netinet/udp_usrreq.c 4.42
-/* in_pcb.c 4.37 82/12/14 */
+/* in_pcb.c 4.38 83/01/04 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
register struct inpcb *inp;
m = m_getclr(M_DONTWAIT, MT_PCB);
register struct inpcb *inp;
m = m_getclr(M_DONTWAIT, MT_PCB);
return (ENOBUFS);
inp = mtod(m, struct inpcb *);
inp->inp_head = head;
return (ENOBUFS);
inp = mtod(m, struct inpcb *);
inp->inp_head = head;
if (ifnet == 0)
return (EADDRNOTAVAIL);
if (ifnet == 0)
return (EADDRNOTAVAIL);
- if (inp->inp_lport || inp->inp_laddr.s_addr)
+ if (inp->inp_lport || inp->inp_laddr.s_addr != INADDR_ANY)
return (EINVAL);
if (nam == 0)
goto noname;
sin = mtod(nam, struct sockaddr_in *);
if (nam->m_len != sizeof (*sin))
return (EINVAL);
return (EINVAL);
if (nam == 0)
goto noname;
sin = mtod(nam, struct sockaddr_in *);
if (nam->m_len != sizeof (*sin))
return (EINVAL);
- if (sin->sin_addr.s_addr) {
+ if (sin->sin_addr.s_addr != INADDR_ANY) {
int tport = sin->sin_port;
sin->sin_port = 0; /* yech... */
int tport = sin->sin_port;
sin->sin_port = 0; /* yech... */
return (EINVAL);
if (sin->sin_family != AF_INET)
return (EAFNOSUPPORT);
return (EINVAL);
if (sin->sin_family != AF_INET)
return (EAFNOSUPPORT);
- if (sin->sin_addr.s_addr == 0 || sin->sin_port == 0)
+ if (sin->sin_addr.s_addr == INADDR_ANY || sin->sin_port == 0)
- if (inp->inp_laddr.s_addr == 0) {
+ if (inp->inp_laddr.s_addr == INADDR_ANY) {
ifp = if_ifonnetof(in_netof(sin->sin_addr));
if (ifp == 0) {
/*
ifp = if_ifonnetof(in_netof(sin->sin_addr));
if (ifp == 0) {
/*
inp->inp_lport,
0))
return (EADDRINUSE);
inp->inp_lport,
0))
return (EADDRINUSE);
- if (inp->inp_laddr.s_addr == 0)
+ if (inp->inp_laddr.s_addr == INADDR_ANY)
inp->inp_laddr = ifaddr->sin_addr;
inp->inp_faddr = sin->sin_addr;
inp->inp_fport = sin->sin_port;
inp->inp_laddr = ifaddr->sin_addr;
inp->inp_faddr = sin->sin_addr;
inp->inp_fport = sin->sin_port;
- inp->inp_faddr.s_addr = 0;
+ inp->inp_faddr.s_addr = INADDR_ANY;
inp->inp_fport = 0;
if (inp->inp_socket->so_state & SS_NOFDREF)
in_pcbdetach(inp);
inp->inp_fport = 0;
if (inp->inp_socket->so_state & SS_NOFDREF)
in_pcbdetach(inp);
if (inp->inp_lport != lport)
continue;
wildcard = 0;
if (inp->inp_lport != lport)
continue;
wildcard = 0;
- if (inp->inp_laddr.s_addr != 0) {
- if (laddr.s_addr == 0)
+ if (inp->inp_laddr.s_addr != INADDR_ANY) {
+ if (laddr.s_addr == INADDR_ANY)
wildcard++;
else if (inp->inp_laddr.s_addr != laddr.s_addr)
continue;
} else {
wildcard++;
else if (inp->inp_laddr.s_addr != laddr.s_addr)
continue;
} else {
+ if (laddr.s_addr != INADDR_ANY)
- if (inp->inp_faddr.s_addr != 0) {
- if (faddr.s_addr == 0)
+ if (inp->inp_faddr.s_addr != INADDR_ANY) {
+ if (faddr.s_addr == INADDR_ANY)
wildcard++;
else if (inp->inp_faddr.s_addr != faddr.s_addr ||
inp->inp_fport != fport)
continue;
} else {
wildcard++;
else if (inp->inp_faddr.s_addr != faddr.s_addr ||
inp->inp_fport != fport)
continue;
} else {
+ if (faddr.s_addr != INADDR_ANY)
wildcard++;
}
if (wildcard && (flags & INPLOOKUP_WILDCARD) == 0)
wildcard++;
}
if (wildcard && (flags & INPLOOKUP_WILDCARD) == 0)
-/* ip_input.c 1.60 83/01/03 */
+/* ip_input.c 1.61 83/01/04 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
case IPOPT_TS_PRESPEC:
ipaddr.sin_addr = *sin;
case IPOPT_TS_PRESPEC:
ipaddr.sin_addr = *sin;
- if (!if_ifwithaddr((struct sockaddr *)&ipaddr))
+ if (if_ifwithaddr((struct sockaddr *)&ipaddr) == 0)
continue;
if (ipt->ipt_ptr + 8 > ipt->ipt_len)
goto bad;
continue;
if (ipt->ipt_ptr + 8 > ipt->ipt_len)
goto bad;
-/* tcp_output.c 4.49 82/12/14 */
+/* tcp_output.c 4.50 83/01/04 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../netinet/tcp_debug.h"
#include <errno.h>
#include "../netinet/tcp_debug.h"
#include <errno.h>
-char *tcpstates[]; /* XXX */
-
* the template for sends on this connection.
*/
MGET(m, M_DONTWAIT, MT_DATA);
* the template for sends on this connection.
*/
MGET(m, M_DONTWAIT, MT_DATA);
return (ENOBUFS);
m->m_off = MMAXOFF - sizeof (struct tcpiphdr);
m->m_len = sizeof (struct tcpiphdr);
return (ENOBUFS);
m->m_off = MMAXOFF - sizeof (struct tcpiphdr);
m->m_len = sizeof (struct tcpiphdr);
/*
* If anything to send and we can send it all, set PUSH.
* (This will keep happy those implementations which only
/*
* If anything to send and we can send it all, set PUSH.
* (This will keep happy those implementations which only
- * give data to the user when a buffer fills or a PUSH comes in.
+ * give data to the user when a buffer fills or a PUSH comes in.)
*/
if (len && off+len == so->so_snd.sb_cc)
ti->ti_flags |= TH_PUSH;
*/
if (len && off+len == so->so_snd.sb_cc)
ti->ti_flags |= TH_PUSH;
-/* tcp_subr.c 4.37 82/12/16 */
+/* tcp_subr.c 4.38 83/01/04 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
register struct tcpiphdr *n;
m = m_get(M_WAIT, MT_HEADER);
register struct tcpiphdr *n;
m = m_get(M_WAIT, MT_HEADER);
return (0);
m->m_off = MMAXOFF - sizeof (struct tcpiphdr);
m->m_len = sizeof (struct tcpiphdr);
return (0);
m->m_off = MMAXOFF - sizeof (struct tcpiphdr);
m->m_len = sizeof (struct tcpiphdr);
}
if (flags == 0) {
m = m_get(M_DONTWAIT, MT_HEADER);
}
if (flags == 0) {
m = m_get(M_DONTWAIT, MT_HEADER);
return;
m->m_len = sizeof (struct tcpiphdr) + 1;
*mtod(m, struct tcpiphdr *) = *ti;
return;
m->m_len = sizeof (struct tcpiphdr) + 1;
*mtod(m, struct tcpiphdr *) = *ti;
struct mbuf *m = m_getclr(M_DONTWAIT, MT_PCB);
register struct tcpcb *tp;
struct mbuf *m = m_getclr(M_DONTWAIT, MT_PCB);
register struct tcpcb *tp;
- if (m == 0)
- return (0);
+ if (m == NULL)
+ return ((struct tcpcb *)0);
tp = mtod(m, struct tcpcb *);
tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp;
/*
tp = mtod(m, struct tcpcb *);
tp->seg_next = tp->seg_prev = (struct tcpiphdr *)tp;
/*
-/* tcp_timer.c 4.28 82/10/20 */
+/* tcp_timer.c 4.29 83/01/04 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
float tcp_backoff[TCP_MAXRXTSHIFT] =
{ 1.0, 1.2, 1.4, 1.7, 2.0, 3.0, 5.0, 8.0, 16.0, 32.0 };
float tcp_backoff[TCP_MAXRXTSHIFT] =
{ 1.0, 1.2, 1.4, 1.7, 2.0, 3.0, 5.0, 8.0, 16.0, 32.0 };
int tcpexprexmtbackoff = 0;
/*
* TCP timer processing.
int tcpexprexmtbackoff = 0;
/*
* TCP timer processing.
tcp_backoff[tp->t_rxtshift - 1],
TCPTV_MIN, TCPTV_MAX);
}
tcp_backoff[tp->t_rxtshift - 1],
TCPTV_MIN, TCPTV_MAX);
}
-if (tcprexmtprint)
-printf("rexmt set to %d\n", tp->t_timer[TCPT_REXMT]);
tp->snd_nxt = tp->snd_una;
/* this only transmits one segment! */
(void) tcp_output(tp);
tp->snd_nxt = tp->snd_una;
/* this only transmits one segment! */
(void) tcp_output(tp);
-/* udp_usrreq.c 4.41 82/12/14 */
+/* udp_usrreq.c 4.42 83/01/04 */
#include "../h/param.h"
#include "../h/dir.h"
#include "../h/param.h"
#include "../h/dir.h"
ui->ui_src, ui->ui_sport, ui->ui_dst, ui->ui_dport,
INPLOOKUP_WILDCARD);
if (inp == 0) {
ui->ui_src, ui->ui_sport, ui->ui_dst, ui->ui_dport,
INPLOOKUP_WILDCARD);
if (inp == 0) {
- struct in_addr broadcastaddr;
-
- broadcastaddr =
- if_makeaddr(in_netof(ui->ui_dst), INADDR_ANY);
- if (ui->ui_dst.s_addr == broadcastaddr.s_addr)
+ /* don't send ICMP response for broadcast packet */
+ if (in_lnaof(ui->ui_dst) == INADDR_ANY)
goto bad;
icmp_error((struct ip *)ui, ICMP_UNREACH, ICMP_UNREACH_PORT);
return;
goto bad;
icmp_error((struct ip *)ui, ICMP_UNREACH, ICMP_UNREACH_PORT);
return;
udp_in.sin_addr = ui->ui_src;
m->m_len -= sizeof (struct udpiphdr);
m->m_off += sizeof (struct udpiphdr);
udp_in.sin_addr = ui->ui_src;
m->m_len -= sizeof (struct udpiphdr);
m->m_off += sizeof (struct udpiphdr);
-SBCHECK(&inp->inp_socket->so_rcv, "udpinput before");
if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in, m) == 0)
goto bad;
if (sbappendaddr(&inp->inp_socket->so_rcv, (struct sockaddr *)&udp_in, m) == 0)
goto bad;
-SBCHECK(&inp->inp_socket->so_rcv, "udpinput after");
sorwakeup(inp->inp_socket);
return;
bad:
sorwakeup(inp->inp_socket);
return;
bad:
- if (inp->inp_faddr.s_addr)
+ if (inp->inp_faddr.s_addr != INADDR_ANY)
return (EISCONN);
error = in_pcbconnect(inp, nam);
if (error == 0)
return (EISCONN);
error = in_pcbconnect(inp, nam);
if (error == 0)
return (EOPNOTSUPP);
case PRU_DISCONNECT:
return (EOPNOTSUPP);
case PRU_DISCONNECT:
- if (inp->inp_faddr.s_addr == 0)
+ if (inp->inp_faddr.s_addr == INADDR_ANY)
return (ENOTCONN);
in_pcbdisconnect(inp);
soisdisconnected(so);
return (ENOTCONN);
in_pcbdisconnect(inp);
soisdisconnected(so);
if (nam) {
laddr = inp->inp_laddr;
if (nam) {
laddr = inp->inp_laddr;
- if (inp->inp_faddr.s_addr)
+ if (inp->inp_faddr.s_addr != INADDR_ANY)
return (EISCONN);
error = in_pcbconnect(inp, nam);
if (error)
break;
} else {
return (EISCONN);
error = in_pcbconnect(inp, nam);
if (error)
break;
} else {
- if (inp->inp_faddr.s_addr == 0)
+ if (inp->inp_faddr.s_addr == INADDR_ANY)
return (ENOTCONN);
}
error = udp_output(inp, m);
return (ENOTCONN);
}
error = udp_output(inp, m);