From afcdcf6ae6d95eb828733994c7de30f8ab095dcc Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 25 Sep 2025 14:23:36 -0400 Subject: dgram: Add support for data reception Signed-off-by: Ian Moffett --- src/link/if_ether.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/link/if_ether.c') diff --git a/src/link/if_ether.c b/src/link/if_ether.c index 48b4f19..6043810 100644 --- a/src/link/if_ether.c +++ b/src/link/if_ether.c @@ -32,15 +32,6 @@ #include #include "if_ether.h" -/* - * Using the protocol ID 0xFD for testing, - * see RFC 3692 - */ -#define PROTO_ID 0xFD - -/* 48-bit mask for MAC addresses */ -#define MAC_MASK 0xFFFFFFFFFFFF - int ether_load_route(mac_addr_t src, mac_addr_t dest, struct ether_hdr *res) { @@ -65,6 +56,10 @@ ether_load_route(mac_addr_t src, mac_addr_t dest, struct ether_hdr *res) res->dest[3] = (dest >> 16) & 0xFF; res->dest[4] = (dest >> 8) & 0xFF; res->dest[5] = dest & 0xFF; - res->proto = PROTO_ID; + + /* Setup the protocl ID */ + res->proto = 0; + res->proto |= (PROTO_ID & 0xFF) << 8; + res->proto |= (PROTO_ID >> 8) & 0xFF; return 0; } -- cgit v1.2.3