Browse Source

Merge branch 'freebsd/current/master' into hardened/current/master

* freebsd/current/master:
  Retire the -DRELEASE_CRUNCH define.
  usr.sbin/bhyve: unconditionally initialize the NVMe completion status
  Retire support for -DMINIMALISTIC
  usr.sbin/bhyve: free resources when erroring out of pci_vtnet_init()
  There is no SMALLER define anymore here
  Remove unused defines since r147075
  Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c. The reason for this is that ipftest(8), which still works on FreeBSD-11, fails to link to it, breaking stable/11 builds.
  Allow efi loader to get network params from uboot
hardened/current/uninit-autoinit
Oliver Pinter + 10 months ago
parent
commit
81ab35afff
14 changed files with 139 additions and 126 deletions
  1. +0
    -1
      rescue/rescue/Makefile
  2. +0
    -4
      sbin/camcontrol/Makefile
  3. +0
    -44
      sbin/camcontrol/camcontrol.c
  4. +73
    -0
      stand/efi/libefi/efinet.c
  5. +1
    -0
      stand/libsa/net.h
  6. +55
    -0
      sys/contrib/ipfilter/netinet/fil.c
  7. +0
    -4
      sys/contrib/ipfilter/netinet/ip_fil.h
  8. +0
    -53
      sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  9. +0
    -5
      usr.bin/cpio/Makefile
  10. +1
    -0
      usr.sbin/bhyve/pci_nvme.c
  11. +7
    -2
      usr.sbin/bhyve/pci_virtio_net.c
  12. +0
    -1
      usr.sbin/ppp/Makefile
  13. +1
    -4
      usr.sbin/ppp/bundle.c
  14. +1
    -8
      usr.sbin/ppp/physical.c

+ 0
- 1
rescue/rescue/Makefile View File

@@ -172,7 +172,6 @@ CRUNCH_ALIAS_shutdown= poweroff

# dhclient has historically been troublesome...
CRUNCH_PROGS_sbin+= dhclient
CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint

##################################################################
# Programs from stock /usr/bin

+ 0
- 4
sbin/camcontrol/Makefile View File

@@ -5,11 +5,7 @@
PACKAGE=runtime
PROG= camcontrol
SRCS= camcontrol.c util.c
.if !defined(RELEASE_CRUNCH)
SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c
.else
CFLAGS+= -DMINIMALISTIC
.endif
.if ${MK_NVME} != "no"
.PATH: ${SRCTOP}/sbin/nvmecontrol
CFLAGS+= -I${SRCTOP}/sbin/nvmecontrol -DWITH_NVME

+ 0
- 44
sbin/camcontrol/camcontrol.c View File

@@ -46,10 +46,8 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <err.h>
#include <libutil.h>
#ifndef MINIMALISTIC
#include <limits.h>
#include <inttypes.h>
#endif

#include <cam/cam.h>
#include <cam/cam_debug.h>
@@ -153,7 +151,6 @@ struct camcontrol_opts {
const char *subopt;
};

