teamd: lw: arp_ping: only check arp reply message
diff mbox series

Message ID 20190111015710.16264-1-liuhangbin@gmail.com
State New
Headers show
Series
  • teamd: lw: arp_ping: only check arp reply message
Related show

Commit Message

Hangbin Liu Jan. 11, 2019, 1:57 a.m. UTC
Currently we check both arp request and reply message for arp_ping link
watch. But if we enabled validate_active and validate_inactive at the
same time, we will receive the other slave's arp request as the switch
broadcasts arp request message. i.e. slave1 receives arp request from
slave2 and vice versa.

Then the arp check will pass even the target is unreachable. Fix it by
only check arp reply message.

Reported-by: LiLiang <liali@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 teamd/teamd_lw_arp_ping.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jiri Pirko Jan. 14, 2019, 6:08 p.m. UTC | #1
Fri, Jan 11, 2019 at 02:57:10AM CET, liuhangbin@gmail.com wrote:
>Currently we check both arp request and reply message for arp_ping link
>watch. But if we enabled validate_active and validate_inactive at the
>same time, we will receive the other slave's arp request as the switch
>broadcasts arp request message. i.e. slave1 receives arp request from
>slave2 and vice versa.
>
>Then the arp check will pass even the target is unreachable. Fix it by
>only check arp reply message.
>
>Reported-by: LiLiang <liali@redhat.com>
>Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

applied, thanks.

Patch
diff mbox series

diff --git a/teamd/teamd_lw_arp_ping.c b/teamd/teamd_lw_arp_ping.c
index 01cd6e1..81806f0 100644
--- a/teamd/teamd_lw_arp_ping.c
+++ b/teamd/teamd_lw_arp_ping.c
@@ -336,7 +336,8 @@  static int lw_ap_receive(struct lw_psr_port_priv *psr_ppriv)
 		if (ap.ah.ar_hrd != htons(ll_my.sll_hatype) ||
 		    ap.ah.ar_pro != htons(ETH_P_IP) ||
 		    ap.ah.ar_hln != ll_my.sll_halen ||
-		    ap.ah.ar_pln != 4) {
+		    ap.ah.ar_pln != 4 ||
+		    ap.ah.ar_op != htons(ARPOP_REPLY)) {
 			return 0;
 		}