summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netgraph/ng_ppp.c3
-rw-r--r--sys/netgraph/ng_pppoe.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c
index 5abd492..b83b78f 100644
--- a/sys/netgraph/ng_ppp.c
+++ b/sys/netgraph/ng_ppp.c
@@ -1399,7 +1399,8 @@ ng_ppp_rcvdata(hook_p hook, item_p item)
/* Strip address and control fields, if present. */
if (m->m_len < 2 && (m = m_pullup(m, 2)) == NULL)
ERROUT(ENOBUFS);
- if (bcmp(mtod(m, uint8_t *), &ng_ppp_acf, 2) == 0)
+ if (mtod(m, uint8_t *)[0] == 0xff &&
+ mtod(m, uint8_t *)[1] == 0x03)
m_adj(m, 2);
/* Get protocol number */
diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c
index 314e0a4..5d23cfb 100644
--- a/sys/netgraph/ng_pppoe.c
+++ b/sys/netgraph/ng_pppoe.c
@@ -1179,8 +1179,6 @@ ng_pppoe_rcvdata(hook_p hook, item_p item)
switch (sp->state) {
case PPPOE_NEWCONNECTED:
case PPPOE_CONNECTED: {
- static const u_char addrctrl[] = { 0xff, 0x03 };
-
/*
* Remove PPP address and control fields, if any.
* For example, ng_ppp(4) always sends LCP packets
@@ -1190,7 +1188,8 @@ ng_pppoe_rcvdata(hook_p hook, item_p item)
if (m->m_pkthdr.len >= 2) {
if (m->m_len < 2 && !(m = m_pullup(m, 2)))
LEAVE(ENOBUFS);
- if (bcmp(mtod(m, u_char *), addrctrl, 2) == 0)
+ if (mtod(m, u_char *)[0] == 0xff &&
+ mtod(m, u_char *)[1] == 0x03)
m_adj(m, 2);
}
/*
OpenPOWER on IntegriCloud