#ifndef MINIMALISTIC
struct ata_res_pass16 {
u_int16_t reserved[5];
u_int8_t flags;
@@ -192,10 +189,8 @@ static const char smprg_opts[] = "l";
static const char smppc_opts[] = "a:A:d:lm:M:o:p:s:S:T:";
static const char smpphylist_opts[] = "lq";
static char pwd_opt;
#endif

static struct camcontrol_opts option_table[] = {
#ifndef MINIMALISTIC
{"tur", CAM_CMD_TUR, CAM_ARG_NONE, NULL},
{"inquiry", CAM_CMD_INQUIRY, CAM_ARG_NONE, "DSR"},
{"identify", CAM_CMD_IDENTIFY, CAM_ARG_NONE, NULL},
@@ -206,10 +201,8 @@ static struct camcontrol_opts option_table[] = {
{"reportluns", CAM_CMD_REPORTLUNS, CAM_ARG_NONE, "clr:"},
{"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHlNqs"},
{"reprobe", CAM_CMD_REPROBE, CAM_ARG_NONE, NULL},
#endif /* MINIMALISTIC */
{"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL},
{"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL},
#ifndef MINIMALISTIC
{"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts},
{"mmcsdcmd", CAM_CMD_MMCSD_CMD, CAM_ARG_NONE, "c:a:f:Wb:l:41S:I"},
{"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts},
@@ -223,9 +216,7 @@ static struct camcontrol_opts option_table[] = {
{"smpmaninfo", CAM_CMD_SMP_MANINFO, CAM_ARG_NONE, "l"},
{"defects", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts},
{"defectlist", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts},
#endif /* MINIMALISTIC */
{"devlist", CAM_CMD_DEVTREE, CAM_ARG_NONE, "-b"},
#ifndef MINIMALISTIC
{"periphlist", CAM_CMD_DEVLIST, CAM_ARG_NONE, NULL},
{"modepage", CAM_CMD_MODE_PAGE, CAM_ARG_NONE, "bdelm:P:"},
{"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"},
@@ -249,7 +240,6 @@ static struct camcontrol_opts option_table[] = {
{"zone", CAM_CMD_ZONE, CAM_ARG_NONE, "ac:l:No:P:"},
{"epc", CAM_CMD_EPC, CAM_ARG_NONE, "c:dDeHp:Pr:sS:T:"},
{"timestamp", CAM_CMD_TIMESTAMP, CAM_ARG_NONE, "f:mrsUT:"},
#endif /* MINIMALISTIC */
{"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
{"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
{"-h", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
@@ -276,9 +266,7 @@ static cam_argmask arglist;
camcontrol_optret getoption(struct camcontrol_opts *table, char *arg,
uint32_t *cmdnum, cam_argmask *argnum,
const char **subopt);
#ifndef MINIMALISTIC
static int getdevlist(struct cam_device *device);
#endif /* MINIMALISTIC */
static int getdevtree(int argc, char **argv, char *combinedopt);
static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr);
static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr);
@@ -288,7 +276,6 @@ static int print_dev_mmcsd(struct device_match_result *dev_result,
#ifdef WITH_NVME
static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr);
#endif
#ifndef MINIMALISTIC
static int testunitready(struct cam_device *device, int task_attr,
int retry_count, int timeout, int quiet);
static int scsistart(struct cam_device *device, int startstop, int loadeject,
@@ -297,14 +284,12 @@ static int scsiinquiry(struct cam_device *device, int task_attr,
int retry_count, int timeout);
static int scsiserial(struct cam_device *device, int task_attr,
int retry_count, int timeout);
#endif /* MINIMALISTIC */
static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target,
lun_id_t *lun, cam_argmask *arglst);
static int dorescan_or_reset(int argc, char **argv, int rescan);
static int rescan_or_reset_bus(path_id_t bus, int rescan);
static int scanlun_or_reset_dev(path_id_t bus, target_id_t target,
lun_id_t lun, int scan);
#ifndef MINIMALISTIC
static int readdefects(struct cam_device *device, int argc, char **argv,
char *combinedopt, int task_attr, int retry_count,
int timeout);
@@ -371,7 +356,6 @@ static int scsiopcodes(struct cam_device *device, int argc, char **argv,
int timeout, int verbose);
static int scsireprobe(struct cam_device *device);

#endif /* MINIMALISTIC */
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
@@ -403,7 +387,6 @@ getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum,
return (CC_OR_NOT_FOUND);
}

#ifndef MINIMALISTIC
static int
getdevlist(struct cam_device *device)
{
@@ -462,7 +445,6 @@ getdevlist(struct cam_device *device)

return (error);
}
#endif /* MINIMALISTIC */

static int
getdevtree(int argc, char **argv, char *combinedopt)
@@ -835,7 +817,6 @@ print_dev_nvme(struct device_match_result *dev_result, char *tmpstr)
}
#endif

#ifndef MINIMALISTIC
static int
testunitready(struct cam_device *device, int task_attr, int retry_count,
int timeout, int quiet)
@@ -2424,10 +2405,8 @@ identify(struct cam_device *device, int retry_count, int timeout)
#endif
return (ataidentify(device, retry_count, timeout));
}
#endif /* MINIMALISTIC */


#ifndef MINIMALISTIC
enum {
ATA_SECURITY_ACTION_PRINT,
ATA_SECURITY_ACTION_FREEZE,
@@ -3260,7 +3239,6 @@ atasecurity(struct cam_device *device, int retry_count, int timeout,

return (error);
}
#endif /* MINIMALISTIC */

/*
* Parse out a bus, or a bus, target and lun in the following
@@ -3708,7 +3686,6 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target, lun_id_t lun, int scan)
}
}

#ifndef MINIMALISTIC

static struct scsi_nv defect_list_type_map[] = {
{ "block", SRDD10_BLOCK_FORMAT },
@@ -4284,7 +4261,6 @@ defect_bailout:

return (error);
}
#endif /* MINIMALISTIC */

#if 0
void
@@ -4298,7 +4274,6 @@ reassignblocks(struct cam_device *device, u_int32_t *blocks, int num_blocks)
}
#endif

#ifndef MINIMALISTIC
void
mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage,
int task_attr, int retry_count, int timeout, u_int8_t *data,
@@ -9522,7 +9497,6 @@ bailout:
return (retval);
}

#endif /* MINIMALISTIC */

static int
scsireprobe(struct cam_device *device)
@@ -9566,7 +9540,6 @@ usage(int printlong)
fprintf(printlong ? stdout : stderr,
"usage: camcontrol <command> [device id][generic args][command args]\n"
" camcontrol devlist [-b] [-v]\n"
#ifndef MINIMALISTIC
" camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n"
" camcontrol tur [dev_id][generic args]\n"
" camcontrol inquiry [dev_id][generic args] [-D] [-S] [-R]\n"
@@ -9579,10 +9552,8 @@ usage(int printlong)
" camcontrol load [dev_id][generic args]\n"
" camcontrol eject [dev_id][generic args]\n"
" camcontrol reprobe [dev_id][generic args]\n"
#endif /* MINIMALISTIC */
" camcontrol rescan <all | bus[:target:lun] | dev_id>\n"
" camcontrol reset <all | bus[:target:lun] | dev_id>\n"
#ifndef MINIMALISTIC
" camcontrol defects [dev_id][generic args] <-f format> [-P][-G]\n"
" [-q][-s][-S offset][-X]\n"
" camcontrol modepage [dev_id][generic args] <-m page | -l>\n"
@@ -9642,11 +9613,9 @@ usage(int printlong)
" camcontrol timestamp [dev_id][generic_args] <-r [-f format|-m|-U]>|\n"
" <-s <-f format -T time | -U >>\n"
" \n"
#endif /* MINIMALISTIC */
" camcontrol help\n");
if (!printlong)
return;
#ifndef MINIMALISTIC
fprintf(stdout,
"Specify one of the following options:\n"
"devlist list all CAM devices\n"
@@ -9892,7 +9861,6 @@ usage(int printlong)
"-T time the time value passed into strptime(3)\n"
"-U set the timestamp of the device to UTC time\n"
);
#endif /* MINIMALISTIC */
}

int
@@ -9911,11 +9879,9 @@ main(int argc, char **argv)
int error = 0, optstart = 2;
int task_attr = MSG_SIMPLE_Q_TAG;
int devopen = 1;
#ifndef MINIMALISTIC
path_id_t bus;
target_id_t target;
lun_id_t lun;
#endif /* MINIMALISTIC */

cmdlist = CAM_CMD_NONE;
arglist = CAM_ARG_NONE;
@@ -10003,7 +9969,6 @@ main(int argc, char **argv)
|| (cmdlist == CAM_CMD_DEBUG))
devopen = 0;

#ifndef MINIMALISTIC
if ((devopen == 1)
&& (argc > 2 && argv[2][0] != '-')) {
char name[30];
@@ -10031,7 +9996,6 @@ main(int argc, char **argv)
optstart++;
}
}
#endif /* MINIMALISTIC */
/*
* Start getopt processing at argv[2/3], since we've already
* accepted argv[1..2] as the command name, and as a possible
@@ -10117,7 +10081,6 @@ main(int argc, char **argv)
}
}

#ifndef MINIMALISTIC
/*
* For most commands we'll want to open the passthrough device
* associated with the specified device. In the case of the rescan
@@ -10138,7 +10101,6 @@ main(int argc, char **argv)
== NULL)
errx(1,"%s", cam_errbuf);
}
#endif /* MINIMALISTIC */

/*
* Reset optind to 2, and reset getopt, so these routines can parse
@@ -10148,7 +10110,6 @@ main(int argc, char **argv)
optreset = 1;

switch(cmdlist) {
#ifndef MINIMALISTIC
case CAM_CMD_DEVLIST:
error = getdevlist(cam_dev);
break;
@@ -10156,11 +10117,9 @@ main(int argc, char **argv)
error = atahpa(cam_dev, retry_count, timeout,
argc, argv, combinedopt);
break;
#endif /* MINIMALISTIC */
case CAM_CMD_DEVTREE:
error = getdevtree(argc, argv, combinedopt);
break;
#ifndef MINIMALISTIC
case CAM_CMD_TUR:
error = testunitready(cam_dev, task_attr, retry_count,
timeout, 0);
@@ -10177,14 +10136,12 @@ main(int argc, char **argv)
arglist & CAM_ARG_EJECT, task_attr,
retry_count, timeout);
break;
#endif /* MINIMALISTIC */
case CAM_CMD_RESCAN:
error = dorescan_or_reset(argc, argv, 1);
break;
case CAM_CMD_RESET:
error = dorescan_or_reset(argc, argv, 0);
break;
#ifndef MINIMALISTIC
case CAM_CMD_READ_DEFECTS:
error = readdefects(cam_dev, argc, argv, combinedopt,
task_attr, retry_count, timeout);
@@ -10307,7 +10264,6 @@ main(int argc, char **argv)
task_attr, retry_count, timeout,
arglist & CAM_ARG_VERBOSE);
break;
#endif /* MINIMALISTIC */
case CAM_CMD_USAGE:
usage(1);
break;

+ 73
- 0
stand/efi/libefi/efinet.c View File

@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
#include <efi.h>
#include <efilib.h>

#include "dev_net.h"

static EFI_GUID sn_guid = EFI_SIMPLE_NETWORK_PROTOCOL;

static void efinet_end(struct netif *);
@@ -198,6 +200,74 @@ efinet_get(struct iodesc *desc, void **pkt, time_t timeout)
return (ret);
}

