FreeBSD Bugzilla – Attachment 165296 Details for
Bug 205834
rtadvd: accessing freed struct
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch (untested)
patch.diff (text/plain), 2.73 KB, created by
Andrey V. Elsukov
on 2016-01-09 09:09:59 UTC
(
hide
)
Description:
Proposed patch (untested)
Filename:
MIME Type:
Creator:
Andrey V. Elsukov
Created:
2016-01-09 09:09:59 UTC
Size:
2.73 KB
patch
obsolete
>Index: config.c >=================================================================== >--- config.c (revision 293466) >+++ config.c (working copy) >@@ -210,11 +210,25 @@ rm_ifinfo(struct ifinfo *ifi) > { > int error; > >+ error = 0; > syslog(LOG_DEBUG, "<%s> enter (%s).", __func__, ifi->ifi_ifname); >+ /* clean up rai if any */ > switch (ifi->ifi_state) { >+ case IFI_STATE_TRANSITIVE: >+ if (ifi->ifi_rainfo == ifi->ifi_rainfo_trans) >+ ifi->ifi_rainfo_trans = NULL; >+ if (ifi->ifi_rainfo_trans != NULL) { >+ error = rm_rainfo(ifi->ifi_rainfo_trans); >+ ifi->ifi_rainfo_trans = NULL; >+ } >+ case IFI_STATE_CONFIGURED: >+ if (ifi->ifi_rainfo != NULL) { >+ error = rm_rainfo(ifi->ifi_rainfo); >+ ifi->ifi_rainfo = NULL; >+ } >+ break; > case IFI_STATE_UNCONFIGURED: > return (0); >- break; > default: > ifi->ifi_state = IFI_STATE_UNCONFIGURED; > syslog(LOG_DEBUG, >@@ -222,18 +236,20 @@ rm_ifinfo(struct ifinfo *ifi) > __func__, ifi->ifi_ifname); > > /* XXX: No MC leaving here because index is disappeared */ >- >- /* Inactivate timer */ >- rtadvd_remove_timer(ifi->ifi_ra_timer); >- ifi->ifi_ra_timer = NULL; > break; > } > >+ /* Inactivate timer */ >+ rtadvd_remove_timer(ifi->ifi_ra_timer); >+ ifi->ifi_ra_timer = NULL; >+ > /* clean up ifi */ >- if (!ifi->ifi_persist) { >+ if (ifi->ifi_persist) { > TAILQ_REMOVE(&ifilist, ifi, ifi_next); > syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", > __func__, ifi->ifi_ifindex); >+ syslog(LOG_DEBUG, "<%s> leave (%s).", >+ __func__,ifi->ifi_ifname); > free(ifi); > } else { > /* recreate an empty entry */ >@@ -240,45 +256,10 @@ rm_ifinfo(struct ifinfo *ifi) > update_persist_ifinfo(&ifilist, ifi->ifi_ifname); > syslog(LOG_DEBUG, "<%s>: ifname=%s is persistent.", > __func__, ifi->ifi_ifname); >+ syslog(LOG_DEBUG, "<%s> leave (%s).", >+ __func__,ifi->ifi_ifname); > } >- >- /* clean up rai if any */ >- switch (ifi->ifi_state) { >- case IFI_STATE_CONFIGURED: >- if (ifi->ifi_rainfo != NULL) { >- error = rm_rainfo(ifi->ifi_rainfo); >- if (error) >- return (error); >- ifi->ifi_rainfo = NULL; >- } >- break; >- case IFI_STATE_TRANSITIVE: >- if (ifi->ifi_rainfo == ifi->ifi_rainfo_trans) { >- if (ifi->ifi_rainfo != NULL) { >- error = rm_rainfo(ifi->ifi_rainfo); >- if (error) >- return (error); >- ifi->ifi_rainfo = NULL; >- ifi->ifi_rainfo_trans = NULL; >- } >- } else { >- if (ifi->ifi_rainfo != NULL) { >- error = rm_rainfo(ifi->ifi_rainfo); >- if (error) >- return (error); >- ifi->ifi_rainfo = NULL; >- } >- if (ifi->ifi_rainfo_trans != NULL) { >- error = rm_rainfo(ifi->ifi_rainfo_trans); >- if (error) >- return (error); >- ifi->ifi_rainfo_trans = NULL; >- } >- } >- } >- >- syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); >- return (0); >+ return (error); > } > > int
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 205834
:
165294
|
165295
|
165296
|
165297