summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bb7fff0)
properly, bug fix to raw
SCCS-vsn: sys/net/if.c 4.10
SCCS-vsn: sys/net/if.h 4.9
SCCS-vsn: sys/vax/if/if_dmc.c 4.5
SCCS-vsn: sys/vax/if/if_en.c 4.40
SCCS-vsn: sys/deprecated/netimp/if_imp.c 4.15
SCCS-vsn: sys/deprecated/netimp/if_imphost.c 4.8
SCCS-vsn: sys/net/if_loop.c 4.6
SCCS-vsn: sys/netinet/ip_input.c 1.32
SCCS-vsn: sys/netinet/ip_output.c 1.26
SCCS-vsn: sys/netinet/raw_ip.c 4.8
SCCS-vsn: sys/net/raw_usrreq.c 4.10
SCCS-vsn: sys/netinet/tcp_input.c 1.61
SCCS-vsn: sys/netinet/tcp_output.c 4.34
SCCS-vsn: sys/netinet/tcp_subr.c 4.18
SCCS-vsn: sys/netinet/tcp_timer.c 4.16
SCCS-vsn: sys/netinet/udp_usrreq.c 4.22
16 files changed:
-/* if_imp.c 4.14 82/03/13 */
+/* if_imp.c 4.15 82/03/15 */
#include "imp.h"
#if NIMP > 0
#include "imp.h"
#if NIMP > 0
return ((int)&sc->imp_if);
}
return ((int)&sc->imp_if);
}
+#ifdef notdef
+/*
+ * Timer routine to keep priming the IMP until it sends
+ * us the noops we need. Since we depend on the host and
+ * imp values returned in the noop messages, we must wait
+ * for them before we allow any outgoing traffic.
+ */
+imptimer(sc)
+ register struct imp_softc *sc;
+{
+ int s = splimp();
+
+ if (sc->imp_state != IMPS_INIT) {
+ splx(s);
+ return;
+ }
+ sc->imp_dropcnt = IMP_DROPCNT;
+ impnoops(sc);
+ timeout(imptimer, (caddr_t)sc, 30 * hz);
+ splx(s);
+}
+#endif
+
/*
* IMP initialization routine: call hardware module to
* setup UNIBUS resources, init state and get ready for
/*
* IMP initialization routine: call hardware module to
* setup UNIBUS resources, init state and get ready for
return;
}
sc->imp_state = IMPS_INIT;
return;
}
sc->imp_state = IMPS_INIT;
+#ifdef notdef
+ imptimer(sc);
+#else
sc->imp_dropcnt = IMP_DROPCNT;
impnoops(sc);
sc->imp_dropcnt = IMP_DROPCNT;
impnoops(sc);
}
struct sockproto impproto = { PF_IMPLINK };
}
struct sockproto impproto = { PF_IMPLINK };
(struct sockaddr *)&impsrc);
return;
}
(struct sockaddr *)&impsrc);
return;
}
+ if (IF_QFULL(inq)) {
+ IF_DROP(inq);
+ goto drop;
+ }
IF_ENQUEUE(inq, m);
return;
IF_ENQUEUE(inq, m);
return;
impdown(sc)
struct imp_softc *sc;
{
impdown(sc)
struct imp_softc *sc;
{
sc->imp_state = IMPS_DOWN;
impmsg(sc, "marked down");
/* notify protocols with messages waiting? */
sc->imp_state = IMPS_DOWN;
impmsg(sc, "marked down");
/* notify protocols with messages waiting? */
printf("imp%d: ", sc->imp_if.if_unit);
printf(fmt, a1, a2);
printf("\n");
printf("imp%d: ", sc->imp_if.if_unit);
printf(fmt, a1, a2);
printf("\n");
+ if (IF_QFULL(&ifp->if_snd)) {
+ IF_DROP(&ifp->if_snd);
+ m_freem(m);
+ splx(x);
+ return (0);
+ }
IF_ENQUEUE(&ifp->if_snd, m);
start:
splx(x);
IF_ENQUEUE(&ifp->if_snd, m);
start:
splx(x);
-/* if_imphost.c 4.7 82/03/12 */
+/* if_imphost.c 4.8 82/03/15 */
#include "imp.h"
#if NIMP > 0
#include "imp.h"
#if NIMP > 0
addr.s_lh = 0;
mprev = &hosts;
while (m = *mprev) {
addr.s_lh = 0;
mprev = &hosts;
while (m = *mprev) {
hp = &mtod(m, struct hmbuf *)->hm_hosts[hash];
if (hp->h_refcnt == 0) {
if (hp0 == 0)
hp = &mtod(m, struct hmbuf *)->hm_hosts[hash];
if (hp->h_refcnt == 0) {
if (hp0 == 0)
}
if (hp->h_addr.s_addr == addr.s_addr)
goto foundhost;
}
if (hp->h_addr.s_addr == addr.s_addr)
goto foundhost;
+/* if.c 4.10 82/03/15 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../net/in_systm.h"
#include "../net/if.h"
#include "../net/in_systm.h"
#include "../net/if.h"
+int ifqmaxlen = IFQ_MAXLEN;
+
ifinit()
{
register struct ifnet *ifp;
for (ifp = ifnet; ifp; ifp = ifp->if_next)
ifinit()
{
register struct ifnet *ifp;
for (ifp = ifnet; ifp; ifp = ifp->if_next)
+ if (ifp->if_snd.ifq_maxlen == 0)
+ ifp->if_snd.ifq_maxlen = ifqmaxlen;
+ }
/*
* Structures defining a network interface, providing a packet
/*
* Structures defining a network interface, providing a packet
struct ifqueue {
struct mbuf *ifq_head;
struct mbuf *ifq_tail;
struct ifqueue {
struct mbuf *ifq_head;
struct mbuf *ifq_tail;
+ int ifq_len;
+ int ifq_maxlen;
+ int ifq_drops;
} if_snd; /* output queue */
/* procedure handles */
int (*if_init)(); /* init routine */
} if_snd; /* output queue */
/* procedure handles */
int (*if_init)(); /* init routine */
* (defined above). Entries are added to and deleted from these structures
* by these macros, which should be called with ipl raised to splimp().
*/
* (defined above). Entries are added to and deleted from these structures
* by these macros, which should be called with ipl raised to splimp().
*/
+#define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
+#define IF_DROP(ifq) ((ifq)->ifq_drops++)
#define IF_ENQUEUE(ifq, m) { \
(m)->m_act = 0; \
if ((ifq)->ifq_tail == 0) \
#define IF_ENQUEUE(ifq, m) { \
(m)->m_act = 0; \
if ((ifq)->ifq_tail == 0) \
else \
(ifq)->ifq_tail->m_act = m; \
(ifq)->ifq_tail = m; \
else \
(ifq)->ifq_tail->m_act = m; \
(ifq)->ifq_tail = m; \
}
#define IF_PREPEND(ifq, m) { \
(m)->m_act = (ifq)->ifq_head; \
if ((ifq)->ifq_tail == 0) \
(ifq)->ifq_tail = (m); \
(ifq)->ifq_head = (m); \
}
#define IF_PREPEND(ifq, m) { \
(m)->m_act = (ifq)->ifq_head; \
if ((ifq)->ifq_tail == 0) \
(ifq)->ifq_tail = (m); \
(ifq)->ifq_head = (m); \
}
#define IF_DEQUEUE(ifq, m) { \
(m) = (ifq)->ifq_head; \
}
#define IF_DEQUEUE(ifq, m) { \
(m) = (ifq)->ifq_head; \
if (((ifq)->ifq_head = (m)->m_act) == 0) \
(ifq)->ifq_tail = 0; \
(m)->m_act = 0; \
if (((ifq)->ifq_head = (m)->m_act) == 0) \
(ifq)->ifq_tail = 0; \
(m)->m_act = 0; \
#ifdef KERNEL
#ifdef INET
struct ifqueue ipintrq; /* ip packet input queue */
#ifdef KERNEL
#ifdef INET
struct ifqueue ipintrq; /* ip packet input queue */
-/* if_loop.c 4.5 81/12/22 */
+/* if_loop.c 4.6 82/03/15 */
/*
* Loopback interface driver for protocol testing and timing.
/*
* Loopback interface driver for protocol testing and timing.
int pf;
{
int s = splimp();
int pf;
{
int s = splimp();
+ register struct ifqueue *ifq;
ifp->if_opackets++;
switch (pf) {
#ifdef INET
case PF_INET:
ifp->if_opackets++;
switch (pf) {
#ifdef INET
case PF_INET:
- IF_ENQUEUE(&ipintrq, m0);
+ ifq = &ipintrq;
+ if (IF_QFULL(ifq)) {
+ IF_DROP(ifq);
+ (void) m_freem(m0);
+ splx(s);
+ return (0);
+ }
+ IF_ENQUEUE(ifq, m0);
setipintr();
break;
#endif
setipintr();
break;
#endif
default:
splx(s);
printf("lo%d: can't encapsulate pf%d\n", ifp->if_unit, pf);
default:
splx(s);
printf("lo%d: can't encapsulate pf%d\n", ifp->if_unit, pf);
return (0);
}
ifp->if_ipackets++;
return (0);
}
ifp->if_ipackets++;
-/* raw_usrreq.c 4.9 82/03/13 */
+/* raw_usrreq.c 4.10 82/03/15 */
#include "../h/param.h"
#include "../h/mbuf.h"
#include "../h/param.h"
#include "../h/mbuf.h"
#include "../net/raw_cb.h"
#include "../errno.h"
#include "../net/raw_cb.h"
#include "../errno.h"
+int rawqmaxlen = IFQ_MAXLEN;
+
/*
* Initialize raw connection block q.
/*
* Initialize raw connection block q.
COUNT(RAW_INIT);
rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
COUNT(RAW_INIT);
rawcb.rcb_next = rawcb.rcb_prev = &rawcb;
+ rawintrq.ifq_maxlen = IFQ_MAXLEN;
* running at software interrupt level.
*/
s = splimp();
* running at software interrupt level.
*/
s = splimp();
- IF_ENQUEUE(&rawintrq, m);
+ if (IF_QFULL(&rawintrq))
+ m_freem(m);
+ else
+ IF_ENQUEUE(&rawintrq, m);
* the appropriate raw interface routine.
*/
case PRU_ATTACH:
* the appropriate raw interface routine.
*/
case PRU_ATTACH:
+ if ((so->so_state & SS_PRIV) == 0)
+ return (EPERM);
error = raw_attach(so, (struct sockaddr *)addr);
break;
error = raw_attach(so, (struct sockaddr *)addr);
break;
-/* ip_input.c 1.31 82/03/09 */
+/* ip_input.c 1.32 82/03/15 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../net/tcp.h"
u_char ip_protox[IPPROTO_MAX];
#include "../net/tcp.h"
u_char ip_protox[IPPROTO_MAX];
+int ipqmaxlen = IFQ_MAXLEN;
/*
* IP initialization: fill in IP protocol switch table.
/*
* IP initialization: fill in IP protocol switch table.
ip_protox[pr->pr_protocol] = pr - protosw;
ipq.next = ipq.prev = &ipq;
ip_id = time & 0xffff;
ip_protox[pr->pr_protocol] = pr - protosw;
ipq.next = ipq.prev = &ipq;
ip_id = time & 0xffff;
+ ipintrq.ifq_maxlen = ipqmaxlen;
if (hlen > sizeof (struct ip))
ip_dooptions(ip);
if (ifnet && ip->ip_dst.s_addr != ifnet->if_addr.s_addr &&
if (hlen > sizeof (struct ip))
ip_dooptions(ip);
if (ifnet && ip->ip_dst.s_addr != ifnet->if_addr.s_addr &&
- ip->ip_dst.s_addr != ifnet->if_broadaddr.s_addr &&
if_ifwithaddr(ip->ip_dst) == 0) {
if_ifwithaddr(ip->ip_dst) == 0) {
-printf("ip->ip_dst %x ip->ip_ttl %x\n", ip->ip_dst, ip->ip_ttl);
- if (1)
- goto bad;
+
+ goto bad;
+#ifdef notdef
+ printf("ip->ip_dst %x ip->ip_ttl %x\n",
+ ip->ip_dst, ip->ip_ttl);
if (--ip->ip_ttl == 0) {
icmp_error(ip, ICMP_TIMXCEED, 0);
goto next;
if (--ip->ip_ttl == 0) {
icmp_error(ip, ICMP_TIMXCEED, 0);
goto next;
if (mopt == 0)
goto bad;
ip_stripoptions(ip, mopt);
if (mopt == 0)
goto bad;
ip_stripoptions(ip, mopt);
- (void) ip_output(m0, mopt);
+ /* 0 here means no directed broadcast */
+ (void) ip_output(m0, mopt, 0);
-/* ip_output.c 1.25 82/02/18 */
+/* ip_output.c 1.26 82/03/15 */
#include "../h/param.h"
#include "../h/mbuf.h"
#include "../h/param.h"
#include "../h/mbuf.h"
#include "../net/ip.h"
#include "../net/ip_var.h"
#include "../net/ip.h"
#include "../net/ip_var.h"
+ip_output(m, opt, allowbroadcast)
struct mbuf *m;
struct mbuf *opt;
struct mbuf *m;
struct mbuf *opt;
{
register struct ip *ip = mtod(m, struct ip *);
register struct ifnet *ifp;
{
register struct ip *ip = mtod(m, struct ip *);
register struct ifnet *ifp;
if (ifp == 0)
goto bad;
}
if (ifp == 0)
goto bad;
}
+ if (!allowbroadcast && ifp->if_broadaddr.s_addr != 0 &&
+ ifp->if_broadaddr.s_addr == ip->ip_dst.s_addr)
+ goto bad;
/*
* If small enough for interface, can just send directly.
/*
* If small enough for interface, can just send directly.
-/* raw_ip.c 4.7 82/03/13 */
+/* raw_ip.c 4.8 82/03/15 */
#include "../h/param.h"
#include "../h/mbuf.h"
#include "../h/param.h"
#include "../h/mbuf.h"
ip->ip_src =
((struct sockaddr_in *)&so->so_addr)->sin_addr;
ip->ip_ttl = MAXTTL;
ip->ip_src =
((struct sockaddr_in *)&so->so_addr)->sin_addr;
ip->ip_ttl = MAXTTL;
- return (ip_output(m, (struct mbuf *)0));
+ return (ip_output(m, (struct mbuf *)0, 1));
-/* tcp_input.c 1.60 82/03/13 */
+/* tcp_input.c 1.61 82/03/15 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../net/tcp_debug.h"
#include "../errno.h"
#include "../net/tcp_debug.h"
#include "../errno.h"
int tcpcksum = 1;
struct sockaddr_in tcp_in = { AF_INET };
struct tcpiphdr tcp_saveti;
int tcpcksum = 1;
struct sockaddr_in tcp_in = { AF_INET };
struct tcpiphdr tcp_saveti;
#endif
if (ti->ti_sum = in_cksum(m, len)) {
tcpstat.tcps_badsum++;
#endif
if (ti->ti_sum = in_cksum(m, len)) {
tcpstat.tcps_badsum++;
- printf("tcp cksum %x\n", ti->ti_sum);
+ if (tcpprintfs)
+ printf("tcp cksum %x\n", ti->ti_sum);
tcpstat.tcps_badoff++;
goto drop;
}
tcpstat.tcps_badoff++;
goto drop;
}
- ti->ti_len = tlen - off;
+ tlen -= off;
+ ti->ti_len = tlen;
if (off > sizeof (struct tcphdr)) {
if ((m = m_pullup(m, sizeof (struct ip) + off)) == 0) {
tcpstat.tcps_hdrops++;
if (off > sizeof (struct tcphdr)) {
if ((m = m_pullup(m, sizeof (struct ip) + off)) == 0) {
tcpstat.tcps_hdrops++;
tiflags = ti->ti_flags;
/*
tiflags = ti->ti_flags;
/*
+ * Drop TCP and IP headers.
*/
off += sizeof (struct ip);
m->m_off += off;
*/
off += sizeof (struct ip);
m->m_off += off;
tiflags &= ~TH_URG;
todrop--;
}
tiflags &= ~TH_URG;
todrop--;
}
- if (todrop > ti->ti_len)
+ if (todrop > ti->ti_len ||
+ todrop == ti->ti_len && (tiflags&TH_FIN) == 0)
goto dropafterack;
m_adj(m, todrop);
ti->ti_seq += todrop;
goto dropafterack;
m_adj(m, todrop);
ti->ti_seq += todrop;
*/
todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
if (todrop > 0) {
*/
todrop = (ti->ti_seq+ti->ti_len) - (tp->rcv_nxt+tp->rcv_wnd);
if (todrop > 0) {
- if (todrop > ti->ti_len)
+ if (todrop >= ti->ti_len)
goto dropafterack;
m_adj(m, -todrop);
ti->ti_len -= todrop;
goto dropafterack;
m_adj(m, -todrop);
ti->ti_len -= todrop;
- * Generate an ACK dropping incoming segment.
- * Make ACK reflect our state.
+ * Generate an ACK dropping incoming segment if it occupies
+ * sequence space, where the ACK reflects our state.
+ if ((tiflags&TH_RST) ||
+ tlen == 0 && (tiflags&(TH_SYN|TH_FIN)) == 0)
goto drop;
tcp_respond(tp, ti, tp->rcv_nxt, tp->snd_nxt, TH_ACK);
return;
goto drop;
tcp_respond(tp, ti, tp->rcv_nxt, tp->snd_nxt, TH_ACK);
return;
else {
if (tiflags & TH_SYN)
ti->ti_len++;
else {
if (tiflags & TH_SYN)
ti->ti_len++;
- tcp_respond(tp, ti, ti->ti_seq+ti->ti_len, (tcp_seq)0, TH_RST|TH_ACK);
+ tcp_respond(tp, ti, ti->ti_seq+ti->ti_len, (tcp_seq)0,
+ TH_RST|TH_ACK);
-/* tcp_output.c 4.33 82/03/13 */
+/* tcp_output.c 4.34 82/03/15 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
*/
((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
((struct ip *)ti)->ip_ttl = TCP_TTL;
*/
((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
((struct ip *)ti)->ip_ttl = TCP_TTL;
- if (ip_output(m, tp->t_ipopt) == 0)
+ if (ip_output(m, tp->t_ipopt, 0) == 0)
-/* tcp_subr.c 4.17 82/03/13 */
+/* tcp_subr.c 4.18 82/03/15 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
int flags;
{
struct mbuf *m;
int flags;
{
struct mbuf *m;
COUNT(TCP_RESPOND);
if (tp)
COUNT(TCP_RESPOND);
if (tp)
if (m == 0)
return;
m->m_off = MMINOFF;
if (m == 0)
return;
m->m_off = MMINOFF;
- m->m_len = sizeof (struct tcpiphdr);
+ m->m_len = sizeof (struct tcpiphdr) + 1;
*mtod(m, struct tcpiphdr *) = *ti;
ti = mtod(m, struct tcpiphdr *);
flags = TH_ACK;
*mtod(m, struct tcpiphdr *) = *ti;
ti = mtod(m, struct tcpiphdr *);
flags = TH_ACK;
} else {
m = dtom(ti);
m_freem(m->m_next);
} else {
m = dtom(ti);
m_freem(m->m_next);
xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
xchg(ti->ti_dport, ti->ti_sport, u_short);
#undef xchg
xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
xchg(ti->ti_dport, ti->ti_sport, u_short);
#undef xchg
}
ti->ti_next = ti->ti_prev = 0;
ti->ti_x1 = 0;
}
ti->ti_next = ti->ti_prev = 0;
ti->ti_x1 = 0;
- ti->ti_len = sizeof (struct tcphdr);
+ ti->ti_len = sizeof (struct tcphdr) + tlen;
ti->ti_seq = seq;
ti->ti_ack = ack;
#if vax
ti->ti_seq = seq;
ti->ti_ack = ack;
#if vax
#endif
ti->ti_urp = 0;
ti->ti_sum = in_cksum(m, sizeof(struct tcpiphdr));
#endif
ti->ti_urp = 0;
ti->ti_sum = in_cksum(m, sizeof(struct tcpiphdr));
- ((struct ip *)ti)->ip_len = sizeof(struct tcpiphdr);
+ ((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + tlen;
((struct ip *)ti)->ip_ttl = TCP_TTL;
((struct ip *)ti)->ip_ttl = TCP_TTL;
- (void) ip_output(m, (struct mbuf *)0);
+ (void) ip_output(m, (struct mbuf *)0, 0);
-/* tcp_timer.c 4.15 82/02/25 */
+/* tcp_timer.c 4.16 82/03/15 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
- register struct inpcb *ip;
+ register struct inpcb *ip, *ipnxt;
register struct tcpcb *tp;
int s = splnet();
register int i;
register struct tcpcb *tp;
int s = splnet();
register int i;
- for (; ip != &tcb; ip = ip->inp_next) {
tp = intotcpcb(ip);
if (tp == 0)
continue;
tp = intotcpcb(ip);
if (tp == 0)
continue;
for (i = 0; i < TCPT_NTIMERS; i++) {
for (i = 0; i < TCPT_NTIMERS; i++) {
- if (tp->t_timer[i] && --tp->t_timer[i] == 0)
+ if (tp->t_timer[i] && --tp->t_timer[i] == 0) {
(void) tcp_usrreq(tp->t_inpcb->inp_socket,
PRU_SLOWTIMO, (struct mbuf *)0,
(caddr_t)i);
(void) tcp_usrreq(tp->t_inpcb->inp_socket,
PRU_SLOWTIMO, (struct mbuf *)0,
(caddr_t)i);
+ if (ipnxt->inp_prev != ip)
+ goto tpgone;
+ }
}
tp->t_idle++;
if (tp->t_rtt)
tp->t_rtt++;
}
tp->t_idle++;
if (tp->t_rtt)
tp->t_rtt++;
}
tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */
splx(s);
}
tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */
splx(s);
tcp_drop(tp, ETIMEDOUT);
return;
}
tcp_drop(tp, ETIMEDOUT);
return;
}
- if (tp->t_inpcb->inp_socket->so_options & SO_NOKEEPALIVE)
- tp->t_idle = 0;
- else
+ if (tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE)
tcp_respond(tp,
tp->t_template, tp->rcv_nxt, tp->snd_una-1, 0);
tcp_respond(tp,
tp->t_template, tp->rcv_nxt, tp->snd_una-1, 0);
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
return;
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
return;
-/* udp_usrreq.c 4.21 82/03/03 */
+/* udp_usrreq.c 4.22 82/03/15 */
#include "../h/param.h"
#include "../h/dir.h"
#include "../h/param.h"
#include "../h/dir.h"
ui->ui_sum = in_cksum(m, sizeof (struct udpiphdr) + len);
((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len;
((struct ip *)ui)->ip_ttl = MAXTTL;
ui->ui_sum = in_cksum(m, sizeof (struct udpiphdr) + len);
((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len;
((struct ip *)ui)->ip_ttl = MAXTTL;
- (void) ip_output(m, (struct mbuf *)0);
+ (void) ip_output(m, (struct mbuf *)0,
+ inp->inp_socket->so_state & SS_PRIV);
-/* if_dmc.c 4.4 82/03/13 */
+/* if_dmc.c 4.5 82/03/15 */
#include "dmc.h"
#if NDMC > 0
#include "dmc.h"
#if NDMC > 0
m = if_rubaget(&sc->sc_ifuba, len, 0);
if (m == 0)
goto setup;
m = if_rubaget(&sc->sc_ifuba, len, 0);
if (m == 0)
goto setup;
+ if (IF_QFULL(inq)) {
+ IF_DROP(inq);
+ (void) m_freem(m);
+ } else
+ IF_ENQUEUE(inq, m);
setup:
arg = sc->sc_ifuba.ifu_r.ifrw_info & 0x3ffff;
setup:
arg = sc->sc_ifuba.ifu_r.ifrw_info & 0x3ffff;
sc->sc_if.if_opackets++;
sc->sc_oactive = 0;
if (sc->sc_ifuba.ifu_xtofree) {
sc->sc_if.if_opackets++;
sc->sc_oactive = 0;
if (sc->sc_ifuba.ifu_xtofree) {
- m_freem(sc->sc_ifuba.ifu_xtofree);
+ (void) m_freem(sc->sc_ifuba.ifu_xtofree);
sc->sc_ifuba.ifu_xtofree = 0;
}
if (sc->sc_if.if_snd.ifq_head == 0)
sc->sc_ifuba.ifu_xtofree = 0;
}
if (sc->sc_if.if_snd.ifq_head == 0)
printd("dmcoutput\n");
if (pf != (ui->ui_flags & DMC_PF)) {
printf("dmc%d: protocol %d not supported\n", ifp->if_unit, pf);
printd("dmcoutput\n");
if (pf != (ui->ui_flags & DMC_PF)) {
printf("dmc%d: protocol %d not supported\n", ifp->if_unit, pf);
return (0);
}
s = splimp();
return (0);
}
s = splimp();
+ if (IF_QFULL(&ifp->if_snd)) {
+ IF_DROP(&ifp->if_snd);
+ (void) m_freem(m);
+ splx(s);
+ return (0);
+ }
IF_ENQUEUE(&ifp->if_snd, m);
if (dmc_softc[ifp->if_unit].sc_oactive == 0)
dmcstart(ifp->if_unit);
IF_ENQUEUE(&ifp->if_snd, m);
if (dmc_softc[ifp->if_unit].sc_oactive == 0)
dmcstart(ifp->if_unit);
-/* if_en.c 4.39 82/03/13 */
+/* if_en.c 4.40 82/03/15 */
+ if (IF_QFULL(inq)) {
+ IF_DROP(inq);
+ (void) m_freem(m);
+ } else
+ IF_ENQUEUE(inq, m);
* not yet active.
*/
s = splimp();
* not yet active.
*/
s = splimp();
+ if (IF_QFULL(&ifp->if_snd)) {
+ IF_DROP(&ifp->if_snd);
+ m_freem(m);
+ splx(s);
+ return (0);
+ }
IF_ENQUEUE(&ifp->if_snd, m);
if (en_softc[ifp->if_unit].es_oactive == 0)
enstart(ifp->if_unit);
IF_ENQUEUE(&ifp->if_snd, m);
if (en_softc[ifp->if_unit].es_oactive == 0)
enstart(ifp->if_unit);