Handle netlink interface-up notification for non-DS_BOUND states.
This commit is contained in:
parent
1ef44c1e4b
commit
d01b104d48
@ -24,6 +24,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "netlink.h"
|
#include "netlink.h"
|
||||||
|
#include "ifchange.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#define NLMSG_RECVSIZE 8192
|
#define NLMSG_RECVSIZE 8192
|
||||||
@ -123,11 +124,22 @@ static void nl_handlemsg(struct nlmsghdr *msg, unsigned int len,
|
|||||||
cs->ifsPrevState = IFS_UP;
|
cs->ifsPrevState = IFS_UP;
|
||||||
/*
|
/*
|
||||||
* If we have a lease, then check to see
|
* If we have a lease, then check to see
|
||||||
* if our gateway is still valid. If it fails,
|
* if our gateway is still valid (via ARP).
|
||||||
* state -> INIT_REBOOT.
|
* If it fails, state -> INIT.
|
||||||
*
|
*
|
||||||
* If we don't have a lease, state -> INIT.
|
* If we don't have a lease, state -> INIT.
|
||||||
*/
|
*/
|
||||||
|
if (cs->dhcpState == DS_BOUND) {
|
||||||
|
/* arp_check_gw(cs); */
|
||||||
|
} else if (cs->dhcpState != DS_INIT_SELECTING) {
|
||||||
|
// Same as packet.c: line 258
|
||||||
|
ifchange(NULL, IFCHANGE_DECONFIG);
|
||||||
|
cs->dhcpState = DS_INIT_SELECTING;
|
||||||
|
cs->timeout = 0;
|
||||||
|
cs->requestedIP = 0;
|
||||||
|
cs->packetNum = 0;
|
||||||
|
change_listen_mode(cs, LM_RAW);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cs->ifsPrevState != IFS_DOWN) {
|
if (cs->ifsPrevState != IFS_DOWN) {
|
||||||
|
Loading…
Reference in New Issue
Block a user