** Description changed:

  Binary package hint: nginx
  
  As describe at: http://nginx.org/pipermail/nginx/2010-December/024229.html
  ---
  In ngx_inet.c, there is a code piece of function
  "ngx_inet_resolve_host". If I set u->one_addr to 1, but unfortunately
- this hostname map to multiple IP addresses, such as 
+ this hostname map to multiple IP addresses, such as
  [code]
  10.37.4.92 myhost
  127.0.0.1 myhost
  [/code]
  in /etc/hosts.
  
  h->h_addr_list will be 2 entries before NULL. Each of them will be
  converted to human readable format and assigned to u->addrs[ i ].
  However, when one_addr is set, [b]u->addrs will be allocated ONLY ONE
  ngx_addr_t mem.[/b] In this way, a mem crash is inevitable.
  
  I set one_addr to 1 because I'm writing a custom module and want to
  connect another server. Sadly the server is also running on the local
  host with multiple IP in /etc/hosts. I want to connect the first IP
  match that host name (10.37.4.92) because that server require a
  non-lookback IP. I thought "one_addr" means "fetch the first found IP".
  But seems I was wrong.
  
  Besides this, I insist alloc mem with "i", but loop will h->h_addr_list
  is very dangerous. Report an error is more suitable  rather than leave a
  time bomb.
  
  Affected version: all versions!!!
  --
+ 
+ $ apt-cache policy nginx
+ nginx:
+   Installed: 0.7.65-1ubuntu2
+   Candidate: 0.7.65-1ubuntu2
+   Version table:
+  *** 0.7.65-1ubuntu2 0
+         500 http://mirrors.kernel.org/ubuntu/ lucid/universe Packages
+         100 /var/lib/dpkg/status
+ 
+ $ nginx -V
+ nginx version: nginx/0.7.65
+ TLS SNI support enabled
+ configure arguments: --conf-path=/etc/nginx/nginx.conf 
--error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid 
--lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log 
--http-client-body-temp-path=/var/lib/nginx/body 
--http-proxy-temp-path=/var/lib/nginx/proxy 
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug 
--with-http_stub_status_module --with-http_flv_module --with-http_ssl_module 
--with-http_dav_module --with-http_gzip_static_module --with-http_realip_module 
--with-mail --with-mail_ssl_module --with-ipv6 
--add-module=/build/buildd/nginx-0.7.65/modules/nginx-upstream-fair
+ 
+ $ lsb_release -a
+ No LSB modules are available.
+ Distributor ID: Ubuntu
+ Description: Ubuntu 10.04.1 LTS
+ Release: 10.04
+ Codename: lucid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/691871

Title:
  Trouble if mapping hostname with multiple address

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to