summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/arp/arp.c114
-rw-r--r--usr.sbin/bhyve/virtio.h2
-rwxr-xr-xusr.sbin/bsdinstall/scripts/auto6
-rw-r--r--usr.sbin/ctladm/ctladm.84
-rw-r--r--usr.sbin/kldxref/ef.c4
-rw-r--r--usr.sbin/ndp/ndp.c80
-rw-r--r--usr.sbin/syslogd/syslogd.c14
-rw-r--r--usr.sbin/tcpdump/tcpdump/Makefile35
-rw-r--r--usr.sbin/tcpdump/tcpdump/config.h43
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c44
10 files changed, 182 insertions, 164 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index eefde75..60079d4 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
* arp - display, set, and delete arp table entries
*/
-
#include <sys/param.h>
#include <sys/file.h>
#include <sys/socket.h>
@@ -80,8 +79,8 @@ __FBSDID("$FreeBSD$");
#include <strings.h>
#include <unistd.h>
-typedef void (action_fn)(struct sockaddr_dl *sdl,
- struct sockaddr_in *s_in, struct rt_msghdr *rtm);
+typedef void (action_fn)(struct sockaddr_dl *sdl, struct sockaddr_in *s_in,
+ struct rt_msghdr *rtm);
static int search(u_long addr, action_fn *action);
static action_fn print_entry;
@@ -320,7 +319,7 @@ set(int argc, char **argv)
return (1);
doing_proxy = flags = expire_time = 0;
while (argc-- > 0) {
- if (strncmp(argv[0], "temp", 4) == 0) {
+ if (strcmp(argv[0], "temp") == 0) {
struct timespec tp;
int max_age;
size_t len = sizeof(max_age);
@@ -330,10 +329,10 @@ set(int argc, char **argv)
&max_age, &len, NULL, 0) != 0)
err(1, "sysctlbyname");
expire_time = tp.tv_sec + max_age;
- } else if (strncmp(argv[0], "pub", 3) == 0) {
+ } else if (strcmp(argv[0], "pub") == 0) {
flags |= RTF_ANNOUNCE;
doing_proxy = 1;
- if (argc && strncmp(argv[1], "only", 3) == 0) {
+ if (argc && strcmp(argv[1], "only") == 0) {
/*
* Compatibility: in pre FreeBSD 8 times
* the "only" keyword used to mean that
@@ -342,27 +341,28 @@ set(int argc, char **argv)
*/
argc--; argv++;
}
- } else if (strncmp(argv[0], "blackhole", 9) == 0) {
+ } else if (strcmp(argv[0], "blackhole") == 0) {
if (flags & RTF_REJECT) {
- printf("Choose one of blackhole or reject, not both.\n");
+ errx(1, "Choose one of blackhole or reject, "
+ "not both.");
}
flags |= RTF_BLACKHOLE;
- } else if (strncmp(argv[0], "reject", 6) == 0) {
+ } else if (strcmp(argv[0], "reject") == 0) {
if (flags & RTF_BLACKHOLE) {
- printf("Choose one of blackhole or reject, not both.\n");
+ errx(1, "Choose one of blackhole or reject, "
+ "not both.");
}
flags |= RTF_REJECT;
- } else if (strncmp(argv[0], "trail", 5) == 0) {
- /* XXX deprecated and undocumented feature */
- printf("%s: Sending trailers is no longer supported\n",
- host);
+ } else {
+ warnx("Invalid parameter '%s'", argv[0]);
+ usage();
}
argv++;
}
ea = (struct ether_addr *)LLADDR(&sdl_m);
if (doing_proxy && !strcmp(eaddr, "auto")) {
if (!get_ether_addr(dst->sin_addr.s_addr, ea)) {
- printf("no interface found for %s\n",
+ warnx("no interface found for %s",
inet_ntoa(dst->sin_addr));
return (1);
}
@@ -381,7 +381,7 @@ set(int argc, char **argv)
/*
* In the case a proxy-arp entry is being added for
- * a remote end point, the RTF_ANNOUNCE flag in the
+ * a remote end point, the RTF_ANNOUNCE flag in the
* RTM_GET command is an indication to the kernel
* routing code that the interface associated with
* the prefix route covering the local end of the
@@ -398,7 +398,7 @@ set(int argc, char **argv)
if ((sdl->sdl_family != AF_LINK) ||
(rtm->rtm_flags & RTF_GATEWAY) ||
!valid_type(sdl->sdl_type)) {
- printf("cannot intuit interface index and type for %s\n", host);
+ warnx("cannot intuit interface index and type for %s", host);
return (1);
}
sdl_m.sdl_type = sdl->sdl_type;
@@ -467,7 +467,7 @@ delete(char *host)
sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr);
/*
- * With the new L2/L3 restructure, the route
+ * With the new L2/L3 restructure, the route
* returned is a prefix route. The important
* piece of information from the previous
* RTM_GET is the interface index. In the
@@ -486,7 +486,7 @@ delete(char *host)
* is a proxy-arp entry to remove.
*/
if (flags & RTF_ANNOUNCE) {
- fprintf(stderr, "delete: cannot locate %s\n",host);
+ warnx("delete: cannot locate %s", host);
return (1);
}
@@ -525,7 +525,7 @@ search(u_long addr, action_fn *action)
mib[5] = RTF_LLINFO;
#else
mib[5] = 0;
-#endif
+#endif
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
err(1, "route-sysctl-estimate");
if (needed == 0) /* empty table */
@@ -575,7 +575,7 @@ print_entry(struct sockaddr_dl *sdl,
struct if_nameindex *p;
int seg;
- if (ifnameindex == NULL)
+ if (ifnameindex == NULL)
if ((ifnameindex = if_nameindex()) == NULL)
err(1, "cannot retrieve interface names");
@@ -597,7 +597,8 @@ print_entry(struct sockaddr_dl *sdl,
sdl->sdl_type == IFT_L2VLAN ||
sdl->sdl_type == IFT_BRIDGE) &&
sdl->sdl_alen == ETHER_ADDR_LEN)
- printf("%s", ether_ntoa((struct ether_addr *)LLADDR(sdl)));
+ printf("%s",
+ ether_ntoa((struct ether_addr *)LLADDR(sdl)));
else {
int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
@@ -607,7 +608,7 @@ print_entry(struct sockaddr_dl *sdl,
printf("(incomplete)");
for (p = ifnameindex; p && ifnameindex->if_index &&
- ifnameindex->if_name; p++) {
+ ifnameindex->if_name; p++) {
if (p->if_index == sdl->sdl_index) {
printf(" on %s", p->if_name);
break;
@@ -629,31 +630,31 @@ print_entry(struct sockaddr_dl *sdl,
printf(" published");
switch(sdl->sdl_type) {
case IFT_ETHER:
- printf(" [ethernet]");
- break;
+ printf(" [ethernet]");
+ break;
case IFT_ISO88025:
- printf(" [token-ring]");
+ printf(" [token-ring]");
trld = SDL_ISO88025(sdl);
if (trld->trld_rcf != 0) {
printf(" rt=%x", ntohs(trld->trld_rcf));
for (seg = 0;
seg < ((TR_RCF_RIFLEN(trld->trld_rcf) - 2 ) / 2);
- seg++)
+ seg++)
printf(":%x", ntohs(*(trld->trld_route[seg])));
}
break;
case IFT_FDDI:
- printf(" [fddi]");
- break;
+ printf(" [fddi]");
+ break;
case IFT_ATM:
- printf(" [atm]");
- break;
+ printf(" [atm]");
+ break;
case IFT_L2VLAN:
printf(" [vlan]");
break;
case IFT_IEEE1394:
- printf(" [firewire]");
- break;
+ printf(" [firewire]");
+ break;
case IFT_BRIDGE:
printf(" [bridge]");
break;
@@ -662,8 +663,8 @@ print_entry(struct sockaddr_dl *sdl,
break;
default:
break;
- }
-
+ }
+
printf("\n");
}
@@ -688,13 +689,13 @@ static void
usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
- "usage: arp [-n] [-i interface] hostname",
- " arp [-n] [-i interface] -a",
- " arp -d hostname [pub]",
- " arp -d [-i interface] -a",
- " arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
- " arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
- " arp -f filename");
+ "usage: arp [-n] [-i interface] hostname",
+ " arp [-n] [-i interface] -a",
+ " arp -d hostname [pub]",
+ " arp -d [-i interface] -a",
+ " arp -s hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
+ " arp -S hostname ether_addr [temp] [reject | blackhole] [pub [only]]",
+ " arp -f filename");
exit(1);
}
@@ -753,12 +754,12 @@ rtmsg(int cmd, struct sockaddr_in *dst, struct sockaddr_dl *sdl)
case RTM_GET:
rtm->rtm_addrs |= RTA_DST;
}
-#define NEXTADDR(w, s) \
- do { \
- if ((s) != NULL && rtm->rtm_addrs & (w)) { \
- bcopy((s), cp, sizeof(*(s))); \
- cp += SA_SIZE(s); \
- } \
+#define NEXTADDR(w, s) \
+ do { \
+ if ((s) != NULL && rtm->rtm_addrs & (w)) { \
+ bcopy((s), cp, sizeof(*(s))); \
+ cp += SA_SIZE(s); \
+ } \
} while (0)
NEXTADDR(RTA_DST, dst);
@@ -814,7 +815,7 @@ get_ether_addr(in_addr_t ipaddr, struct ether_addr *hwaddr)
}
#define NEXTIFR(i) \
- ((struct ifreq *)((char *)&(i)->ifr_addr \
+ ((struct ifreq *)((char *)&(i)->ifr_addr \
+ MAX((i)->ifr_addr.sa_len, sizeof((i)->ifr_addr))) )
/*
@@ -835,14 +836,10 @@ get_ether_addr(in_addr_t ipaddr, struct ether_addr *hwaddr)
if (ioctl(sock, SIOCGIFFLAGS, &ifreq) < 0)
continue;
if ((ifreq.ifr_flags &
- (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|
- IFF_LOOPBACK|IFF_NOARP))
- != (IFF_UP|IFF_BROADCAST))
+ (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|
+ IFF_LOOPBACK|IFF_NOARP)) != (IFF_UP|IFF_BROADCAST))
continue;
- /*
- * Get its netmask and check that it's on
- * the right subnet.
- */
+ /* Get its netmask and check that it's on the right subnet. */
if (ioctl(sock, SIOCGIFNETMASK, &ifreq) < 0)
continue;
mask = ((struct sockaddr_in *)
@@ -872,9 +869,8 @@ get_ether_addr(in_addr_t ipaddr, struct ether_addr *hwaddr)
*/
dla = (struct sockaddr_dl *) &ifr->ifr_addr;
memcpy(hwaddr, LLADDR(dla), dla->sdl_alen);
- printf("using interface %s for proxy with address ",
- ifp->ifr_name);
- printf("%s\n", ether_ntoa(hwaddr));
+ printf("using interface %s for proxy with address %s\n", ifp->ifr_name,
+ ether_ntoa(hwaddr));
retval = dla->sdl_alen;
done:
close(sock);
diff --git a/usr.sbin/bhyve/virtio.h b/usr.sbin/bhyve/virtio.h
index 0e96a1d..28eecc7 100644
--- a/usr.sbin/bhyve/virtio.h
+++ b/usr.sbin/bhyve/virtio.h
@@ -209,7 +209,7 @@ struct vring_used {
#define VIRTIO_VENDOR 0x1AF4
#define VIRTIO_DEV_NET 0x1000
#define VIRTIO_DEV_BLOCK 0x1001
-#define VIRTIO_DEV_RANDOM 0x1002
+#define VIRTIO_DEV_RANDOM 0x1005
/*
* PCI config space constants.
diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index 0d9e195..e826f36 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -464,9 +464,11 @@ finalconfig() {
trap error SIGINT # SIGINT is bad again
bsdinstall config || error "Failed to save config"
+if [ -n "$DISTDIR_IS_UNIONFS" ]; then
+ umount -f $BSDINSTALL_DISTDIR
+fi
+
if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then
- [ "$BSDINSTALL_FETCHDEST" != "$BSDINSTALL_DISTDIR" ] && \
- umount "$BSDINSTALL_DISTDIR"
rm -rf "$BSDINSTALL_FETCHDEST"
fi
diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8
index 479d880..551c137 100644
--- a/usr.sbin/ctladm/ctladm.8
+++ b/usr.sbin/ctladm/ctladm.8
@@ -888,8 +888,8 @@ client through the selection of appropriate commands and task attributes.
The default value is "restricted". It improves data integrity, but may
introduce some additional delays.
.It Va serseq
-Set to "on" to serialize conseсutive reads/writes.
-Set to "read" to serialize conseсutive reads.
+Set to "on" to serialize consecutive reads/writes.
+Set to "read" to serialize consecutive reads.
Set to "off" to allow them be issued in parallel.
Parallel issue of consecutive operations may confuse logic of the
backing file system, hurting performance; but it may improve performance
diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c
index 88fbc34..d700b2a 100644
--- a/usr.sbin/kldxref/ef.c
+++ b/usr.sbin/kldxref/ef.c
@@ -47,7 +47,7 @@
#include "ef.h"
-#define MAXSEGS 2
+#define MAXSEGS 3
struct ef_file {
char* ef_name;
struct elf_file *ef_efile;
@@ -600,7 +600,7 @@ ef_open(const char *filename, struct elf_file *efile, int verbose)
filename);
break;
} else if (nsegs > MAXSEGS) {
- warnx("%s: too many sections", filename);
+ warnx("%s: too many segments", filename);
break;
}
ef->ef_nsegs = nsegs;
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index cf80149..95ee865 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -109,10 +109,11 @@
#include <unistd.h>
#include "gmt2local.h"
-#define NEXTADDR(w, s) \
- if (rtm->rtm_addrs & (w)) { \
- bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);}
-
+#define NEXTADDR(w, s) \
+ if (rtm->rtm_addrs & (w)) { \
+ bcopy((char *)&s, cp, sizeof(s)); \
+ cp += SA_SIZE(&s); \
+ }
static pid_t pid;
static int nflag;
@@ -529,10 +530,10 @@ delete:
printf("cannot locate %s\n", host);
return (1);
}
- /*
- * need to reinit the field because it has rt_key
- * but we want the actual address
- */
+ /*
+ * need to reinit the field because it has rt_key
+ * but we want the actual address
+ */
NEXTADDR(RTA_DST, sin_m);
rtm->rtm_flags |= RTF_LLDATA;
if (rtmsg(RTM_DELETE) == 0) {
@@ -604,7 +605,8 @@ again:;
rtm = (struct rt_msghdr *)next;
sin = (struct sockaddr_in6 *)(rtm + 1);
- sdl = (struct sockaddr_dl *)((char *)sin + ALIGN(sin->sin6_len));
+ sdl = (struct sockaddr_dl *)((char *)sin +
+ ALIGN(sin->sin6_len));
/*
* Some OSes can produce a route that has the LINK flag but
@@ -724,7 +726,7 @@ again:;
isrouter ? "R" : "",
(rtm->rtm_flags & RTF_ANNOUNCE) ? "p" : "");
} else {
-#if 0 /* W and P are mystery even for us */
+#if 0 /* W and P are mystery even for us */
sin = (struct sockaddr_in6 *)
(sdl->sdl_len + (char *)sdl);
snprintf(flgbuf, sizeof(flgbuf), "%s%s%s%s",
@@ -855,7 +857,7 @@ rtmsg(int cmd)
rtm->rtm_inits = RTV_EXPIRE;
}
rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA);
-#if 0 /* we don't support ipv6addr/128 type proxying */
+#if 0 /* we don't support ipv6addr/128 type proxying */
if (rtm->rtm_flags & RTF_ANNOUNCE) {
rtm->rtm_flags &= ~RTF_HOST;
rtm->rtm_addrs |= RTA_NETMASK;
@@ -868,7 +870,7 @@ rtmsg(int cmd)
NEXTADDR(RTA_DST, sin_m);
NEXTADDR(RTA_GATEWAY, sdl_m);
-#if 0 /* we don't support ipv6addr/128 type proxying */
+#if 0 /* we don't support ipv6addr/128 type proxying */
memset(&so_mask.sin6_addr, 0xff, sizeof(so_mask.sin6_addr));
NEXTADDR(RTA_NETMASK, so_mask);
#endif
@@ -913,7 +915,7 @@ ifinfo(char *ifname, int argc, char **argv)
err(1, "ioctl(SIOCGIFINFO_IN6)");
/* NOTREACHED */
}
-#define ND nd.ndi
+#define ND nd.ndi
newflags = ND.flags;
for (i = 0; i < argc; i++) {
int clear = 0;
@@ -924,35 +926,33 @@ ifinfo(char *ifname, int argc, char **argv)
cp++;
}
-#define SETFLAG(s, f) \
- do {\
- if (strcmp(cp, (s)) == 0) {\
- if (clear)\
- newflags &= ~(f);\
- else\
- newflags |= (f);\
- }\
- } while (0)
+#define SETFLAG(s, f) do { \
+ if (strcmp(cp, (s)) == 0) { \
+ if (clear) \
+ newflags &= ~(f); \
+ else \
+ newflags |= (f); \
+ } \
+} while (0)
/*
* XXX: this macro is not 100% correct, in that it matches "nud" against
* "nudbogus". But we just let it go since this is minor.
*/
-#define SETVALUE(f, v) \
- do { \
- char *valptr; \
- unsigned long newval; \
- v = 0; /* unspecified */ \
- if (strncmp(cp, f, strlen(f)) == 0) { \
- valptr = strchr(cp, '='); \
- if (valptr == NULL) \
- err(1, "syntax error in %s field", (f)); \
- errno = 0; \
- newval = strtoul(++valptr, NULL, 0); \
- if (errno) \
- err(1, "syntax error in %s's value", (f)); \
- v = newval; \
- } \
- } while (0)
+#define SETVALUE(f, v) do { \
+ char *valptr; \
+ unsigned long newval; \
+ v = 0; /* unspecified */ \
+ if (strncmp(cp, f, strlen(f)) == 0) { \
+ valptr = strchr(cp, '='); \
+ if (valptr == NULL) \
+ err(1, "syntax error in %s field", (f)); \
+ errno = 0; \
+ newval = strtoul(++valptr, NULL, 0); \
+ if (errno) \
+ err(1, "syntax error in %s's value", (f)); \
+ v = newval; \
+ } \
+} while (0)
SETFLAG("disabled", ND6_IFF_IFDISABLED);
SETFLAG("nud", ND6_IFF_PERFORMNUD);
@@ -1021,7 +1021,7 @@ ifinfo(char *ifname, int argc, char **argv)
printf("%02x", rbuf[j]);
}
}
-#endif
+#endif /* IPV6CTL_USETEMPADDR */
if (ND.flags) {
printf("\nFlags: ");
#ifdef ND6_IFF_IFDISABLED
@@ -1314,7 +1314,7 @@ getdefif()
close(s);
}
-#endif
+#endif /* SIOCSDEFIFACE_IN6 */
static char *
sec2str(time_t total)
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index b4cf938..7603be8 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -79,15 +79,15 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
#include <sys/queue.h>
-#include <sys/uio.h>
-#include <sys/un.h>
-#include <sys/time.h>
#include <sys/resource.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/syslimits.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/un.h>
+#include <sys/wait.h>
#include <sys/types.h>
#include <sys/mman.h>
@@ -2351,7 +2351,7 @@ markit(void)
/*
* fork off and become a daemon, but wait for the child to come online
- * before returing to the parent, or we get disk thrashing at boot etc.
+ * before returning to the parent, or we get disk thrashing at boot etc.
* Set a timer so we don't hang forever if it wedges.
*/
static int
diff --git a/usr.sbin/tcpdump/tcpdump/Makefile b/usr.sbin/tcpdump/tcpdump/Makefile
index ec585f4..6967a14 100644
--- a/usr.sbin/tcpdump/tcpdump/Makefile
+++ b/usr.sbin/tcpdump/tcpdump/Makefile
@@ -8,7 +8,9 @@ TCPDUMP_DISTDIR?= ${.CURDIR}/../../../contrib/tcpdump
PROG= tcpdump
SRCS= addrtoname.c \
+ addrtostr.c \
af.c \
+ ascii_strcasecmp.c \
checksum.c \
cpack.c \
gmpls.c \
@@ -17,9 +19,11 @@ SRCS= addrtoname.c \
ipproto.c \
l2vpn.c \
machdep.c \
+ netdissect.c \
nlpid.c \
oui.c \
parsenfsfh.c \
+ print.c \
print-802_11.c \
print-802_15_4.c \
print-ah.c \
@@ -32,6 +36,7 @@ SRCS= addrtoname.c \
print-ascii.c \
print-atalk.c \
print-atm.c \
+ print-babel.c \
print-beep.c \
print-bfd.c \
print-bgp.c \
@@ -46,6 +51,7 @@ SRCS= addrtoname.c \
print-cnfp.c \
print-dccp.c \
print-decnet.c \
+ print-dhcp6.c \
print-domain.c \
print-dtp.c \
print-dvmrp.c \
@@ -58,17 +64,21 @@ SRCS= addrtoname.c \
print-fddi.c \
print-forces.c \
print-fr.c \
+ print-frag6.c \
print-ftp.c \
print-geneve.c \
print-geonet.c \
print-gre.c \
+ print-hncp.c \
print-hsrp.c \
print-http.c \
print-icmp.c \
+ print-icmp6.c \
print-igmp.c \
print-igrp.c \
print-ip.c \
print-ip6.c \
+ print-ip6opts.c \
print-ipcomp.c \
print-ipfc.c \
print-ipnet.c \
@@ -80,6 +90,7 @@ SRCS= addrtoname.c \
print-l2tp.c \
print-lane.c \
print-ldp.c \
+ print-lisp.c \
print-llc.c \
print-lldp.c \
print-lmp.c \
@@ -88,19 +99,23 @@ SRCS= addrtoname.c \
print-lwapp.c \
print-lwres.c \
print-m3ua.c \
+ print-medsa.c \
print-mobile.c \
+ print-mobility.c \
print-mpcp.c \
print-mpls.c \
print-mptcp.c \
print-msdp.c \
print-msnlb.c \
print-nfs.c \
+ print-nsh.c \
print-ntp.c \
print-null.c \
print-olsr.c \
print-openflow.c \
print-openflow-1.0.c \
print-ospf.c \
+ print-ospf6.c \
print-otv.c \
print-pgm.c \
print-pim.c \
@@ -111,10 +126,13 @@ SRCS= addrtoname.c \
print-pptp.c \
print-radius.c \
print-raw.c \
+ print-resp.c \
print-rip.c \
+ print-ripng.c \
print-rpki-rtr.c \
print-rrcp.c \
print-rsvp.c \
+ print-rt6.c \
print-rtsp.c \
print-rx.c \
print-sctp.c \
@@ -144,14 +162,16 @@ SRCS= addrtoname.c \
print-vrrp.c \
print-vtp.c \
print-vxlan.c \
+ print-vxlan-gpe.c \
print-wb.c \
print-zephyr.c \
print-zeromq.c \
setsignal.c \
signature.c \
smbutil.c \
+ strtoaddr.c \
tcpdump.c \
- util.c \
+ util-print.c \
version.c
CLEANFILES+= version.c
@@ -160,16 +180,7 @@ CFLAGS+= -DHAVE_CONFIG_H
CFLAGS+= -D_U_="__attribute__((unused))"
.if ${MK_INET6_SUPPORT} != "no"
-SRCS+= print-babel.c \
- print-dhcp6.c \
- print-frag6.c \
- print-icmp6.c \
- print-ip6opts.c \
- print-mobility.c \
- print-ospf6.c \
- print-ripng.c \
- print-rt6.c
-CFLAGS+= -DINET6
+CFLAGS+= -DINET6 -DHAVE_OS_IPV6_SUPPORT
.endif
.if ${MACHINE_CPUARCH} != "i386"
CFLAGS+= -DLBL_ALIGN
@@ -190,7 +201,7 @@ CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_OPENSSL_EVP_H
.if ${MK_PF} != "no"
SRCS+= print-pflog.c \
print-pfsync.c
-CFLAGS+= -DHAVE_NET_PFVAR_H
+CFLAGS+= -DHAVE_NET_PFVAR_H -DHAVE_NET_IF_PFLOG_H
.endif
version.c: ${TCPDUMP_DISTDIR}/VERSION
diff --git a/usr.sbin/tcpdump/tcpdump/config.h b/usr.sbin/tcpdump/tcpdump/config.h
index 79a07e7..8980b31 100644
--- a/usr.sbin/tcpdump/tcpdump/config.h
+++ b/usr.sbin/tcpdump/tcpdump/config.h
@@ -4,8 +4,8 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
-/* define if you have the addrinfo function */
-#define HAVE_ADDRINFO 1
+/* define if you want to build the possibly-buggy SMB printer */
+#define ENABLE_SMB 1
/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1
@@ -14,6 +14,9 @@
#define HAVE_BPF_DUMP 1
/* capsicum support available */
+#define HAVE_CAPSICUM 1
+
+/* Casper library support available */
/* See Makefile */
/* #undef HAVE_CASPER */
@@ -39,24 +42,21 @@
/* Define to 1 if you have the `ether_ntohost' function. */
#define HAVE_ETHER_NTOHOST 1
+/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
+#define HAVE_EVP_CIPHER_CTX_NEW 1
+
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
-/* Define to 1 if you have the `getnameinfo' function. */
-#define HAVE_GETNAMEINFO 1
-
/* Define to 1 if you have the `getopt_long' function. */
#define HAVE_GETOPT_LONG 1
/* define if you have getrpcbynumber() */
#define HAVE_GETRPCBYNUMBER 1
-/* define if you have the h_errno variable */
-#define HAVE_H_ERRNO 1
-
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
@@ -85,6 +85,10 @@
/* Define to 1 if you have the <netinet/if_ether.h> header file. */
#define HAVE_NETINET_IF_ETHER_H 1
+/* Define to 1 if you have the <net/if_pflog.h> header file. */
+/* See Makefile */
+/* #undef HAVE_NET_IF_PFLOG_H */
+
/* Define to 1 if you have the <net/pfvar.h> header file. */
/* See Makefile */
/* #undef HAVE_NET_PFVAR_H */
@@ -96,6 +100,10 @@
/* See Makefile */
/* #undef HAVE_OPENSSL_EVP_H 1 */
+/* define if the OS provides AF_INET6 and struct in6_addr */
+/* See Makefile */
+/* #undef HAVE_OS_IPV6_SUPPORT */
+
/* if there's an os_proto.h for this platform, to use additional prototypes */
/* #undef HAVE_OS_PROTO_H */
@@ -150,6 +158,12 @@
/* Define to 1 if you have the `pcap_set_immediate_mode' function. */
#define HAVE_PCAP_SET_IMMEDIATE_MODE 1
+/* Define to 1 if you have the `pcap_set_optimizer_debug' function. */
+/* #undef HAVE_PCAP_SET_OPTIMIZER_DEBUG */
+
+/* Define to 1 if you have the `pcap_set_parser_debug' function. */
+/* #undef HAVE_PCAP_SET_PARSER_DEBUG */
+
/* Define to 1 if you have the `pcap_set_tstamp_precision' function. */
#define HAVE_PCAP_SET_TSTAMP_PRECISION 1
@@ -192,9 +206,6 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
-/* Define to 1 if you have the `strcasecmp' function. */
-#define HAVE_STRCASECMP 1
-
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
@@ -246,16 +257,9 @@
/* define if your compiler has __attribute__ */
#define HAVE___ATTRIBUTE__ 1
-/* Define if you enable IPv6 support */
-/* See Makefile */
-/* #undef INET6 */
-
/* if unaligned access fails */
/* #undef LBL_ALIGN */
-/* define if you need to include missing/addrinfo.h */
-/* #undef NEED_ADDRINFO_H */
-
/* Define to 1 if netinet/ether.h declares `ether_ntohost' */
/* #undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST */
@@ -301,9 +305,6 @@
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
-/* define if you want to build the possibly-buggy SMB printer */
-#define TCPDUMP_DO_SMB 1
-
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index 1dba9cb..9807de81 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -393,11 +393,15 @@ load_vt4mappingtable(unsigned int nmappings, FILE *f)
if (nmappings == 0)
return (NULL);
- t = malloc(sizeof *t * nmappings);
+ if ((t = malloc(sizeof *t * nmappings)) == NULL) {
+ warn("malloc");
+ return (NULL);
+ }
if (fread(t, sizeof *t * nmappings, 1, f) != 1) {
- perror("mappings");
- exit(1);
+ warn("read mappings");
+ free(t);
+ return (NULL);
}
for (i = 0; i < nmappings; i++) {
@@ -422,7 +426,7 @@ load_default_vt4font(void)
}
}
-static int
+static void
load_vt4font(FILE *f)
{
struct vt4font_header fh;
@@ -431,13 +435,13 @@ load_vt4font(FILE *f)
unsigned int i;
if (fread(&fh, sizeof fh, 1, f) != 1) {
- perror("file_header");
- return (1);
+ warn("read file_header");
+ return;
}
if (memcmp(fh.magic, "VFNT0002", 8) != 0) {
- fprintf(stderr, "Bad magic\n");
- return (1);
+ warnx("bad magic in font file\n");
+ return;
}
for (i = 0; i < VFNT_MAPS; i++)
@@ -447,21 +451,26 @@ load_vt4font(FILE *f)
vfnt.height = fh.height;
glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.glyph_count;
- vfnt.glyphs = malloc(glyphsize);
+ if ((vfnt.glyphs = malloc(glyphsize)) == NULL) {
+ warn("malloc");
+ return;
+ }
if (fread(vfnt.glyphs, glyphsize, 1, f) != 1) {
- perror("glyphs");
- return (1);
+ warn("read glyphs");
+ free(vfnt.glyphs);
+ return;
}
for (i = 0; i < VFNT_MAPS; i++)
vfnt.map[i] = load_vt4mappingtable(vfnt.map_count[i], f);
- if (ioctl(STDIN_FILENO, PIO_VFONT, &vfnt) == -1) {
- perror("PIO_VFONT");
- return (1);
- }
- return (0);
+ if (ioctl(STDIN_FILENO, PIO_VFONT, &vfnt) == -1)
+ warn("PIO_VFONT");
+
+ for (i = 0; i < VFNT_MAPS; i++)
+ free(vfnt.map[i]);
+ free(vfnt.glyphs);
}
/*
@@ -511,8 +520,7 @@ load_font(const char *type, const char *filename)
}
if (vt4_mode) {
- if(load_vt4font(fd))
- warn("failed to load font \"%s\"", filename);
+ load_vt4font(fd);
fclose(fd);
return;
}
OpenPOWER on IntegriCloud