I am not really familiar with this code but I do not see where ii is used after original call to if_freenameindex. Do you have specific scenario when something would fail before your patch and now passes after it? Concluding I am not convinced this patch is correct. @nyh what do you think?
Also could you please elaborate with at least one sentence why and what this patch fixes instead of "please, review this patch, worked okay for me"? Thanks, Waldek On Thursday, February 8, 2018 at 8:54:30 PM UTC-5, Geraldo Netto wrote: > > please, review this patch, worked okay for me > > Signed-off-by: geraldo netto <gerald...@gmail.com <javascript:>> > --- > libc/network/getifaddrs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libc/network/getifaddrs.c b/libc/network/getifaddrs.c > index 4cdf4d6..38f5dde 100644 > --- a/libc/network/getifaddrs.c > +++ b/libc/network/getifaddrs.c > @@ -192,7 +192,6 @@ int getifaddrs(struct ifaddrs **ifap) > goto err2; > } > } > - if_freenameindex(ii); > > int sock = socket(PF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP); > if(sock == -1) goto err2; > @@ -237,6 +236,7 @@ int getifaddrs(struct ifaddrs **ifap) > goto err; > } > close(sock); > + if_freenameindex(ii); > void* last = 0; > for(head = list; head; head=(stor*)head->next) last=head; > head = last; > -- > 2.7.4 > > -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.