if_ether.c (bd2b686fe8633ca28fe14e1135551e2f0d4144f1) if_ether.c (39393906794c41128ae83e00fd1dd0242f23311d)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 556 unchanged lines hidden (view full) ---

565 * and also sent them in response to IP replies.
566 * This allowed either end to announce the desire to receive
567 * trailer packets.
568 * We no longer reply to requests for ETHERTYPE_TRAIL protocol either,
569 * but formerly didn't normally send requests.
570 */
571static int log_arp_wrong_iface = 1;
572static int log_arp_movements = 1;
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 556 unchanged lines hidden (view full) ---

565 * and also sent them in response to IP replies.
566 * This allowed either end to announce the desire to receive
567 * trailer packets.
568 * We no longer reply to requests for ETHERTYPE_TRAIL protocol either,
569 * but formerly didn't normally send requests.
570 */
571static int log_arp_wrong_iface = 1;
572static int log_arp_movements = 1;
573static int log_arp_permanent_modify = 1;
573
574SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW,
575 &log_arp_wrong_iface, 0,
576 "log arp packets arriving on the wrong interface");
577SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_movements, CTLFLAG_RW,
578 &log_arp_movements, 0,
579 "log arp replies from MACs different than the one in the cache");
574
575SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW,
576 &log_arp_wrong_iface, 0,
577 "log arp packets arriving on the wrong interface");
578SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_movements, CTLFLAG_RW,
579 &log_arp_movements, 0,
580 "log arp replies from MACs different than the one in the cache");
581SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_permanent_modify, CTLFLAG_RW,
582 &log_arp_permanent_modify, 0,
583 "log arp replies from MACs different than the one in the permanent arp entry");
580
581
582static void
583in_arpinput(m)
584 struct mbuf *m;
585{
586 struct arphdr *ah;
587 struct ifnet *ifp = m->m_pkthdr.rcvif;

--- 128 unchanged lines hidden (view full) ---

716 if (rt->rt_expire) {
717 if (log_arp_movements)
718 log(LOG_INFO, "arp: %s moved from %*D to %*D on %s\n",
719 inet_ntoa(isaddr),
720 ifp->if_addrlen, (u_char *)LLADDR(sdl), ":",
721 ifp->if_addrlen, (u_char *)ar_sha(ah), ":",
722 ifp->if_xname);
723 } else {
584
585
586static void
587in_arpinput(m)
588 struct mbuf *m;
589{
590 struct arphdr *ah;
591 struct ifnet *ifp = m->m_pkthdr.rcvif;

--- 128 unchanged lines hidden (view full) ---

720 if (rt->rt_expire) {
721 if (log_arp_movements)
722 log(LOG_INFO, "arp: %s moved from %*D to %*D on %s\n",
723 inet_ntoa(isaddr),
724 ifp->if_addrlen, (u_char *)LLADDR(sdl), ":",
725 ifp->if_addrlen, (u_char *)ar_sha(ah), ":",
726 ifp->if_xname);
727 } else {
724 log(LOG_ERR,
725 "arp: %*D attempts to modify permanent entry for %s on %s\n",
726 ifp->if_addrlen, (u_char *)ar_sha(ah), ":",
727 inet_ntoa(isaddr), ifp->if_xname);
728 RT_UNLOCK(rt);
729 goto reply;
728 RT_UNLOCK(rt);
729 if (log_arp_permanent_modify)
730 log(LOG_ERR, "arp: %*D attempts to modify "
731 "permanent entry for %s on %s\n",
732 ifp->if_addrlen, (u_char *)ar_sha(ah), ":",
733 inet_ntoa(isaddr), ifp->if_xname);
734 goto reply;
730 }
731 }
732 /*
733 * sanity check for the address length.
734 * XXX this does not work for protocols with variable address
735 * length. -is
736 */
737 if (sdl->sdl_alen &&

--- 241 unchanged lines hidden ---
735 }
736 }
737 /*
738 * sanity check for the address length.
739 * XXX this does not work for protocols with variable address
740 * length. -is
741 */
742 if (sdl->sdl_alen &&

--- 241 unchanged lines hidden ---