/*
* Loader uses BOOTP/DHCP and also uses RARP as a fallback to populate
* network parameters and problems with DHCP servers can cause the loader
* to fail to populate them. Allow the device to ask about the basic
* network parameters and if present use them.
*/
static void
efi_env_net_params(struct iodesc *desc)
{
char *envstr;
in_addr_t ipaddr, mask, gwaddr, serveraddr;
n_long rootaddr;

if ((envstr = getenv("rootpath")) != NULL)
strlcpy(rootpath, envstr, sizeof(rootpath));

/*
* Get network parameters.
*/
envstr = getenv("ipaddr");
ipaddr = (envstr != NULL) ? inet_addr(envstr) : 0;

envstr = getenv("netmask");
mask = (envstr != NULL) ? inet_addr(envstr) : 0;

envstr = getenv("gatewayip");
gwaddr = (envstr != NULL) ? inet_addr(envstr) : 0;

envstr = getenv("serverip");
serveraddr = (envstr != NULL) ? inet_addr(envstr) : 0;

/* No network params. */
if (ipaddr == 0 && mask == 0 && gwaddr == 0 && serveraddr == 0)
return;

/* Partial network params. */
if (ipaddr == 0 || mask == 0 || gwaddr == 0 || serveraddr == 0) {
printf("Incomplete network settings from U-Boot\n");
return;
}

/*
* Set network parameters.
*/
myip.s_addr = ipaddr;
netmask = mask;
gateip.s_addr = gwaddr;
servip.s_addr = serveraddr;

/*
* There must be a rootpath. It may be ip:/path or it may be just the
* path in which case the ip needs to be serverip.
*/
rootaddr = net_parse_rootpath();
if (rootaddr == INADDR_NONE)
rootaddr = serveraddr;
rootip.s_addr = rootaddr;

#ifdef EFINET_DEBUG
printf("%s: ip=%s\n", __func__, inet_ntoa(myip));
printf("%s: mask=%s\n", __func__, intoa(netmask));
printf("%s: gateway=%s\n", __func__, inet_ntoa(gateip));
printf("%s: server=%s\n", __func__, inet_ntoa(servip));
#endif

desc->myip = myip;
}

