On Friday 26 February 2016 14:18:17 Andreas Pape wrote:
Speeding up dat address lookup is achieved by snooping all incoming ip traffic. This especially increases the propability in bla setups that a gateway into a common backbone network already has a fitting dat entry to answer incoming ARP requests directly coming from the backbone network thus further reducing ARP traffic in the mesh.
Signed-off-by: Andreas Pape apape@phoenixcontact.com
[...]
switch (ntohs(ethhdr->h_proto)) {
- case ETH_P_IP:
iphdr = (struct iphdr *)(skb->data + ETH_HLEN);
/* snoop incoming traffic for dat update using the source mac
* and source ip to speed up dat.
*/
batadv_dat_entry_check(bat_priv, iphdr->saddr,
ethhdr->h_source, vid);
case ETH_P_8021Q: vhdr = (struct vlan_ethhdr *)skb->data;break;
if (vhdr->h_vlan_encapsulated_proto != ethertype)
if (vhdr->h_vlan_encapsulated_proto != ethertype) {
/* snoop incoming traffic for dat update also for vlan
* tagged frames.
*/
if (vhdr->h_vlan_encapsulated_proto == ETH_P_IP) {
iphdr = (struct iphdr *)(vhdr +
sizeof(struct vlan_ethhdr));
batadv_dat_entry_check(bat_priv, iphdr->saddr,
vhdr->h_source, vid);
}
Where is the code to check that there is enough data for the iphdr (pskb_may_pull)? Same question goes to Marek for his initial change in 48628bb9419f ("batman-adv: softif bridge loop avoidance") that introduced the vhdr->vlan_ethhdr check
Kind regards, Sven