Bug 217667 - arp "moved" log message gives incorrect "from" MAC
Summary: arp "moved" log message gives incorrect "from" MAC
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-09 17:11 UTC by Andrew "RhodiumToad" Gierth
Modified: 2017-03-18 21:12 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew "RhodiumToad" Gierth 2017-03-09 17:11:40 UTC
The ARP "x moved from y to z" log message in if_ether.c is mistakenly taking the address of the char* which points to the previous MAC address, rather than taking the pointer value; thus the reported former MAC address is garbage.

For example these two messages were the result of swapping a device out and then back (actual IP redacted):

kernel: arp: x.x.x.x moved from 18:8d:69:c6:00:00 to 14:cc:20:09:a6:50 on ue0.10
kernel: arp: x.x.x.x moved from 18:8d:69:c6:00:00 to 00:26:44:17:90:e1 on ue0.10

ll_addr is a char*, not a char[], so:

  (u_char *)&la->ll_addr

should be

  (u_char *)la->ll_addr
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-03-11 04:58:44 UTC
A commit references this bug:

Author: ae
Date: Sat Mar 11 04:57:52 UTC 2017
New revision: 315050
URL: https://svnweb.freebsd.org/changeset/base/315050

Log:
  Fix the L2 address printed in the "arp: %s moved from %*D" message.

  In the r292978 struct llentry was changed and the ll_addr field become
  the pointer.

  PR:		217667
  MFC after:	1 week

Changes:
  head/sys/netinet/if_ether.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-03-18 10:49:38 UTC
A commit references this bug:

Author: ae
Date: Sat Mar 18 10:48:37 UTC 2017
New revision: 315479
URL: https://svnweb.freebsd.org/changeset/base/315479

Log:
  MFC r315050:
    Fix the L2 address printed in the "arp: %s moved from %*D" message.

    In the r292978 struct llentry was changed and the ll_addr field become
    the pointer.

    PR:		217667

Changes:
_U  stable/11/
  stable/11/sys/netinet/if_ether.c