static void
efinet_init(struct iodesc *desc, void *machdep_hint)
{
@@ -207,6 +277,9 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
EFI_STATUS status;
UINT32 mask;

/* Attempt to get netboot params from env */
efi_env_net_params(desc);

if (nif->nif_driver->netif_ifs[nif->nif_unit].dif_unit < 0) {
printf("Invalid network interface %d\n", nif->nif_unit);
return;

+ 1
- 0
stand/libsa/net.h View File

@@ -91,6 +91,7 @@ extern struct in_addr rootip;
extern struct in_addr swapip;
extern struct in_addr gateip;
extern struct in_addr nameip;
extern struct in_addr servip;
extern n_long netmask;
extern u_int intf_mtu;


+ 55
- 0
sys/contrib/ipfilter/netinet/fil.c View File

@@ -179,6 +179,10 @@ static int ipf_updateipid __P((fr_info_t *));
static int ipf_settimeout __P((struct ipf_main_softc_s *,
struct ipftuneable *,
ipftuneval_t *));
#ifdef USE_INET6
static u_int ipf_pcksum6 __P((fr_info_t *, ip6_t *,
u_int32_t, u_int32_t));
#endif
#if !defined(_KERNEL) || SOLARIS
static int ppsratecheck(struct timeval *, int *, int);
#endif
@@ -10226,4 +10230,55 @@ ipf_inet6_mask_del(bits, mask, mtab)
mtab->imt6_max--;
ASSERT(mtab->imt6_max >= 0);
}

#ifdef _KERNEL
static u_int
ipf_pcksum6(fin, ip6, off, len)
fr_info_t *fin;
ip6_t *ip6;
u_int32_t off;
u_int32_t len;
{
struct mbuf *m;
int sum;

m = fin->fin_m;
if (m->m_len < sizeof(struct ip6_hdr)) {
return 0xffff;
}

sum = in6_cksum(m, ip6->ip6_nxt, off, len);
return(sum);
}
#else
static u_int
ipf_pcksum6(fin, ip6, off, len)
fr_info_t *fin;
ip6_t *ip6;
u_int32_t off;
u_int32_t len;
{
u_short *sp;
u_int sum;

sp = (u_short *)&ip6->ip6_src;
sum = *sp++; /* ip6_src */
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++; /* ip6_dst */
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
return(ipf_pcksum(fin, off, sum));
}
#endif
#endif

+ 0
- 4
sys/contrib/ipfilter/netinet/ip_fil.h View File

@@ -1835,10 +1835,6 @@ extern int ipf_matchicmpqueryreply __P((int, icmpinfo_t *,
struct icmp *, int));
extern u_32_t ipf_newisn __P((fr_info_t *));
extern u_int ipf_pcksum __P((fr_info_t *, int, u_int));
#ifdef USE_INET6
extern u_int ipf_pcksum6 __P((fr_info_t *, ip6_t *,
u_int32_t, u_int32_t));
#endif
extern void ipf_rule_expire __P((ipf_main_softc_t *));
extern int ipf_scanlist __P((fr_info_t *, u_32_t));
extern frentry_t *ipf_srcgrpmap __P((fr_info_t *, u_32_t *));

+ 0
- 53
sys/contrib/ipfilter/netinet/ip_fil_freebsd.c View File

@@ -1446,56 +1446,3 @@ ipf_pcksum(fin, hlen, sum)
sum2 = ~sum & 0xffff;
return sum2;
}

