Deleted Added
full compact
arp.c (162795) arp.c (163305)
1/*
2 * Copyright (c) 1984, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Sun Microsystems, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41static char const sccsid[] = "@(#)from: arp.c 8.2 (Berkeley) 1/2/94";
42#endif /* not lint */
43#endif
44#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1984, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Sun Microsystems, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41static char const sccsid[] = "@(#)from: arp.c 8.2 (Berkeley) 1/2/94";
42#endif /* not lint */
43#endif
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/usr.sbin/arp/arp.c 162795 2006-09-29 16:07:44Z ru $");
45__FBSDID("$FreeBSD: head/usr.sbin/arp/arp.c 163305 2006-10-13 12:38:43Z glebius $");
46
47/*
48 * arp - display, set, and delete arp table entries
49 */
50
51
52#include <sys/param.h>
53#include <sys/file.h>

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

756 /*
757 * Scan through looking for an interface with an Internet
758 * address on the same subnet as `ipaddr'.
759 */
760 ifend = (struct ifreq *)(ifc.ifc_buf + ifc.ifc_len);
761 for (ifr = ifc.ifc_req; ifr < ifend; ifr = NEXTIFR(ifr) ) {
762 if (ifr->ifr_addr.sa_family != AF_INET)
763 continue;
46
47/*
48 * arp - display, set, and delete arp table entries
49 */
50
51
52#include <sys/param.h>
53#include <sys/file.h>

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

756 /*
757 * Scan through looking for an interface with an Internet
758 * address on the same subnet as `ipaddr'.
759 */
760 ifend = (struct ifreq *)(ifc.ifc_buf + ifc.ifc_len);
761 for (ifr = ifc.ifc_req; ifr < ifend; ifr = NEXTIFR(ifr) ) {
762 if (ifr->ifr_addr.sa_family != AF_INET)
763 continue;
764 /* XXX can't we use *ifr instead of ifreq ? */
765 strncpy(ifreq.ifr_name, ifr->ifr_name,
766 sizeof(ifreq.ifr_name));
764 strncpy(ifreq.ifr_name, ifr->ifr_name,
765 sizeof(ifreq.ifr_name));
766 ifreq.ifr_addr = ifr->ifr_addr;
767 /*
768 * Check that the interface is up,
769 * and not point-to-point or loopback.
770 */
771 if (ioctl(sock, SIOCGIFFLAGS, &ifreq) < 0)
772 continue;
773 if ((ifreq.ifr_flags &
774 (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|

--- 44 unchanged lines hidden ---
767 /*
768 * Check that the interface is up,
769 * and not point-to-point or loopback.
770 */
771 if (ioctl(sock, SIOCGIFFLAGS, &ifreq) < 0)
772 continue;
773 if ((ifreq.ifr_flags &
774 (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|

--- 44 unchanged lines hidden ---