Deleted Added
full compact
af_link.c (138593) af_link.c (139494)
1/*
2 * Copyright (c) 1983, 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

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

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31static const char rcsid[] =
1/*
2 * Copyright (c) 1983, 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

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

24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#ifndef lint
31static const char rcsid[] =
32 "$FreeBSD: head/sbin/ifconfig/af_link.c 138593 2004-12-08 19:18:07Z sam $";
32 "$FreeBSD: head/sbin/ifconfig/af_link.c 139494 2004-12-31 19:46:27Z sam $";
33#endif /* not lint */
34
35#include <sys/types.h>
36#include <sys/ioctl.h>
37#include <sys/socket.h>
38#include <net/if.h>
33#endif /* not lint */
34
35#include <sys/types.h>
36#include <sys/ioctl.h>
37#include <sys/socket.h>
38#include <net/if.h>
39#include <net/route.h> /* for RTX_IFA */
39
40#include <err.h>
41#include <stdio.h>
42#include <stdlib.h>
43#include <string.h>
44
45#include <net/if_dl.h>
46#include <net/if_types.h>
47#include <net/ethernet.h>
48
49#include "ifconfig.h"
50
51static struct ifreq link_ridreq;
52
53static void
54link_status(int s __unused, const struct rt_addrinfo *info)
55{
40
41#include <err.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>
45
46#include <net/if_dl.h>
47#include <net/if_types.h>
48#include <net/ethernet.h>
49
50#include "ifconfig.h"
51
52static struct ifreq link_ridreq;
53
54static void
55link_status(int s __unused, const struct rt_addrinfo *info)
56{
56 const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)info;
57 const struct sockaddr_dl *sdl =
58 (const struct sockaddr_dl *) info->rti_info[RTAX_IFA];
57
59
58 if (sdl->sdl_alen > 0) {
60 if (sdl != NULL && sdl->sdl_alen > 0) {
59 if (sdl->sdl_type == IFT_ETHER &&
60 sdl->sdl_alen == ETHER_ADDR_LEN)
61 printf("\tether %s\n",
62 ether_ntoa((const struct ether_addr *)LLADDR(sdl)));
63 else {
64 int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
65
66 printf("\tlladdr %s\n", link_ntoa(sdl) + n);

--- 59 unchanged lines hidden ---
61 if (sdl->sdl_type == IFT_ETHER &&
62 sdl->sdl_alen == ETHER_ADDR_LEN)
63 printf("\tether %s\n",
64 ether_ntoa((const struct ether_addr *)LLADDR(sdl)));
65 else {
66 int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
67
68 printf("\tlladdr %s\n", link_ntoa(sdl) + n);

--- 59 unchanged lines hidden ---