#ifdef USE_INET6
#ifdef _KERNEL
u_int
ipf_pcksum6(fin, ip6, off, len)
fr_info_t *fin;
ip6_t *ip6;
u_int32_t off;
u_int32_t len;
{
struct mbuf *m;
int sum;

m = fin->fin_m;
if (m->m_len < sizeof(struct ip6_hdr)) {
return 0xffff;
}

sum = in6_cksum(m, ip6->ip6_nxt, off, len);
return(sum);
}
#else
u_int
ipf_pcksum6(fin, ip6, off, len)
fr_info_t *fin;
ip6_t *ip6;
u_int32_t off;
u_int32_t len;
{
u_short *sp;
u_int sum;

sp = (u_short *)&ip6->ip6_src;
sum = *sp++; /* ip6_src */
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++; /* ip6_dst */
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
sum += *sp++;
return(ipf_pcksum(fin, off, sum));
}
#endif
#endif

+ 0
- 5
usr.bin/cpio/Makefile View File

@@ -18,11 +18,6 @@ CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
CFLAGS+= -DPLATFORM_CONFIG_H=\"${_LIBARCHIVECONFDIR}/config_freebsd.h\"
CFLAGS+= -I${_LIBARCHIVEDIR}/cpio -I${_LIBARCHIVEDIR}/libarchive_fe

