Project

General

Profile

Actions

Bug #449

open

dat: unable to detect DHCP on VLANs

Added by Sven Eckelmann 9 days ago.

Status:
New
Priority:
Normal
Target version:
-
Start date:
07/01/2026
Due date:
% Done:

0%

Estimated time:

Description

This is a report by Sashiko which needs to be checked (@Linus Lüssing ?):

while looking at the DAT snoopers, I noticed a potential issue in batadv_dat_snoop_incoming_dhcp_ack().

Does this function fail to learn DHCP information for clients on VLANs?

It looks like it reads h_proto from the outer ethernet header without stripping the VLAN tag, and incorrectly sets the network header:

net/batman-adv/distributed-arp-table.c:batadv_dat_snoop_incoming_dhcp_ack() {
    ...
        ethhdr = (struct ethhdr *)(skb->data + hdr_size);
        skb_set_network_header(skb, hdr_size + ETH_HLEN);
        proto = ethhdr->h_proto;

        if (!batadv_dat_check_dhcp_ack(skb, proto, &ip_src, chaddr, &yiaddr))
                return;
    ...
}

Because the outer h_proto is ETH_P_8021Q instead of ETH_P_IP, will the DHCP check fail and return immediately, leading to unnecessary broadcast ARP requests?

See https://sashiko.dev/#/patchset/20260630134430.85786-1-sw@simonwunderlich.de?part=6

No data to display

Actions

Also available in: Atom PDF