Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449339

Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in neigh_update()

From Chunhui He <hchunhui@mail.ustc.edu.cn>
Newsgroups linux.kernel
Subject Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in neigh_update()
Date 2016-07-25 10:00 +0200
Message-ID <rYIXU-1RO-17@gated-at.bofh.it> (permalink)
References <rY5Wy-3Nk-9@gated-at.bofh.it> <rY8ro-572-27@gated-at.bofh.it> <rYaCR-6AX-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

On Sat, 23 Jul 2016 22:09:43 +0300 (EEST), Julian Anastasov <ja@ssi.bg> wrote:
> 
> 	May be that is the problem: we receive such packet,
> ip_route_input_noref detects that we allow such packet
> from NEIGH_IP on this interface, tip is not RTN_LOCAL (no
> ARP reply from us), tip is RTN_UNICAST but proxy_arp is not
> allowed, so we continue and reach __neigh_lookup which finds
> the existing cache entry because we talked to GW before that.
> As this is an ARP request, neigh_update is called with NUD_STALE.
> No reply is sent because request was not for us but we
> just learned that NEIGH_IP is alive because it lookups
> for someone else. This is common to observe with broadcasts,
> GW lookups for other hosts and has to expose its IP+hwaddr.
> More difficult to happen with unicast packets, you need hub,
> not switch, to detect such packets.
> 
> 	It is possible that you miss the packet that tries
> to set NUD_STALE. May be you can add some printk's to catch
> what kind of packet causes this. This can help too:
> 
> tcpdump -lnnn -s0 arp and host GW_IP
> 
> 	If you see such packet, that is it. Our cache is
> updated with NUD_STALE.
> 
>> So I'm not sure if it can learn from ARP reply.
> 
> 	See above, received broadcast GARP reply can set
> NUD_STALE. But the most trivial case of GW exposing its
> IP while looking for other hosts should be the culprit.
> It probably happens often, that is why we have no chance
> to send ARP requests, GW is more ARP-active than us and
> updates our cache and we are happy.
>

Thank you for your analysis.
I think the same, except that I don't think GW can update
our cache via broadcast ARP.

Please the comment in arp_process():
>                int state = NUD_REACHABLE;
...
>                /* Broadcast replies and request packets
>                   do not assert neighbour reachability.
>                 */
>                if (arp->ar_op != htons(ARPOP_REPLY) ||
>                    skb->pkt_type != PACKET_HOST)
>                        state = NUD_STALE;
>                neigh_update(n, sha, state,
...

Broadcast packets do not assert reachability, so they
should not interference our state machine. They are
just a hint.

Regards,
Chunhui

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] net: neigh: disallow state transition DELAY->STALE in neigh_update() Chunhui He <hchunhui@mail.ustc.edu.cn> - 2016-07-21 20:10 +0200
  Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Julian Anastasov <ja@ssi.bg> - 2016-07-22 09:40 +0200
    Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-07-22 11:50 +0200
    Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Chunhui He <hchunhui@mail.ustc.edu.cn> - 2016-07-22 14:50 +0200
      Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Julian Anastasov <ja@ssi.bg> - 2016-07-23 08:20 +0200
        Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Chunhui He <hchunhui@mail.ustc.edu.cn> - 2016-07-23 13:30 +0200
          Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Julian Anastasov <ja@ssi.bg> - 2016-07-23 16:20 +0200
            Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Chunhui He <hchunhui@mail.ustc.edu.cn> - 2016-07-23 19:00 +0200
              Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Julian Anastasov <ja@ssi.bg> - 2016-07-23 21:20 +0200
                Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Chunhui He <hchunhui@mail.ustc.edu.cn> - 2016-07-25 10:00 +0200
      Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() YOSHIFUJI Hideaki/吉藤英明   <hideaki.yoshifuji@miraclelinux.com> - 2016-07-25 07:30 +0200
        Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Chunhui He <hchunhui@mail.ustc.edu.cn> - 2016-07-25 10:20 +0200
          Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in neigh_update() 吉藤英明 <hideaki.yoshifuji@miraclelinux.com> - 2016-07-25 14:50 +0200
            Re: [PATCH] net: neigh: disallow state transition DELAY->STALE in  neigh_update() Julian Anastasov <ja@ssi.bg> - 2016-07-25 21:00 +0200

csiph-web