mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 07:15:58 +08:00
Update to FreeBSD head 2018-06-01
Git mirror commit fb63610a69b0eb7f69a201ba05c4c1a7a2739cf9. Update #3472.
This commit is contained in:
@@ -202,7 +202,7 @@ static void
|
||||
clone_Copt_cb(const char *optarg __unused)
|
||||
{
|
||||
list_cloners();
|
||||
exit(0);
|
||||
exit(exit_code);
|
||||
}
|
||||
static struct option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone_Copt_cb };
|
||||
|
||||
|
@@ -117,6 +117,7 @@ int printifname = 0;
|
||||
|
||||
int supmedia = 0;
|
||||
int printkeys = 0; /* Print keying material for interfaces. */
|
||||
int exit_code = 0;
|
||||
|
||||
/* Formatter Strings */
|
||||
char *f_inet, *f_inet6, *f_ether, *f_addr;
|
||||
@@ -566,7 +567,7 @@ main(int argc, char *argv[])
|
||||
errx(1, "%s: cloning name too long",
|
||||
ifname);
|
||||
ifconfig(argc, argv, 1, NULL);
|
||||
exit(0);
|
||||
exit(exit_code);
|
||||
}
|
||||
#ifdef JAIL
|
||||
/*
|
||||
@@ -580,7 +581,7 @@ main(int argc, char *argv[])
|
||||
errx(1, "%s: interface name too long",
|
||||
ifname);
|
||||
ifconfig(argc, argv, 0, NULL);
|
||||
exit(0);
|
||||
exit(exit_code);
|
||||
}
|
||||
#endif
|
||||
errx(1, "interface %s does not exist", ifname);
|
||||
@@ -678,7 +679,7 @@ main(int argc, char *argv[])
|
||||
freeifaddrs(ifap);
|
||||
|
||||
freeformat();
|
||||
exit(0);
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
static struct afswtch *afs = NULL;
|
||||
@@ -1573,8 +1574,8 @@ static struct cmd basic_cmds[] = {
|
||||
DEF_CMD("-wol_magic", -IFCAP_WOL_MAGIC, setifcap),
|
||||
DEF_CMD("txrtlmt", IFCAP_TXRTLMT, setifcap),
|
||||
DEF_CMD("-txrtlmt", -IFCAP_TXRTLMT, setifcap),
|
||||
DEF_CMD("hwrxtsmp", IFCAP_HWRXTSTMP, setifcap),
|
||||
DEF_CMD("-hwrxtsmp", -IFCAP_HWRXTSTMP, setifcap),
|
||||
DEF_CMD("hwrxtstmp", IFCAP_HWRXTSTMP, setifcap),
|
||||
DEF_CMD("-hwrxtstmp", -IFCAP_HWRXTSTMP, setifcap),
|
||||
DEF_CMD("normal", -IFF_LINK0, setifflags),
|
||||
DEF_CMD("compress", IFF_LINK0, setifflags),
|
||||
DEF_CMD("noicmp", IFF_LINK1, setifflags),
|
||||
|
@@ -136,6 +136,7 @@ extern int printkeys;
|
||||
extern int newaddr;
|
||||
extern int verbose;
|
||||
extern int printifname;
|
||||
extern int exit_code;
|
||||
|
||||
void setifcap(const char *, int value, int s, const struct afswtch *);
|
||||
|
||||
|
@@ -162,7 +162,7 @@ printgroup(const char *groupname)
|
||||
if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) {
|
||||
if (errno == EINVAL || errno == ENOTTY ||
|
||||
errno == ENOENT)
|
||||
exit(0);
|
||||
exit(exit_code);
|
||||
else
|
||||
err(1, "SIOCGIFGMEMB");
|
||||
}
|
||||
@@ -181,7 +181,7 @@ printgroup(const char *groupname)
|
||||
}
|
||||
free(ifgr.ifgr_groups);
|
||||
|
||||
exit(0);
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
static struct cmd group_cmds[] = {
|
||||
|
@@ -53,9 +53,17 @@ setlaggport(const char *val, int d, int s, const struct afswtch *afp)
|
||||
strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname));
|
||||
strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname));
|
||||
|
||||
/* Don't choke if the port is already in this lagg. */
|
||||
if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST)
|
||||
err(1, "SIOCSLAGGPORT");
|
||||
/*
|
||||
* Do not exit with an error here. Doing so permits a
|
||||
* failed NIC to take down an entire lagg.
|
||||
*
|
||||
* Don't error at all if the port is already in the lagg.
|
||||
*/
|
||||
if (ioctl(s, SIOCSLAGGPORT, &rp) && errno != EEXIST) {
|
||||
warnx("%s %s: SIOCSLAGGPORT: %s",
|
||||
name, val, strerror(errno));
|
||||
exit_code = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -195,14 +195,6 @@ media_status(int s)
|
||||
printf("no carrier");
|
||||
break;
|
||||
|
||||
case IFM_FDDI:
|
||||
case IFM_TOKEN:
|
||||
if (ifmr.ifm_status & IFM_ACTIVE)
|
||||
printf("inserted");
|
||||
else
|
||||
printf("no ring");
|
||||
break;
|
||||
|
||||
case IFM_IEEE80211:
|
||||
if (ifmr.ifm_status & IFM_ACTIVE) {
|
||||
/* NB: only sta mode associates */
|
||||
@@ -430,24 +422,6 @@ static struct ifmedia_description ifm_subtype_ethernet_aliases[] =
|
||||
static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] =
|
||||
IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS;
|
||||
|
||||
static struct ifmedia_description ifm_subtype_tokenring_descriptions[] =
|
||||
IFM_SUBTYPE_TOKENRING_DESCRIPTIONS;
|
||||
|
||||
static struct ifmedia_description ifm_subtype_tokenring_aliases[] =
|
||||
IFM_SUBTYPE_TOKENRING_ALIASES;
|
||||
|
||||
static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] =
|
||||
IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS;
|
||||
|
||||
static struct ifmedia_description ifm_subtype_fddi_descriptions[] =
|
||||
IFM_SUBTYPE_FDDI_DESCRIPTIONS;
|
||||
|
||||
static struct ifmedia_description ifm_subtype_fddi_aliases[] =
|
||||
IFM_SUBTYPE_FDDI_ALIASES;
|
||||
|
||||
static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] =
|
||||
IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS;
|
||||
|
||||
static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] =
|
||||
IFM_SUBTYPE_IEEE80211_DESCRIPTIONS;
|
||||
|
||||
@@ -521,42 +495,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = {
|
||||
{ NULL, 0 },
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
{ &ifm_subtype_shared_descriptions[0], 0 },
|
||||
{ &ifm_subtype_shared_aliases[0], 1 },
|
||||
{ &ifm_subtype_tokenring_descriptions[0], 0 },
|
||||
{ &ifm_subtype_tokenring_aliases[0], 1 },
|
||||
{ NULL, 0 },
|
||||
},
|
||||
{
|
||||
{ &ifm_shared_option_descriptions[0], 0 },
|
||||
{ &ifm_shared_option_aliases[0], 1 },
|
||||
{ &ifm_subtype_tokenring_option_descriptions[0], 0 },
|
||||
{ NULL, 0 },
|
||||
},
|
||||
{
|
||||
{ NULL, 0 },
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
{ &ifm_subtype_shared_descriptions[0], 0 },
|
||||
{ &ifm_subtype_shared_aliases[0], 1 },
|
||||
{ &ifm_subtype_fddi_descriptions[0], 0 },
|
||||
{ &ifm_subtype_fddi_aliases[0], 1 },
|
||||
{ NULL, 0 },
|
||||
},
|
||||
{
|
||||
{ &ifm_shared_option_descriptions[0], 0 },
|
||||
{ &ifm_shared_option_aliases[0], 1 },
|
||||
{ &ifm_subtype_fddi_option_descriptions[0], 0 },
|
||||
{ NULL, 0 },
|
||||
},
|
||||
{
|
||||
{ NULL, 0 },
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
{ &ifm_subtype_shared_descriptions[0], 0 },
|
||||
|
@@ -15,6 +15,7 @@ RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern char *f_inet6);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern char name[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int clearaddr);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int doalias);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int exit_code);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int newaddr);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int noload);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int printifname);
|
||||
|
@@ -13,17 +13,11 @@ RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_ethernet_aliases[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_ethernet_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_fddi_aliases[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_fddi_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_fddi_option_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_ieee80211_aliases[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_ieee80211_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_shared_aliases[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_shared_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_tokenring_aliases[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_tokenring_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_description ifm_type_descriptions[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[]);
|
||||
RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, static struct ifmediareq *ifmedia_getstate_ifmr);
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#define descr _bsd_ifconfig_descr
|
||||
#define descrlen _bsd_ifconfig_descrlen
|
||||
#define doalias _bsd_ifconfig_doalias
|
||||
#define exit_code _bsd_ifconfig_exit_code
|
||||
#define f_addr _bsd_ifconfig_f_addr
|
||||
#define f_ether _bsd_ifconfig_f_ether
|
||||
#define f_inet _bsd_ifconfig_f_inet
|
||||
|
Reference in New Issue
Block a user