Deleted Added
full compact
arp.c (216078) arp.c (233773)
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 216078 2010-11-30 16:14:19Z glebius $");
45__FBSDID("$FreeBSD: head/usr.sbin/arp/arp.c 233773 2012-04-02 10:44:25Z 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>

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

382 */
383 rtm = rtmsg(RTM_GET, dst, &sdl_m);
384 if (rtm == NULL) {
385 warn("%s", host);
386 return (1);
387 }
388 addr = (struct sockaddr_inarp *)(rtm + 1);
389 sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr);
46
47/*
48 * arp - display, set, and delete arp table entries
49 */
50
51
52#include <sys/param.h>
53#include <sys/file.h>

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

382 */
383 rtm = rtmsg(RTM_GET, dst, &sdl_m);
384 if (rtm == NULL) {
385 warn("%s", host);
386 return (1);
387 }
388 addr = (struct sockaddr_inarp *)(rtm + 1);
389 sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr);
390 if (addr->sin_addr.s_addr == dst->sin_addr.s_addr) {
391 printf("set: proxy entry exists for non 802 device\n");
392 return (1);
393 }
394
395 if ((sdl->sdl_family != AF_LINK) ||
396 (rtm->rtm_flags & RTF_GATEWAY) ||
397 !valid_type(sdl->sdl_type)) {
398 printf("cannot intuit interface index and type for %s\n", host);
399 return (1);
400 }
401 sdl_m.sdl_type = sdl->sdl_type;

--- 473 unchanged lines hidden ---
390
391 if ((sdl->sdl_family != AF_LINK) ||
392 (rtm->rtm_flags & RTF_GATEWAY) ||
393 !valid_type(sdl->sdl_type)) {
394 printf("cannot intuit interface index and type for %s\n", host);
395 return (1);
396 }
397 sdl_m.sdl_type = sdl->sdl_type;

--- 473 unchanged lines hidden ---