Deleted Added
full compact
route.c (132803) route.c (146187)
1/*
2 * Copyright (c) 1983, 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

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

33
34#if 0
35#ifndef lint
36static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
37#endif /* not lint */
38#endif
39
40#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1983, 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

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

33
34#if 0
35#ifndef lint
36static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
37#endif /* not lint */
38#endif
39
40#include <sys/cdefs.h>
41__FBSDID("$FreeBSD: head/usr.bin/netstat/route.c 132803 2004-07-28 18:18:47Z glebius $");
41__FBSDID("$FreeBSD: head/usr.bin/netstat/route.c 146187 2005-05-13 16:31:11Z ume $");
42
43#include <sys/param.h>
44#include <sys/protosw.h>
45#include <sys/socket.h>
46#include <sys/time.h>
47
48#include <net/ethernet.h>
49#include <net/if.h>

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

898
899#ifdef INET6
900const char *
901netname6(struct sockaddr_in6 *sa6, struct in6_addr *mask)
902{
903 static char line[MAXHOSTNAMELEN];
904 u_char *p = (u_char *)mask;
905 u_char *lim;
42
43#include <sys/param.h>
44#include <sys/protosw.h>
45#include <sys/socket.h>
46#include <sys/time.h>
47
48#include <net/ethernet.h>
49#include <net/if.h>

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

898
899#ifdef INET6
900const char *
901netname6(struct sockaddr_in6 *sa6, struct in6_addr *mask)
902{
903 static char line[MAXHOSTNAMELEN];
904 u_char *p = (u_char *)mask;
905 u_char *lim;
906 int masklen, illegal = 0, flag = NI_WITHSCOPEID;
906 int masklen, illegal = 0, flag = 0;
907
908 if (mask) {
909 for (masklen = 0, lim = p + 16; p < lim; p++) {
910 switch (*p) {
911 case 0xff:
912 masklen += 8;
913 break;
914 case 0xfe:

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

958
959 return line;
960}
961
962char *
963routename6(struct sockaddr_in6 *sa6)
964{
965 static char line[MAXHOSTNAMELEN];
907
908 if (mask) {
909 for (masklen = 0, lim = p + 16; p < lim; p++) {
910 switch (*p) {
911 case 0xff:
912 masklen += 8;
913 break;
914 case 0xfe:

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

958
959 return line;
960}
961
962char *
963routename6(struct sockaddr_in6 *sa6)
964{
965 static char line[MAXHOSTNAMELEN];
966 int flag = NI_WITHSCOPEID;
966 int flag = 0;
967 /* use local variable for safety */
968 struct sockaddr_in6 sa6_local = {AF_INET6, sizeof(sa6_local),};
969
970 sa6_local.sin6_addr = sa6->sin6_addr;
971 sa6_local.sin6_scope_id = sa6->sin6_scope_id;
972
973 if (numeric_addr)
974 flag |= NI_NUMERICHOST;

--- 151 unchanged lines hidden ---
967 /* use local variable for safety */
968 struct sockaddr_in6 sa6_local = {AF_INET6, sizeof(sa6_local),};
969
970 sa6_local.sin6_addr = sa6->sin6_addr;
971 sa6_local.sin6_scope_id = sa6->sin6_scope_id;
972
973 if (numeric_addr)
974 flag |= NI_NUMERICHOST;

--- 151 unchanged lines hidden ---