Re: [PATCH net-next 01/10] batman-adv: dat: drop non-4addr backwards compatibility
From: Sven Eckelmann <sven@narfation.org>
Date: 2026-08-06 15:03:50
Also in:
batman
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260805143200.722098-1-sw%40simonwunderlich.de?part=1
quoted hunk ↗ jump to hunk
--- Patch [1]: [PATCH net-next 01/10] batman-adv: dat: drop non-4addr backwards compatibility ---
[...]
Discovered by: opus-5 · Missed by: old-prompts, sashiko-gemini · Confirmed by: old-prompts Was the removed else branch really only reachable when talking to pre-compat-15 nodes?
This is a misrepresentation of the commit. The code was added in batman-adv with compat 14 when not all nodes had support for 4-addr packets. With compat-15, all nodes must have support for 4addr packets and the backwards compatibility hack is no longer needed [...]
After this change those cache replies go out as BATADV_UNICAST_4ADDR, and on the receiver batadv_recv_unicast_packet() now takes the is4addr path: subtype = unicast_4addr_packet->subtype; batadv_dat_inc_counter(bat_priv, subtype); so BATADV_P_DAT_CACHE_REPLY RX accounting is incremented where it previously was not, and the encapsulation of these replies changes in packet captures.
Yes, but what is wrong about the correct packets and correct accounting? [...]
Discovered by: opus-5 · Missed by: old-prompts, sashiko-gemini · Confirmed by: old-prompts
This is a pre-existing issue and not introduced by this patch, but while
looking at the DAT subtype decoding: the default arm of the inner switch in
batadv_dbg_arp() prints the packet type where the message says subtype:
switch (unicast_4addr_packet->subtype) {
...
default:
batadv_dbg(BATADV_DBG_DAT, bat_priv, "* type: Unknown (%u)!\n",
unicast_4addr_packet->u.packet_type);
}
That arm is only reachable from case BATADV_UNICAST_4ADDR: of the outer
switch, so the value printed is always 0x42 rather than the unrecognized
value from enum batadv_subtype in include/uapi/linux/batadv_packet.h.Irrelevant for this patch but I've submitted a mini fix: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20260806-4addr-unknown-subtype-print-v1-1-e906357a5895@narfation.org/ Regards, Sven
Attachments
- signature.asc [application/pgp-signature] 228 bytes