Skip to content

linux: GRE inject dest, collect-md send, and neighbor dump - #54

Merged
bebopagogo merged 6 commits into
USNavalResearchLaboratory:masterfrom
Jafaral:mgre-fixes
Aug 31, 2026
Merged

linux: GRE inject dest, collect-md send, and neighbor dump#54
bebopagogo merged 6 commits into
USNavalResearchLaboratory:masterfrom
Jafaral:mgre-fixes

Conversation

@Jafaral

@Jafaral Jafaral commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Linux ipgre_header() copies sll_addr into the outer IP destination even
when sll_halen is 0. A zeroed sockaddr_ll therefore overwrites a
configured GRE remote (including a multicast one) with 0.0.0.0 and the
kernel drops the packet. Use the IPv4 IFLA_GRE_REMOTE learned at Open()
so inject onto a multicast-remote GRE tunnel encapsulates to that group.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
Add ProtoNet::GetInterfaceNeighbors() and IFACE_NEIGH_NEW/DELETE
monitor events so callers can track overlay dest and GRE lladdr
(underlay).

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
type gre external (IFLA_GRE_COLLECT_METADATA) has no header_ops, so
PF_PACKET SOCK_DGRAM never attaches lwtunnel metadata. The kernel
drops the inject even when sll_addr holds a mapped unicast remote.
Ordinary GRE/mGRE is unchanged: one Send() still means one dest.

Detect collect-md via GetInterfaceType(), open a send-only IPPROTO_GRE
socket, and send a 4-byte GRE header plus the inner IP to
tunnel_remote_addr. Overlay unicast on these devices still uses kernel
lwtunnel routes; this path is for SMF inject after map has set the
remote.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
PF_PACKET cannot emit a multicast sll_addr on remote 0.0.0.0. Use a
raw GRE socket for those dests; multicast-underlay mGRE (kernel remote
already the group) stays on PF_PACKET.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
mGRE wildcard devices report 0.0.0.0 as the configured remote.
Stash the PF_PACKET sll_addr from each Recv() so nrlsmf can tell
which neighbor sent an EM_ACK.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
windows-latest now ships VS 2026, so the hardcoded VS 2022 vcvars64.bat
path is gone. Locate the toolchain with vswhere and invoke it via cmd.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
@bebopagogo
bebopagogo merged commit ecb8e53 into USNavalResearchLaboratory:master Aug 31, 2026
4 checks passed
@Jafaral
Jafaral deleted the mgre-fixes branch September 4, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants