Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip loacl variable in dhcp_netid_free when reload dnsmasq config #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/dnsmasq.h
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ struct dhcp_lease {
};

struct dhcp_netid {
#define LOCAL_DHCP_NETID 1
unsigned int flags;
char *net;
struct dhcp_netid *next;
};
Expand Down
3 changes: 3 additions & 0 deletions src/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,9 @@ static void dhcp_netid_free(struct dhcp_netid *nid)
{
struct dhcp_netid *tmp = nid;
nid = nid->next;
if (tmp->flags & LOCAL_DHCP_NETID) {
continue;
}
free(tmp->net);
free(tmp);
}
Expand Down
4 changes: 4 additions & 0 deletions src/rfc2131.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
subnet_addr.s_addr = override.s_addr = 0;

/* set tag with name == interface */
known_id.flags = LOCAL_DHCP_NETID;
iface_id.flags = LOCAL_DHCP_NETID;
cpewan_id.flags = LOCAL_DHCP_NETID;

iface_id.net = iface_name;
iface_id.next = NULL;
netid = &iface_id;
Expand Down