diff options
author | Seonah Moon <seonah1.moon@samsung.com> | 2018-06-15 14:33:36 +0900 |
---|---|---|
committer | Seonah Moon <seonah1.moon@samsung.com> | 2018-06-21 16:56:50 +0900 |
commit | fa9b094891049a0cdb6c6379e8308cb3a07614ef (patch) | |
tree | b074d7a2457531291ce0599c30cff230164bace5 | |
parent | e673fe0d7a174fd6708d6c91873913c0df224a6f (diff) | |
download | dnsmasq-accepted/tizen_5.5_unified_mobile_hotfix.tar.gz dnsmasq-accepted/tizen_5.5_unified_mobile_hotfix.tar.bz2 dnsmasq-accepted/tizen_5.5_unified_mobile_hotfix.zip |
Fix crash issuetizen_6.0.m2_releasetizen_5.5.m2_releasesubmit/tizen_6.0_hotfix/20201103.115101submit/tizen_6.0_hotfix/20201102.192901submit/tizen_6.0/20201029.205501submit/tizen_5.5_wearable_hotfix/20201026.184306submit/tizen_5.5_mobile_hotfix/20201026.185106submit/tizen_5.5/20191031.000006submit/tizen_5.0/20181101.000006submit/tizen/20180621.080823accepted/tizen/unified/20180622.122621accepted/tizen/6.0/unified/hotfix/20201102.235526accepted/tizen/6.0/unified/20201030.104344accepted/tizen/5.5/unified/wearable/hotfix/20201027.102254accepted/tizen/5.5/unified/mobile/hotfix/20201027.062024accepted/tizen/5.5/unified/20191031.005105accepted/tizen/5.0/unified/20181102.024411tizen_6.0_hotfixtizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixaccepted/tizen_6.0_unified_hotfixaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unifiedaccepted/tizen_5.0_unified
SIGBUS crash has occured when ipv6 address is copied.
Change-Id: Ie58721f2f8aa909c61d97c7640f0897bfdb5383e
-rw-r--r-- | src/lease.c | 19 | ||||
-rw-r--r-- | src/rfc3315.c | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/lease.c b/src/lease.c index 5c33df7..64f6647 100644 --- a/src/lease.c +++ b/src/lease.c @@ -687,16 +687,21 @@ struct dhcp_lease *lease6_find_by_client(struct dhcp_lease *first, int lease_typ struct dhcp_lease *lease6_find_by_addr(struct in6_addr *net, int prefix, u64 addr) { struct dhcp_lease *lease; - + + my_syslog(MS_DHCP | LOG_INFO, "lease6_find_by_addr(): +"); + for (lease = leases; lease; lease = lease->next) { if (!(lease->flags & (LEASE_TA | LEASE_NA))) continue; if (is_same_net6(&lease->addr6, net, prefix) && - (prefix == 128 || addr6part(&lease->addr6) == addr)) + (prefix == 128 || addr6part(&lease->addr6) == addr)) { + my_syslog(MS_DHCP | LOG_INFO, "lease6_find_by_addr(): -"); return lease; + } } + my_syslog(MS_DHCP | LOG_INFO, "lease6_find_by_addr(): -"); return NULL; } @@ -750,6 +755,9 @@ struct in_addr lease_find_max_addr(struct dhcp_context *context) static struct dhcp_lease *lease_allocate(void) { struct dhcp_lease *lease; + + my_syslog(MS_DHCP | LOG_INFO, "lease_allocate(): +"); + if (!leases_left || !(lease = whine_malloc(sizeof(struct dhcp_lease)))) return NULL; @@ -766,6 +774,8 @@ static struct dhcp_lease *lease_allocate(void) file_dirty = 1; leases_left--; + my_syslog(MS_DHCP | LOG_INFO, "lease_allocate(): -"); + return lease; } @@ -781,15 +791,18 @@ struct dhcp_lease *lease4_allocate(struct in_addr addr) #ifdef HAVE_DHCP6 struct dhcp_lease *lease6_allocate(struct in6_addr *addrp, int lease_type) { + my_syslog(MS_DHCP | LOG_INFO, "lease6_allocate(): +"); + struct dhcp_lease *lease = lease_allocate(); if (lease) { - lease->addr6 = *addrp; + memcpy(&lease->addr6, addrp, sizeof(struct in6_addr)); lease->flags |= lease_type; lease->iaid = 0; } + my_syslog(MS_DHCP | LOG_INFO, "lease6_allocate(): -"); return lease; } #endif diff --git a/src/rfc3315.c b/src/rfc3315.c index 3a2ed75..d416a90 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -1814,6 +1814,7 @@ static void update_leases(struct state *state, struct dhcp_context *context, str #ifdef HAVE_SCRIPT struct dhcp_netid *tagif = run_tag_if(state->tags); #endif + my_syslog(MS_DHCP | LOG_INFO, "update_leases(): +"); (void)context; @@ -1902,6 +1903,7 @@ static void update_leases(struct state *state, struct dhcp_context *context, str #endif } + my_syslog(MS_DHCP | LOG_INFO, "update_leases(): -"); } |