- do not dereference a null pointer.
- minor sanity. PR: 15318
This commit is contained in:
parent
019d7e0fc5
commit
749daf9e05
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55215
@ -609,10 +609,10 @@ ifconfig(argc, argv, afp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newaddr) {
|
if (newaddr) {
|
||||||
if (afp->af_ridreq == NULL || afp->af_difaddr == 0) {
|
if (afp->af_addreq == NULL || afp->af_aifaddr == 0) {
|
||||||
warnx("interface %s cannot change %s addresses!",
|
warnx("interface %s cannot change %s addresses!",
|
||||||
name, afp->af_name);
|
name, afp->af_name);
|
||||||
newaddr = NULL;
|
newaddr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newaddr) {
|
if (newaddr) {
|
||||||
@ -636,6 +636,8 @@ setifaddr(addr, param, s, afp)
|
|||||||
int s;
|
int s;
|
||||||
const struct afswtch *afp;
|
const struct afswtch *afp;
|
||||||
{
|
{
|
||||||
|
if (*afp->af_getaddr == NULL)
|
||||||
|
return;
|
||||||
/*
|
/*
|
||||||
* Delay the ioctl to set the interface addr until flags are all set.
|
* Delay the ioctl to set the interface addr until flags are all set.
|
||||||
* The address interpretation may depend on the flags,
|
* The address interpretation may depend on the flags,
|
||||||
@ -654,6 +656,8 @@ setifnetmask(addr, dummy, s, afp)
|
|||||||
int s;
|
int s;
|
||||||
const struct afswtch *afp;
|
const struct afswtch *afp;
|
||||||
{
|
{
|
||||||
|
if (*afp->af_getaddr == NULL)
|
||||||
|
return;
|
||||||
(*afp->af_getaddr)(addr, MASK);
|
(*afp->af_getaddr)(addr, MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -694,6 +698,8 @@ setifbroadaddr(addr, dummy, s, afp)
|
|||||||
int s;
|
int s;
|
||||||
const struct afswtch *afp;
|
const struct afswtch *afp;
|
||||||
{
|
{
|
||||||
|
if (*afp->af_getaddr == NULL)
|
||||||
|
return;
|
||||||
(*afp->af_getaddr)(addr, DSTADDR);
|
(*afp->af_getaddr)(addr, DSTADDR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -738,6 +744,8 @@ setifdstaddr(addr, param, s, afp)
|
|||||||
int s;
|
int s;
|
||||||
const struct afswtch *afp;
|
const struct afswtch *afp;
|
||||||
{
|
{
|
||||||
|
if (*afp->af_getaddr == NULL)
|
||||||
|
return;
|
||||||
(*afp->af_getaddr)(addr, DSTADDR);
|
(*afp->af_getaddr)(addr, DSTADDR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user