On Fri, May 20, 2016 at 01:32:35PM +0200, Andreas Pape wrote:
"B.A.T.M.A.N" b.a.t.m.a.n-bounces@lists.open-mesh.org schrieb am 19.05.2016 21:45:53:
Von: Linus Lüssing linus.luessing@c0d3.blue An: The list for a Better Approach To Mobile Ad-hoc Networking b.a.t.m.a.n@lists.open-mesh.org Datum: 19.05.2016 21:47 Betreff: Re: [B.A.T.M.A.N.] [PATCHv3 2/6] batman-adv: speed up dat by snooping received ip traffic Gesendet von: "B.A.T.M.A.N" b.a.t.m.a.n-bounces@lists.open-mesh.org
On Fri, May 06, 2016 at 10:58:23AM +0200, Andreas Pape wrote:
+void batadv_dat_entry_check(struct batadv_priv *bat_priv, struct
sk_buff *skb,
unsigned short vid)
+{
[...]
- if (iphdr) {
batadv_dbg(BATADV_DBG_DAT, bat_priv,
"Snooped IP address: %pI4 %pM (vid: %d)\n",
&iphdr->saddr, ethhdr->h_source,
BATADV_PRINT_VID(vid));
batadv_dat_entry_add(bat_priv, iphdr->saddr,
ethhdr->h_source, vid);
- }
Not sure whether it is necessary, or whether there is a check somewhere later within DAT. But should we exclude some iphdr->saddr or ethhdr->h_source addresses? For instance a DHCPDISCOVER usually has a zero-ip address.
I think you have a good point here. Excluding especially ip addresses like zero-ip address seems reasonable. Although I think that this isn't a problem as long as no one is sending arp requests for such ip addresses, filling the dat table with unreasonable entries isn't a smart idea either. I will add some additional tests here for reasonable ip addresses for the next version of the patchset.
We already have some checks in the snooping functions that are performed when calling batadv_arp_get_type(). Aren't those enough ?
Cheers,