.ifdef RELEASE_CRUNCH
# FreeBSD's installer uses cpio in crunched binaries that are
# statically linked, cannot use -lcrypto, and are size sensitive.
CFLAGS+= -DSMALLER
.endif
LIBADD= archive

.if ${MK_ICONV} != "no"

+ 1
- 0
usr.sbin/bhyve/pci_nvme.c View File

@@ -978,6 +978,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, uint64_t value)
while (sqhead != atomic_load_acq_short(&sq->tail)) {
cmd = &(sq->qbase)[sqhead];
compl.cdw0 = 0;
compl.status = 0;

switch (cmd->opc) {

+ 7
- 2
usr.sbin/bhyve/pci_virtio_net.c View File

@@ -411,6 +411,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
err = net_parsemac(vtopts, sc->vsc_config.mac);
if (err != 0) {
free(devname);
free(sc);
return (err);
}
mac_provided = 1;
@@ -419,8 +420,10 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
err = netbe_init(&sc->vsc_be, devname, pci_vtnet_rx_callback,
sc);
free(devname);
if (err)
if (err) {
free(sc);
return (err);
}
sc->vsc_consts.vc_hv_caps |= netbe_get_cap(sc->vsc_be);
}

@@ -442,8 +445,10 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
sc->vsc_vs.vs_mtx = &sc->vsc_mtx;

/* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */
if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix()))
if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) {
free(sc);
return (1);
}

/* use BAR 0 to map config regs in IO space */
vi_set_io_bar(&sc->vsc_vs, 0);

+ 0
- 1
usr.sbin/ppp/Makefile View File

@@ -12,7 +12,6 @@ SRCS= acf.c arp.c async.c auth.c bundle.c cbcp.c ccp.c chap.c chat.c \
tcpmss.c throughput.c timer.c tty.c tun.c udp.c vjcomp.c
WARNS?= 3
.if defined(RELEASE_CRUNCH)
CFLAGS+=-DRELEASE_CRUNCH
PPP_NO_DES=
PPP_NO_KLDLOAD=
PPP_NO_NAT=

+ 1
- 4
usr.sbin/ppp/bundle.c View File

@@ -678,12 +678,9 @@ bundle_LockTun(struct bundle *bundle)
if (lockfile != NULL) {
fprintf(lockfile, "%d\n", (int)getpid());
fclose(lockfile);
}
#ifndef RELEASE_CRUNCH
else
} else
log_Printf(LogERROR, "Warning: Can't create %s: %s\n",
pidfile, strerror(errno));
#endif
}

static void

+ 1
- 8
usr.sbin/ppp/physical.c View File

@@ -364,13 +364,9 @@ physical_Close(struct physical *p)

if (*p->name.full == '/') {
snprintf(fn, sizeof fn, "%s%s.if", _PATH_VARRUN, p->name.base);
#ifndef RELEASE_CRUNCH
if (ID0unlink(fn) == -1)
log_Printf(LogALERT, "%s: Can't remove %s: %s\n",
p->link.name, fn, strerror(errno));
#else
ID0unlink(fn);
#endif
}
physical_Unlock(p);
if (p->handler && p->handler->destroy)
@@ -978,12 +974,9 @@ physical_Found(struct physical *p)
if (lockfile != NULL) {
fprintf(lockfile, "%s%d\n", TUN_NAME, p->dl->bundle->unit);
fclose(lockfile);
}
#ifndef RELEASE_CRUNCH
else
} else
log_Printf(LogALERT, "%s: Can't create %s: %s\n",
p->link.name, fn, strerror(errno));
#endif
}

throughput_start(&p->link.stats.total, "physical throughput",

Loading…
Cancel
Save