mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Don't forget to set our MAC address into packets we wre sending out via
netgraph. Eventually we may need to have a separate hook for packets that already have a source AMC address but for now just drop it in. Should fix PPPoE.
This commit is contained in:
parent
1d3e7ea3dd
commit
561e4fb9f6
1 changed files with 6 additions and 0 deletions
|
|
@ -64,6 +64,7 @@
|
|||
#include <netgraph/ng_parse.h>
|
||||
#include <netgraph/ng_ether.h>
|
||||
|
||||
#define IFP2AC(IFP) ((struct arpcom *)IFP)
|
||||
#define IFP2NG(ifp) ((struct ng_node *)((struct arpcom *)(ifp))->ac_netgraph)
|
||||
|
||||
/* Per-node private data */
|
||||
|
|
@ -494,6 +495,7 @@ static int
|
|||
ng_ether_rcv_lower(node_p node, struct mbuf *m, meta_p meta)
|
||||
{
|
||||
const priv_p priv = node->private;
|
||||
struct ether_header *eh;
|
||||
|
||||
/* Make sure header is fully pulled up */
|
||||
if (m->m_pkthdr.len < sizeof(struct ether_header)) {
|
||||
|
|
@ -506,6 +508,10 @@ ng_ether_rcv_lower(node_p node, struct mbuf *m, meta_p meta)
|
|||
return (ENOBUFS);
|
||||
}
|
||||
|
||||
/* drop in the MAC address */
|
||||
eh = mtod(m, struct ether_header *);
|
||||
bcopy((IFP2AC(priv->ifp))->ac_enaddr, eh->ether_shost, 6);
|
||||
|
||||
/* Send it on its way */
|
||||
NG_FREE_META(meta);
|
||||
return ether_output_frame(priv->ifp, m);
|
||||
|
|
|
|||
Loading…
Reference in a new issue