svn commit: r253432 - in user/attilio/vmobj-fullread: . etc/rc.d lib/libc/gen lib/libc/stdlib lib/libusb lib/msun/src sbin/mount sbin/nvmecontrol sbin/route share/examples/kld/syscall/test share/ma...
Attilio Rao
attilio at FreeBSD.org
Wed Jul 17 17:40:40 UTC 2013
Author: attilio
Date: Wed Jul 17 17:40:36 2013
New Revision: 253432
URL: http://svnweb.freebsd.org/changeset/base/253432
Log:
MFC
Added:
user/attilio/vmobj-fullread/share/monetdef/ca_ES.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/ca_ES.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/de_AT.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/de_AT.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/de_DE.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/de_DE.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/el_GR.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/el_GR.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/es_ES.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/es_ES.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/fi_FI.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/fi_FI.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/fr_BE.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/fr_BE.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/fr_FR.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/fr_FR.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/it_IT.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/it_IT.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/nl_BE.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/nl_BE.UTF-8.src
user/attilio/vmobj-fullread/share/monetdef/nl_NL.UTF-8.src
- copied unchanged from r253431, user/attilio/vmobj-readlock/share/monetdef/nl_NL.UTF-8.src
user/attilio/vmobj-fullread/sys/arm/broadcom/bcm2835/std.bcm2835
- copied unchanged from r253431, user/attilio/vmobj-readlock/sys/arm/broadcom/bcm2835/std.bcm2835
user/attilio/vmobj-fullread/sys/arm/broadcom/bcm2835/std.rpi
- copied unchanged from r253431, user/attilio/vmobj-readlock/sys/arm/broadcom/bcm2835/std.rpi
user/attilio/vmobj-fullread/tools/build/options/WITHOUT_ARM_EABI
- copied unchanged from r253431, user/attilio/vmobj-readlock/tools/build/options/WITHOUT_ARM_EABI
Deleted:
user/attilio/vmobj-fullread/tools/build/options/WITH_ARM_EABI
user/attilio/vmobj-fullread/usr.bin/systat/mbufs.c
Modified:
user/attilio/vmobj-fullread/UPDATING
user/attilio/vmobj-fullread/etc/rc.d/pfsync
user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3
user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c
user/attilio/vmobj-fullread/lib/libusb/Makefile
user/attilio/vmobj-fullread/lib/libusb/libusb20.c
user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c
user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h
user/attilio/vmobj-fullread/lib/msun/src/math.h
user/attilio/vmobj-fullread/sbin/mount/mount.8
user/attilio/vmobj-fullread/sbin/mount/mount.c
user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c
user/attilio/vmobj-fullread/sbin/route/Makefile
user/attilio/vmobj-fullread/sbin/route/route.c
user/attilio/vmobj-fullread/share/examples/kld/syscall/test/call.c
user/attilio/vmobj-fullread/share/man/man4/mfi.4
user/attilio/vmobj-fullread/share/man/man5/fstab.5
user/attilio/vmobj-fullread/share/man/man5/src.conf.5
user/attilio/vmobj-fullread/share/mk/bsd.own.mk
user/attilio/vmobj-fullread/share/monetdef/Makefile
user/attilio/vmobj-fullread/sys/amd64/amd64/machdep.c
user/attilio/vmobj-fullread/sys/arm/arm/vfp.c
user/attilio/vmobj-fullread/sys/arm/arm/vm_machdep.c
user/attilio/vmobj-fullread/sys/arm/conf/RPI-B
user/attilio/vmobj-fullread/sys/cam/cam_periph.c
user/attilio/vmobj-fullread/sys/cam/cam_xpt.c
user/attilio/vmobj-fullread/sys/cam/scsi/scsi_all.c
user/attilio/vmobj-fullread/sys/cam/scsi/scsi_all.h
user/attilio/vmobj-fullread/sys/cam/scsi/scsi_ch.c
user/attilio/vmobj-fullread/sys/cam/scsi/scsi_xpt.c
user/attilio/vmobj-fullread/sys/compat/linux/linux_ioctl.c
user/attilio/vmobj-fullread/sys/compat/linux/linux_ioctl.h
user/attilio/vmobj-fullread/sys/conf/Makefile.arm
user/attilio/vmobj-fullread/sys/conf/files
user/attilio/vmobj-fullread/sys/dev/acpica/acpi_resource.c
user/attilio/vmobj-fullread/sys/dev/ae/if_ae.c
user/attilio/vmobj-fullread/sys/dev/ae/if_aereg.h
user/attilio/vmobj-fullread/sys/dev/bge/if_bge.c
user/attilio/vmobj-fullread/sys/dev/bge/if_bgereg.h
user/attilio/vmobj-fullread/sys/dev/cxgbe/firmware/t5fw_cfg.txt
user/attilio/vmobj-fullread/sys/dev/isp/isp.c
user/attilio/vmobj-fullread/sys/dev/isp/ispreg.h
user/attilio/vmobj-fullread/sys/dev/usb/controller/xhci_pci.c
user/attilio/vmobj-fullread/sys/dev/usb/input/ukbd.c
user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_rum.c
user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_uath.c
user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_upgt.c
user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_ural.c
user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_urtw.c
user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_urtwn.c
user/attilio/vmobj-fullread/sys/dev/usb/wlan/if_zyd.c
user/attilio/vmobj-fullread/sys/fs/fuse/fuse_kernel.h
user/attilio/vmobj-fullread/sys/i386/i386/support.s
user/attilio/vmobj-fullread/sys/i386/i386/symbols.raw
user/attilio/vmobj-fullread/sys/i386/i386/uio_machdep.c
user/attilio/vmobj-fullread/sys/i386/i386/vm_machdep.c
user/attilio/vmobj-fullread/sys/kern/kern_mbuf.c
user/attilio/vmobj-fullread/sys/kern/kern_time.c
user/attilio/vmobj-fullread/sys/kern/subr_bus.c
user/attilio/vmobj-fullread/sys/kern/uipc_mbuf.c
user/attilio/vmobj-fullread/sys/kern/uipc_syscalls.c
user/attilio/vmobj-fullread/sys/kern/vfs_bio.c
user/attilio/vmobj-fullread/sys/kern/vfs_subr.c
user/attilio/vmobj-fullread/sys/mips/mips/uio_machdep.c
user/attilio/vmobj-fullread/sys/mips/mips/vm_machdep.c
user/attilio/vmobj-fullread/sys/modules/Makefile
user/attilio/vmobj-fullread/sys/modules/usb/Makefile
user/attilio/vmobj-fullread/sys/net/ieee8023ad_lacp.c
user/attilio/vmobj-fullread/sys/net/if.c
user/attilio/vmobj-fullread/sys/net/if_lagg.c
user/attilio/vmobj-fullread/sys/net/if_lagg.h
user/attilio/vmobj-fullread/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
user/attilio/vmobj-fullread/sys/netgraph/bluetooth/socket/ng_btsocket.c
user/attilio/vmobj-fullread/sys/netgraph/ng_base.c
user/attilio/vmobj-fullread/sys/netinet/tcp_syncache.c
user/attilio/vmobj-fullread/sys/ofed/drivers/net/mlx4/main.c
user/attilio/vmobj-fullread/sys/powerpc/aim/vm_machdep.c
user/attilio/vmobj-fullread/sys/powerpc/booke/vm_machdep.c
user/attilio/vmobj-fullread/sys/powerpc/powerpc/uio_machdep.c
user/attilio/vmobj-fullread/sys/sparc64/sparc64/uio_machdep.c
user/attilio/vmobj-fullread/sys/sparc64/sparc64/vm_machdep.c
user/attilio/vmobj-fullread/sys/sys/mbuf.h
user/attilio/vmobj-fullread/sys/sys/param.h
user/attilio/vmobj-fullread/sys/sys/sf_buf.h
user/attilio/vmobj-fullread/sys/ufs/ffs/ffs_alloc.c
user/attilio/vmobj-fullread/tools/regression/aio/aiop/aiop.c
user/attilio/vmobj-fullread/tools/regression/lib/libc/gen/test-fpclassify.c
user/attilio/vmobj-fullread/tools/regression/lib/libc/gen/test-ftw.c
user/attilio/vmobj-fullread/tools/regression/priv/Makefile
user/attilio/vmobj-fullread/tools/regression/pthread/cv_cancel1/cv_cancel1.c
user/attilio/vmobj-fullread/tools/regression/sbin/dhclient/Makefile
user/attilio/vmobj-fullread/usr.bin/netstat/main.c
user/attilio/vmobj-fullread/usr.bin/netstat/mbuf.c
user/attilio/vmobj-fullread/usr.bin/systat/Makefile
user/attilio/vmobj-fullread/usr.bin/systat/cmdtab.c
user/attilio/vmobj-fullread/usr.bin/systat/extern.h
user/attilio/vmobj-fullread/usr.bin/systat/systat.1
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/cdrom.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/common.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/directory.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/dos.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/floppy.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/ftp.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/http.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/httpproxy.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/nfs.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/ufs.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/media/usb.subr
user/attilio/vmobj-fullread/usr.sbin/bsdconfig/share/packages/packages.subr
user/attilio/vmobj-fullread/usr.sbin/rtsold/rtsol.c
user/attilio/vmobj-fullread/usr.sbin/ypserv/yp_access.c
user/attilio/vmobj-fullread/usr.sbin/ypserv/yp_dnslookup.c
Directory Properties:
user/attilio/vmobj-fullread/ (props changed)
user/attilio/vmobj-fullread/lib/libc/ (props changed)
user/attilio/vmobj-fullread/sbin/ (props changed)
user/attilio/vmobj-fullread/share/man/man4/ (props changed)
user/attilio/vmobj-fullread/sys/ (props changed)
user/attilio/vmobj-fullread/sys/conf/ (props changed)
user/attilio/vmobj-fullread/usr.sbin/rtsold/ (props changed)
Modified: user/attilio/vmobj-fullread/UPDATING
==============================================================================
--- user/attilio/vmobj-fullread/UPDATING Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/UPDATING Wed Jul 17 17:40:36 2013 (r253432)
@@ -31,6 +31,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20130716:
+ The default ARM ABI has changed to the ARM EABI. The old ABI is
+ incompatible with the ARM EABI and all programs and modules will
+ need to be rebuilt to work with a new kernel.
+
+ To keep using the old ABI ensure the WITHOUT_ARM_EABI knob is set.
+
+ NOTE: Support for the old ABI will be removed in the future and
+ users are advised to upgrade.
+
20130709:
pkg_install has been disconnected from the build if you really need it
you should add WITH_PKGTOOLS in your src.conf(5).
@@ -38,7 +48,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
20130709:
Most of network statistics structures were changed to be able
keep 64-bits counters. Thus all tools, that work with networking
- statistics, must be rebuilded (netstat(1), bsnmpd(1), etc.)
+ statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.)
20130629:
Fix targets that run multiple make's to use && rather than ;
Modified: user/attilio/vmobj-fullread/etc/rc.d/pfsync
==============================================================================
--- user/attilio/vmobj-fullread/etc/rc.d/pfsync Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/etc/rc.d/pfsync Wed Jul 17 17:40:36 2013 (r253432)
@@ -42,7 +42,7 @@ pfsync_start()
pfsync_stop()
{
echo "Disabling pfsync."
- ifconfig pfsync0 -syncdev down
+ ifconfig pfsync0 -syncdev -syncpeer down
}
load_rc_config $name
Modified: user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3
==============================================================================
--- user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3 Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/lib/libc/gen/sysctl.3 Wed Jul 17 17:40:36 2013 (r253432)
@@ -548,13 +548,13 @@ The third level name is a protocol numbe
The fourth level name is an address family, which may be set to 0 to
select all address families.
The fifth, sixth, and seventh level names are as follows:
-.Bl -column "Fifth level " "Sixth level " -offset indent
-.It Sy "Fifth level Sixth level Seventh level"
-.It "NET_RT_FLAGS rtflags None"
-.It "NET_RT_DUMP None None or fib number"
-.It "NET_RT_IFLIST 0 or if_index None"
-.It "NET_RT_IFMALIST 0 or if_index None"
-.It "NET_RT_IFLISTL 0 or if_index None"
+.Bl -column -offset indent "Fifth level Sixth level" "Seventh level"
+.It Sy "Fifth level Sixth level" Ta Sy "Seventh level"
+.It "NET_RT_FLAGS rtflags" Ta "None"
+.It "NET_RT_DUMP None" Ta "None or fib number"
+.It "NET_RT_IFLIST 0 or if_index" Ta None
+.It "NET_RT_IFMALIST 0 or if_index" Ta None
+.It "NET_RT_IFLISTL 0 or if_index" Ta None
.El
.Pp
The
Modified: user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c
==============================================================================
--- user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/lib/libc/stdlib/getenv.c Wed Jul 17 17:40:36 2013 (r253432)
@@ -505,9 +505,8 @@ __setenv(const char *name, size_t nameLe
envVars[envNdx].valueSize = valueLen;
/* Save name of name/value pair. */
- env = stpcpy(envVars[envNdx].name, name);
- if ((envVars[envNdx].name)[nameLen] != '=')
- env = stpcpy(env, "=");
+ env = stpncpy(envVars[envNdx].name, name, nameLen);
+ *env++ = '=';
}
else
env = envVars[envNdx].value;
Modified: user/attilio/vmobj-fullread/lib/libusb/Makefile
==============================================================================
--- user/attilio/vmobj-fullread/lib/libusb/Makefile Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/lib/libusb/Makefile Wed Jul 17 17:40:36 2013 (r253432)
@@ -15,11 +15,12 @@ INCS+= libusb20_desc.h
MAN= libusb.3 libusb20.3
MKLINT= no
NOGCCERROR=
+PTHREAD_LIBS?= -lpthread
WARNS?= 2
DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LDADD= ${PTHREAD_LIBS}
MLINKS+= libusb.3 usb.3
@@ -42,7 +43,17 @@ CFLAGS+= -DCOMPAT_32BIT
#
# Examples:
# make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h
-# make COMPAT_32BIT=YES LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h
+# make COMPAT_32BIT=YES \
+# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \
+# DEBUG_FLAGS="-g"
+#
+# From Ubuntu 10.04:
+# freebsd-make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \
+# PTHREAD_LIBS="-lpthread -lrt"
+# freebsd-make COMPAT32_BIT=YES \
+# LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \
+# PTHREAD_LIBS="-lpthread -lrt"
+#
#
.if defined(LIBUSB_GLOBAL_INCLUDE_FILE)
CFLAGS+= -DLIBUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\"
Modified: user/attilio/vmobj-fullread/lib/libusb/libusb20.c
==============================================================================
--- user/attilio/vmobj-fullread/lib/libusb/libusb20.c Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/lib/libusb/libusb20.c Wed Jul 17 17:40:36 2013 (r253432)
@@ -1202,27 +1202,13 @@ libusb20_be_alloc(const struct libusb20_
struct libusb20_backend *
libusb20_be_alloc_linux(void)
{
- struct libusb20_backend *pbe;
-
-#ifdef __linux__
- pbe = libusb20_be_alloc(&libusb20_linux_backend);
-#else
- pbe = NULL;
-#endif
- return (pbe);
+ return (NULL);
}
struct libusb20_backend *
libusb20_be_alloc_ugen20(void)
{
- struct libusb20_backend *pbe;
-
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- pbe = libusb20_be_alloc(&libusb20_ugen20_backend);
-#else
- pbe = NULL;
-#endif
- return (pbe);
+ return (libusb20_be_alloc(&libusb20_ugen20_backend));
}
struct libusb20_backend *
@@ -1230,10 +1216,12 @@ libusb20_be_alloc_default(void)
{
struct libusb20_backend *pbe;
+#ifdef __linux__
pbe = libusb20_be_alloc_linux();
if (pbe) {
return (pbe);
}
+#endif
pbe = libusb20_be_alloc_ugen20();
if (pbe) {
return (pbe);
Modified: user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c
==============================================================================
--- user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/lib/libusb/libusb20_ugen20.c Wed Jul 17 17:40:36 2013 (r253432)
@@ -46,6 +46,10 @@
#include "libusb20_desc.h"
#include "libusb20_int.h"
+#ifndef IOUSB
+#define IOUSB(a) a
+#endif
+
static libusb20_init_backend_t ugen20_init_backend;
static libusb20_open_device_t ugen20_open_device;
static libusb20_close_device_t ugen20_close_device;
@@ -145,14 +149,14 @@ ugen20_enumerate(struct libusb20_device
if (f < 0) {
return (LIBUSB20_ERROR_OTHER);
}
- if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) {
+ if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) {
error = LIBUSB20_ERROR_OTHER;
goto done;
}
/* store when the device was plugged */
pdev->session_data.plugtime = plugtime;
- if (ioctl(f, USB_GET_DEVICE_DESC, &ddesc)) {
+ if (ioctl(f, IOUSB(USB_GET_DEVICE_DESC), &ddesc)) {
error = LIBUSB20_ERROR_OTHER;
goto done;
}
@@ -167,7 +171,7 @@ ugen20_enumerate(struct libusb20_device
error = LIBUSB20_ERROR_OTHER;
goto done;
}
- if (ioctl(f, USB_GET_DEVICEINFO, &devinfo)) {
+ if (ioctl(f, IOUSB(USB_GET_DEVICEINFO), &devinfo)) {
error = LIBUSB20_ERROR_OTHER;
goto done;
}
@@ -241,7 +245,7 @@ repeat:
st->urd.urd_maxlen = sizeof(st->buf);
st->nparsed = 0;
- if (ioctl(st->f, USB_READ_DIR, &st->urd)) {
+ if (ioctl(st->f, IOUSB(USB_READ_DIR), &st->urd)) {
return (EINVAL);
}
st->ptr = st->buf;
@@ -313,7 +317,7 @@ ugen20_tr_release(struct libusb20_device
/* release all pending USB transfers */
if (pdev->privBeData != NULL) {
memset(&fs_uninit, 0, sizeof(fs_uninit));
- if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) {
+ if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) {
/* ignore any errors of this kind */
}
}
@@ -353,7 +357,7 @@ ugen20_tr_renew(struct libusb20_device *
fs_init.pEndpoints = libusb20_pass_ptr(pdev->privBeData);
fs_init.ep_index_max = nMaxTransfer;
- if (ioctl(pdev->file, USB_FS_INIT, &fs_init)) {
+ if (ioctl(pdev->file, IOUSB(USB_FS_INIT), &fs_init)) {
error = LIBUSB20_ERROR_OTHER;
goto done;
}
@@ -387,7 +391,7 @@ ugen20_open_device(struct libusb20_devic
close(g);
return (LIBUSB20_ERROR_NO_DEVICE);
}
- if (ioctl(f, USB_GET_PLUGTIME, &plugtime)) {
+ if (ioctl(f, IOUSB(USB_GET_PLUGTIME), &plugtime)) {
error = LIBUSB20_ERROR_OTHER;
goto done;
}
@@ -430,7 +434,7 @@ ugen20_close_device(struct libusb20_devi
if (pdev->privBeData) {
memset(&fs_uninit, 0, sizeof(fs_uninit));
- if (ioctl(pdev->file, USB_FS_UNINIT, &fs_uninit)) {
+ if (ioctl(pdev->file, IOUSB(USB_FS_UNINIT), &fs_uninit)) {
/* ignore this error */
}
free(pdev->privBeData);
@@ -468,7 +472,7 @@ ugen20_get_config_desc_full(struct libus
gen_desc.ugd_maxlen = sizeof(cdesc);
gen_desc.ugd_config_index = cfg_index;
- error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc);
+ error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc);
if (error) {
return (LIBUSB20_ERROR_OTHER);
}
@@ -488,7 +492,7 @@ ugen20_get_config_desc_full(struct libus
gen_desc.ugd_data = libusb20_pass_ptr(ptr);
gen_desc.ugd_maxlen = len;
- error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc);
+ error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc);
if (error) {
free(ptr);
return (LIBUSB20_ERROR_OTHER);
@@ -507,7 +511,7 @@ ugen20_get_config_index(struct libusb20_
{
int temp;
- if (ioctl(pdev->file_ctrl, USB_GET_CONFIG, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_CONFIG), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
*pindex = temp;
@@ -523,7 +527,7 @@ ugen20_set_config_index(struct libusb20_
/* release all active USB transfers */
ugen20_tr_release(pdev);
- if (ioctl(pdev->file_ctrl, USB_SET_CONFIG, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_CONFIG), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
return (ugen20_tr_renew(pdev));
@@ -543,7 +547,7 @@ ugen20_set_alt_index(struct libusb20_dev
/* release all active USB transfers */
ugen20_tr_release(pdev);
- if (ioctl(pdev->file_ctrl, USB_SET_ALTINTERFACE, &alt_iface)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_ALTINTERFACE), &alt_iface)) {
return (LIBUSB20_ERROR_OTHER);
}
return (ugen20_tr_renew(pdev));
@@ -557,7 +561,7 @@ ugen20_reset_device(struct libusb20_devi
/* release all active USB transfers */
ugen20_tr_release(pdev);
- if (ioctl(pdev->file_ctrl, USB_DEVICEENUMERATE, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_DEVICEENUMERATE), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
return (ugen20_tr_renew(pdev));
@@ -569,7 +573,7 @@ ugen20_check_connected(struct libusb20_d
uint32_t plugtime;
int error = 0;
- if (ioctl(pdev->file_ctrl, USB_GET_PLUGTIME, &plugtime)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_PLUGTIME), &plugtime)) {
error = LIBUSB20_ERROR_NO_DEVICE;
goto done;
}
@@ -606,7 +610,7 @@ ugen20_set_power_mode(struct libusb20_de
default:
return (LIBUSB20_ERROR_INVALID_PARAM);
}
- if (ioctl(pdev->file_ctrl, USB_SET_POWER_MODE, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_SET_POWER_MODE), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
return (0);
@@ -617,7 +621,7 @@ ugen20_get_power_mode(struct libusb20_de
{
int temp;
- if (ioctl(pdev->file_ctrl, USB_GET_POWER_MODE, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_MODE), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
switch (temp) {
@@ -649,7 +653,7 @@ ugen20_get_port_path(struct libusb20_dev
{
struct usb_device_port_path udpp;
- if (ioctl(pdev->file_ctrl, USB_GET_DEV_PORT_PATH, &udpp))
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_DEV_PORT_PATH), &udpp))
return (LIBUSB20_ERROR_OTHER);
if (udpp.udp_port_level > bufsize)
@@ -665,7 +669,7 @@ ugen20_get_power_usage(struct libusb20_d
{
int temp;
- if (ioctl(pdev->file_ctrl, USB_GET_POWER_USAGE, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_GET_POWER_USAGE), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
*power_usage = temp;
@@ -678,7 +682,7 @@ ugen20_kernel_driver_active(struct libus
{
int temp = iface_index;
- if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_ACTIVE, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_ACTIVE), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
return (0); /* kernel driver is active */
@@ -690,7 +694,7 @@ ugen20_detach_kernel_driver(struct libus
{
int temp = iface_index;
- if (ioctl(pdev->file_ctrl, USB_IFACE_DRIVER_DETACH, &temp)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_IFACE_DRIVER_DETACH), &temp)) {
return (LIBUSB20_ERROR_OTHER);
}
return (0); /* kernel driver is active */
@@ -713,7 +717,7 @@ ugen20_do_request_sync(struct libusb20_d
sizeof(req.ucr_request), setup)) {
/* ignore */
}
- if (ioctl(pdev->file_ctrl, USB_DO_REQUEST, &req)) {
+ if (ioctl(pdev->file_ctrl, IOUSB(USB_DO_REQUEST), &req)) {
return (LIBUSB20_ERROR_OTHER);
}
if (pactlen) {
@@ -732,7 +736,7 @@ ugen20_process(struct libusb20_device *p
while (1) {
- if (ioctl(pdev->file, USB_FS_COMPLETE, &temp)) {
+ if (ioctl(pdev->file, IOUSB(USB_FS_COMPLETE), &temp)) {
if (errno == EBUSY) {
break;
} else {
@@ -800,10 +804,10 @@ ugen20_tr_open(struct libusb20_transfer
if (stream_id != 0) {
temp.fs_open_stream.stream_id = stream_id;
- if (ioctl(xfer->pdev->file, USB_FS_OPEN_STREAM, &temp.fs_open_stream))
+ if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN_STREAM), &temp.fs_open_stream))
return (LIBUSB20_ERROR_INVALID_PARAM);
} else {
- if (ioctl(xfer->pdev->file, USB_FS_OPEN, &temp.fs_open))
+ if (ioctl(xfer->pdev->file, IOUSB(USB_FS_OPEN), &temp.fs_open))
return (LIBUSB20_ERROR_INVALID_PARAM);
}
/* maximums might have changed - update */
@@ -829,7 +833,7 @@ ugen20_tr_close(struct libusb20_transfer
temp.ep_index = xfer->trIndex;
- if (ioctl(xfer->pdev->file, USB_FS_CLOSE, &temp)) {
+ if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLOSE), &temp)) {
return (LIBUSB20_ERROR_INVALID_PARAM);
}
return (0); /* success */
@@ -846,7 +850,7 @@ ugen20_tr_clear_stall_sync(struct libusb
temp.ep_index = xfer->trIndex;
- if (ioctl(xfer->pdev->file, USB_FS_CLEAR_STALL_SYNC, &temp)) {
+ if (ioctl(xfer->pdev->file, IOUSB(USB_FS_CLEAR_STALL_SYNC), &temp)) {
return (LIBUSB20_ERROR_INVALID_PARAM);
}
return (0); /* success */
@@ -885,7 +889,7 @@ ugen20_tr_submit(struct libusb20_transfe
temp.ep_index = xfer->trIndex;
- if (ioctl(xfer->pdev->file, USB_FS_START, &temp)) {
+ if (ioctl(xfer->pdev->file, IOUSB(USB_FS_START), &temp)) {
/* ignore any errors - should never happen */
}
return; /* success */
@@ -900,7 +904,7 @@ ugen20_tr_cancel_async(struct libusb20_t
temp.ep_index = xfer->trIndex;
- if (ioctl(xfer->pdev->file, USB_FS_STOP, &temp)) {
+ if (ioctl(xfer->pdev->file, IOUSB(USB_FS_STOP), &temp)) {
/* ignore any errors - should never happen */
}
return;
@@ -939,7 +943,7 @@ ugen20_dev_get_iface_desc(struct libusb2
ugd.ugd_maxlen = len;
ugd.ugd_iface_index = iface_index;
- if (ioctl(pdev->file, USB_GET_IFACE_DRIVER, &ugd)) {
+ if (ioctl(pdev->file, IOUSB(USB_GET_IFACE_DRIVER), &ugd)) {
return (LIBUSB20_ERROR_INVALID_PARAM);
}
return (0);
@@ -949,7 +953,7 @@ static int
ugen20_dev_get_info(struct libusb20_device *pdev,
struct usb_device_info *pinfo)
{
- if (ioctl(pdev->file, USB_GET_DEVICEINFO, pinfo)) {
+ if (ioctl(pdev->file, IOUSB(USB_GET_DEVICEINFO), pinfo)) {
return (LIBUSB20_ERROR_INVALID_PARAM);
}
return (0);
@@ -966,7 +970,7 @@ ugen20_root_get_dev_quirk(struct libusb2
q.index = quirk_index;
- error = ugen20_be_ioctl(USB_DEV_QUIRK_GET, &q);
+ error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_GET), &q);
if (error) {
if (errno == EINVAL) {
@@ -993,7 +997,7 @@ ugen20_root_get_quirk_name(struct libusb
q.index = quirk_index;
- error = ugen20_be_ioctl(USB_QUIRK_NAME_GET, &q);
+ error = ugen20_be_ioctl(IOUSB(USB_QUIRK_NAME_GET), &q);
if (error) {
if (errno == EINVAL) {
@@ -1020,7 +1024,7 @@ ugen20_root_add_dev_quirk(struct libusb2
q.bcdDeviceHigh = pq->bcdDeviceHigh;
strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname));
- error = ugen20_be_ioctl(USB_DEV_QUIRK_ADD, &q);
+ error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_ADD), &q);
if (error) {
if (errno == ENOMEM) {
return (LIBUSB20_ERROR_NO_MEM);
@@ -1044,7 +1048,7 @@ ugen20_root_remove_dev_quirk(struct libu
q.bcdDeviceHigh = pq->bcdDeviceHigh;
strlcpy(q.quirkname, pq->quirkname, sizeof(q.quirkname));
- error = ugen20_be_ioctl(USB_DEV_QUIRK_REMOVE, &q);
+ error = ugen20_be_ioctl(IOUSB(USB_DEV_QUIRK_REMOVE), &q);
if (error) {
if (errno == EINVAL) {
return (LIBUSB20_ERROR_NOT_FOUND);
@@ -1056,11 +1060,11 @@ ugen20_root_remove_dev_quirk(struct libu
static int
ugen20_root_set_template(struct libusb20_backend *pbe, int temp)
{
- return (ugen20_be_ioctl(USB_SET_TEMPLATE, &temp));
+ return (ugen20_be_ioctl(IOUSB(USB_SET_TEMPLATE), &temp));
}
static int
ugen20_root_get_template(struct libusb20_backend *pbe, int *ptemp)
{
- return (ugen20_be_ioctl(USB_GET_TEMPLATE, ptemp));
+ return (ugen20_be_ioctl(IOUSB(USB_GET_TEMPLATE), ptemp));
}
Modified: user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h
==============================================================================
--- user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/lib/libusb/libusb_global_linux.h Wed Jul 17 17:40:36 2013 (r253432)
@@ -29,7 +29,9 @@
#define _XOPEN_SOURCE
#define _BSD_SOURCE
+#ifdef __linux__
#define _POSIX_SOURCE
+#endif
#define _POSIX_C_SOURCE 200809
#include <ctype.h>
@@ -39,10 +41,13 @@
#include <stdint.h>
#include <time.h>
#include <unistd.h>
+#ifdef __linux__
#include <alloca.h>
+#endif
#include <string.h>
#include <fcntl.h>
#include <limits.h>
+#include <setjmp.h>
#include <pthread.h>
#include <sys/queue.h>
#include <sys/ioctl.h>
@@ -51,6 +56,10 @@
#include <dev/usb/usb_endian.h>
#include <dev/usb/usb_freebsd.h>
+#include <compat/linux/linux_ioctl.h>
+
+#define IOUSB(a) FBSD_L##a
+
#ifndef __aligned
#define __aligned(x) __attribute__((__aligned__(x)))
#endif
Modified: user/attilio/vmobj-fullread/lib/msun/src/math.h
==============================================================================
--- user/attilio/vmobj-fullread/lib/msun/src/math.h Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/lib/msun/src/math.h Wed Jul 17 17:40:36 2013 (r253432)
@@ -83,22 +83,22 @@ extern const union __nan_un {
#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
__has_extension(c_generic_selections)
-#define __fp_type_select(x, f, d, ld) _Generic((x), \
- float: f(x), \
- double: d(x), \
- long double: ld(x))
+#define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \
+ float: f(x), \
+ double: d(x), \
+ long double: ld(x))
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
-#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \
- __builtin_types_compatible_p(__typeof(x), long double), ld(x), \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(__typeof(x), double), d(x), \
- __builtin_choose_expr( \
- __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
+#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \
+ __builtin_types_compatible_p(__typeof(x), long double), ld(x), \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p(__typeof(x), double), d(x), \
+ __builtin_choose_expr( \
+ __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
#else
-#define __fp_type_select(x, f, d, ld) \
- ((sizeof(x) == sizeof(float)) ? f(x) \
- : (sizeof(x) == sizeof(double)) ? d(x) \
- : ld(x))
+#define __fp_type_select(x, f, d, ld) \
+ ((sizeof(x) == sizeof(float)) ? f(x) \
+ : (sizeof(x) == sizeof(double)) ? d(x) \
+ : ld(x))
#endif
#define fpclassify(x) \
@@ -189,21 +189,21 @@ int __signbitf(float) __pure2;
int __signbitl(long double) __pure2;
static __inline int
-__inline_isnan(double __x)
+__inline_isnan(__const double __x)
{
return (__x != __x);
}
static __inline int
-__inline_isnanf(float __x)
+__inline_isnanf(__const float __x)
{
return (__x != __x);
}
static __inline int
-__inline_isnanl(long double __x)
+__inline_isnanl(__const long double __x)
{
return (__x != __x);
Modified: user/attilio/vmobj-fullread/sbin/mount/mount.8
==============================================================================
--- user/attilio/vmobj-fullread/sbin/mount/mount.8 Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/sbin/mount/mount.8 Wed Jul 17 17:40:36 2013 (r253432)
@@ -118,6 +118,9 @@ When used in conjunction with the
.Fl a
option, also mount those file systems which are marked as
.Dq Li late .
+.It Fl n
+For compatibility with some other implementations, this flag is
+currently a no-op.
.It Fl o
Options are specified with a
.Fl o
Modified: user/attilio/vmobj-fullread/sbin/mount/mount.c
==============================================================================
--- user/attilio/vmobj-fullread/sbin/mount/mount.c Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/sbin/mount/mount.c Wed Jul 17 17:40:36 2013 (r253432)
@@ -253,7 +253,7 @@ main(int argc, char *argv[])
options = NULL;
vfslist = NULL;
vfstype = "ufs";
- while ((ch = getopt(argc, argv, "adF:fLlo:prt:uvw")) != -1)
+ while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1)
switch (ch) {
case 'a':
all = 1;
@@ -274,6 +274,9 @@ main(int argc, char *argv[])
case 'l':
late = 1;
break;
+ case 'n':
+ /* For compatibility with the Linux version of mount. */
+ break;
case 'o':
if (*optarg) {
options = catopt(options, optarg);
Modified: user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c
==============================================================================
--- user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/sbin/nvmecontrol/firmware.c Wed Jul 17 17:40:36 2013 (r253432)
@@ -246,7 +246,7 @@ firmware(int argc, char *argv[])
"slot %d specified but controller only supports %d slots",
slot, cdata.frmw.num_slots);
- if (!slot_has_valid_firmware(fd, slot))
+ if (a_flag && !f_flag && !slot_has_valid_firmware(fd, slot))
errx(1,
"slot %d does not contain valid firmware,\n"
"try 'nvmecontrol logpage -p 3 %s' to get a list "
Modified: user/attilio/vmobj-fullread/sbin/route/Makefile
==============================================================================
--- user/attilio/vmobj-fullread/sbin/route/Makefile Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/sbin/route/Makefile Wed Jul 17 17:40:36 2013 (r253432)
@@ -7,24 +7,21 @@ PROG= route
MAN= route.8
SRCS= route.c keywords.h
WARNS?= 3
-CLEANFILES+=keywords.h _keywords.tmp
+CLEANFILES+=keywords.h
CFLAGS+= -DNS
-
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
.if ${MK_INET6_SUPPORT} != "no"
CFLAGS+= -DINET6
.endif
-
CFLAGS+= -I.
keywords.h: keywords
- sed -e '/^#/d' -e '/^$$/d' ${.CURDIR}/keywords > _keywords.tmp
- LC_ALL=C tr 'a-z' 'A-Z' < _keywords.tmp | paste _keywords.tmp - | \
- awk '{ \
- if (NF > 1) \
- printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \
- $$2, NR, $$1, $$2 }' \
- > ${.TARGET}
- rm -f _keywords.tmp
+ LC_ALL=C awk '!/^#|^$$/ { \
+ printf "#define\tK_%s\t%d\n\t{\"%s\", K_%s},\n", \
+ toupper($$1), ++L, $$1, toupper($$1); \
+ }' < ${.CURDIR}/keywords > ${.TARGET} || (rm -f ${.TARGET}; false)
.include <bsd.prog.mk>
Modified: user/attilio/vmobj-fullread/sbin/route/route.c
==============================================================================
--- user/attilio/vmobj-fullread/sbin/route/route.c Wed Jul 17 17:35:46 2013 (r253431)
+++ user/attilio/vmobj-fullread/sbin/route/route.c Wed Jul 17 17:40:36 2013 (r253432)
@@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include <ifaddrs.h>
-struct keytab {
+static struct keytab {
const char *kt_cp;
int kt_i;
} keywords[] = {
@@ -78,42 +78,33 @@ struct keytab {
{0, 0}
};
-union sockunion {
- struct sockaddr sa;
- struct sockaddr_in sin;
-#ifdef INET6
- struct sockaddr_in6 sin6;
-#endif
- struct sockaddr_at sat;
- struct sockaddr_dl sdl;
- struct sockaddr_storage ss; /* added to avoid memory overrun */
-} so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp;
-
-typedef union sockunion *sup;
-int pid, rtm_addrs;
-int s;
-int forcehost, forcenet, doflush, nflag, af, qflag, tflag;
-int verbose, aflen = sizeof (struct sockaddr_in);
-int locking, lockrest, debugonly;
-struct rt_metrics rt_metrics;
-u_long rtm_inits;
-uid_t uid;
+static struct sockaddr_storage so[RTAX_MAX];
+static int pid, rtm_addrs;
+static int s;
+static int forcehost, forcenet, nflag, af, qflag, tflag;
+static int verbose, aflen;
+static int locking, lockrest, debugonly;
+static struct rt_metrics rt_metrics;
+static u_long rtm_inits;
+static uid_t uid;
static int defaultfib;
static int numfibs;
static int atalk_aton(const char *, struct at_addr *);
static char *atalk_ntoa(struct at_addr);
-static void bprintf(FILE *, int, u_char *);
+static void printb(int, const char *);
static void flushroutes(int argc, char *argv[]);
static int flushroutes_fib(int);
static int getaddr(int, char *, struct hostent **, int);
static int keyword(const char *);
-static void inet_makenetandmask(u_long, struct sockaddr_in *, u_long);
+#ifdef INET
+static void inet_makenetandmask(u_long, struct sockaddr_in *,
+ struct sockaddr_in *, u_long);
+#endif
#ifdef INET6
-static int inet6_makenetandmask(struct sockaddr_in6 *, const char *);
+static int inet6_makenetandmask(struct sockaddr_in6 *, const char *);
#endif
static void interfaces(void);
-static void mask_addr(void);
static void monitor(int, char*[]);
static const char *netname(struct sockaddr *);
static void newroute(int, char **);
@@ -127,9 +118,8 @@ static const char *routename(struct sock
static int rtmsg(int, int, int);
static void set_metric(char *, int);
static int set_sofib(int);
-static int set_procfib(int);
-static void sockaddr(char *, struct sockaddr *);
-static void sodump(sup, const char *);
+static void sockaddr(char *, struct sockaddr *, size_t);
+static void sodump(struct sockaddr *, const char *);
extern char *iso_ntoa(void);
struct fibl {
@@ -139,7 +129,7 @@ struct fibl {
int fl_error;
int fl_errno;
};
-TAILQ_HEAD(fibl_head_t, fibl) fibl_head;
+static TAILQ_HEAD(fibl_head_t, fibl) fibl_head;
static int fiboptlist_csv(const char *, struct fibl_head_t *);
static int fiboptlist_range(const char *, struct fibl_head_t *);
@@ -151,9 +141,7 @@ usage(const char *cp)
{
if (cp != NULL)
warnx("bad keyword: %s", cp);
- (void) fprintf(stderr,
- "usage: route [-dnqtv] command [[modifiers] args]\n");
- exit(EX_USAGE);
+ errx(EX_USAGE, "usage: route [-dnqtv] command [[modifiers] args]");
/* NOTREACHED */
}
@@ -247,15 +235,6 @@ set_sofib(int fib)
}
static int
-set_procfib(int fib)
-{
-
- if (fib < 0)
- return (0);
- return (setfib(fib));
-}
-
-static int
fiboptlist_range(const char *arg, struct fibl_head_t *flh)
{
struct fibl *fl;
@@ -313,6 +292,7 @@ fiboptlist_csv(const char *arg, struct f
char *str0, *str, *token, *endptr;
int fib, error;
+ str0 = str = NULL;
if (strcmp("all", arg) == 0) {
str = calloc(1, ALLSTRLEN);
if (str == NULL) {
@@ -362,7 +342,8 @@ fiboptlist_csv(const char *arg, struct f
}
}
fiboptlist_csv_ret:
- free(str0);
+ if (str0 != NULL)
+ free(str0);
return (error);
}
@@ -376,9 +357,8 @@ flushroutes(int argc, char *argv[])
struct fibl *fl;
int error;
- if (uid != 0 && !debugonly && !tflag) {
+ if (uid != 0 && !debugonly && !tflag)
errx(EX_NOPERM, "must be root to alter routing table");
- }
shutdown(s, SHUT_RD); /* Don't want to read back our messages */
TAILQ_INIT(&fibl_head);
@@ -388,9 +368,11 @@ flushroutes(int argc, char *argv[])
if (**argv != '-')
usage(*argv);
switch (keyword(*argv + 1)) {
+#ifdef INET
case K_INET:
af = AF_INET;
break;
+#endif
#ifdef INET6
case K_INET6:
af = AF_INET6;
@@ -428,11 +410,10 @@ flushroutes_fib(int fib)
struct rt_msghdr *rtm;
size_t needed;
char *buf, *next, *lim;
- int mib[6], rlen, seqno, count = 0;
+ int mib[7], rlen, seqno, count = 0;
int error;
error = set_sofib(fib);
- error += set_procfib(fib);
if (error) {
warn("fib number %d is ignored", fib);
return (error);
@@ -442,14 +423,15 @@ retry:
mib[0] = CTL_NET;
mib[1] = PF_ROUTE;
mib[2] = 0; /* protocol */
- mib[3] = 0; /* wildcard address family */
+ mib[3] = AF_UNSPEC;
mib[4] = NET_RT_DUMP;
mib[5] = 0; /* no flags */
- if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
+ mib[6] = fib;
+ if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0)
err(EX_OSERR, "route-sysctl-estimate");
if ((buf = malloc(needed)) == NULL)
errx(EX_OSERR, "malloc failed");
- if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
+ if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) {
if (errno == ENOMEM && count++ < 10) {
warnx("Routing table grew, retrying");
sleep(1);
@@ -460,7 +442,7 @@ retry:
}
lim = buf + needed;
if (verbose)
- (void) printf("Examining routing table from sysctl\n");
+ (void)printf("Examining routing table from sysctl\n");
seqno = 0; /* ??? */
for (next = buf; next < lim; next += rtm->rtm_msglen) {
rtm = (struct rt_msghdr *)next;
@@ -483,7 +465,7 @@ retry:
err(1, "write to routing socket");
if (rlen < (int)rtm->rtm_msglen) {
warn("write to routing socket");
- (void) printf("got only %d for rlen\n", rlen);
+ (void)printf("got only %d for rlen\n", rlen);
free(buf);
goto retry;
break;
@@ -513,7 +495,9 @@ routename(struct sockaddr *sa)
{
const char *cp;
static char line[MAXHOSTNAMELEN + 1];
+#ifdef INET
struct hostent *hp;
+#endif
static char domain[MAXHOSTNAMELEN + 1];
static int first = 1, n;
@@ -522,19 +506,22 @@ routename(struct sockaddr *sa)
if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
(cp = strchr(domain, '.'))) {
domain[MAXHOSTNAMELEN] = '\0';
- (void) strcpy(domain, cp + 1);
+ (void)strcpy(domain, cp + 1);
} else
- domain[0] = 0;
+ domain[0] = '\0';
}
- if (sa->sa_len == 0)
+ if (sa->sa_len == 0) {
strcpy(line, "default");
- else switch (sa->sa_family) {
-
+ return (line);
+ }
+ switch (sa->sa_family) {
+#ifdef INET
case AF_INET:
- { struct in_addr in;
- in = ((struct sockaddr_in *)sa)->sin_addr;
+ {
+ struct in_addr in;
+ in = ((struct sockaddr_in *)sa)->sin_addr;
cp = NULL;
if (in.s_addr == INADDR_ANY || sa->sa_len < 4)
cp = "default";
@@ -554,10 +541,11 @@ routename(struct sockaddr *sa)
strncpy(line, cp, sizeof(line) - 1);
line[sizeof(line) - 1] = '\0';
} else
- (void) sprintf(line, "%s", inet_ntoa(in));
+ (void)sprintf(line, "%s", inet_ntoa(in));
break;
- }
+ }
+#endif
#ifdef INET6
case AF_INET6:
{
@@ -574,17 +562,18 @@ routename(struct sockaddr *sa)
line, sizeof(line), NULL, 0, niflags) != 0)
strncpy(line, "invalid", sizeof(line));
- return(line);
+ return (line);
}
#endif
case AF_APPLETALK:
- (void) snprintf(line, sizeof(line), "atalk %s",
- atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr));
+ (void)snprintf(line, sizeof(line), "atalk %s",
+ atalk_ntoa(((struct sockaddr_at *)sa)->sat_addr));
break;
case AF_LINK:
return (link_ntoa((struct sockaddr_dl *)sa));
+ break;
default:
{
@@ -611,18 +600,21 @@ routename(struct sockaddr *sa)
const char *
netname(struct sockaddr *sa)
{
- const char *cp = NULL;
static char line[MAXHOSTNAMELEN + 1];
+ int n;
+#ifdef INET
struct netent *np = NULL;
+ const char *cp = NULL;
u_long i;
- int n;
+#endif
switch (sa->sa_family) {
-
+#ifdef INET
case AF_INET:
- { struct in_addr in;
- in = ((struct sockaddr_in *)sa)->sin_addr;
+ {
+ struct in_addr in;
+ in = ((struct sockaddr_in *)sa)->sin_addr;
i = in.s_addr = ntohl(in.s_addr);
if (in.s_addr == 0)
cp = "default";
@@ -635,30 +627,30 @@ netname(struct sockaddr *sa)
if (cp != NULL)
strncpy(line, cp, sizeof(line));
else if ((in.s_addr & 0xffffff) == 0)
- (void) sprintf(line, "%u", C(in.s_addr >> 24));
+ (void)sprintf(line, "%u", C(in.s_addr >> 24));
else if ((in.s_addr & 0xffff) == 0)
- (void) sprintf(line, "%u.%u", C(in.s_addr >> 24),
+ (void)sprintf(line, "%u.%u", C(in.s_addr >> 24),
C(in.s_addr >> 16));
else if ((in.s_addr & 0xff) == 0)
- (void) sprintf(line, "%u.%u.%u", C(in.s_addr >> 24),
+ (void)sprintf(line, "%u.%u.%u", C(in.s_addr >> 24),
C(in.s_addr >> 16), C(in.s_addr >> 8));
else
- (void) sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24),
+ (void)sprintf(line, "%u.%u.%u.%u", C(in.s_addr >> 24),
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list