summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2016-05-30 23:30:12 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2016-05-30 23:30:12 +0000
commita76214f441401dc88bb5bf703141a83747c23b09 (patch)
tree7f2ab556bc1e176a4e13efc3efb79e387ad33f68 /sys/net
parent9551774c5914a67b6673a69282d874ff88ca99b3 (diff)
Set pppoe(4) control frames to high (NC, "network control")
priority. This is translated into an 802.1p priority tag when sent over a vlan interface, reducing the risk of them being crowded out by data packets on a busy link. Some users have problems with ISPs that place specific requirements on vlan priority (typically the packet header value must be '0', relating to priority 1). This diff doesn't fix that yet, but gives a single place to patch to change tags on control packets without affecting normal vlan priority operation on other interfaces. ok mikeb.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_pppoe.c5
-rw-r--r--sys/net/if_sppp.h3
-rw-r--r--sys/net/if_spppsubr.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c
index 74a89bc7fff..fd912acd704 100644
--- a/sys/net/if_pppoe.c
+++ b/sys/net/if_pppoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppoe.c,v 1.55 2016/04/18 14:38:08 mikeb Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.56 2016/05/30 23:30:11 sthen Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
@@ -1011,6 +1011,7 @@ pppoe_send_padi(struct pppoe_softc *sc)
m0 = pppoe_get_mbuf(len + PPPOE_HEADERLEN); /* header len + payload len */
if (m0 == NULL)
return (ENOBUFS);
+ m0->m_pkthdr.pf.prio = SPPP_CTL_PRIO;
/* fill in pkt */
p = mtod(m0, u_int8_t *);
@@ -1237,6 +1238,7 @@ pppoe_send_padr(struct pppoe_softc *sc)
m0 = pppoe_get_mbuf(len + PPPOE_HEADERLEN);
if (m0 == NULL)
return (ENOBUFS);
+ m0->m_pkthdr.pf.prio = SPPP_CTL_PRIO;
p = mtod(m0, u_int8_t *);
PPPOE_ADD_HEADER(p, PPPOE_CODE_PADR, 0, len);
@@ -1300,6 +1302,7 @@ pppoe_send_padt(unsigned int ifidx, u_int session, const u_int8_t *dest)
if_put(eth_if);
return (ENOBUFS);
}
+ m0->m_pkthdr.pf.prio = SPPP_CTL_PRIO;
p = mtod(m0, u_int8_t *);
PPPOE_ADD_HEADER(p, PPPOE_CODE_PADT, session, 0);
diff --git a/sys/net/if_sppp.h b/sys/net/if_sppp.h
index 04b24e280aa..ea8bfcb9516 100644
--- a/sys/net/if_sppp.h
+++ b/sys/net/if_sppp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sppp.h,v 1.23 2015/11/11 01:49:17 dlg Exp $ */
+/* $OpenBSD: if_sppp.h,v 1.24 2016/05/30 23:30:11 sthen Exp $ */
/* $NetBSD: if_sppp.h,v 1.2.2.1 1999/04/04 06:57:39 explorer Exp $ */
/*
@@ -56,6 +56,7 @@ enum ppp_phase {
#define AUTHMAXLEN 256 /* including terminating '\0' */
#define AUTHCHALEN 16 /* length of the challenge we send */
+#define SPPP_CTL_PRIO 7 /* priority to use for control packets */
/*
* Definitions to pass struct sppp data down into the kernel using the
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index d2ad8c5d80d..181739b9940 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.152 2016/05/02 22:15:49 jmatthew Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.153 2016/05/30 23:30:10 sthen Exp $ */
/*
* Synchronous PPP link level subroutines.
*
@@ -914,6 +914,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
return;
m->m_pkthdr.len = m->m_len = PKTHDRLEN + LCP_HEADER_LEN + len;
m->m_pkthdr.ph_ifidx = 0;
+ m->m_pkthdr.pf.prio = SPPP_CTL_PRIO;
*mtod(m, u_int16_t *) = htons(proto);
lh = (struct lcp_header *)(mtod(m, u_int8_t *) + 2);
@@ -3991,6 +3992,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
if (! m)
return;
m->m_pkthdr.ph_ifidx = 0;
+ m->m_pkthdr.pf.prio = SPPP_CTL_PRIO;
*mtod(m, u_int16_t *) = htons(cp->proto);
lh = (struct lcp_header *)(mtod(m, u_int8_t *) + 2);