Re: Unable to get interface configuration: 22 Invalid argume…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Philip Hazel
日付:  
To: Ilya Ketris
CC: exim-users
題目: Re: Unable to get interface configuration: 22 Invalid argument
On Thu, 9 May 1996, Ilya Ketris wrote:

>
>    When I added a number of virtual interfaces to my Solaris 2.5,
>    (le0:1, le0:2...), I started getting this message at every
>    attempt of smtp delivery.

>
> log/paniclog:
>
> 1996-05-09 10:19:36 0uHWlt-0005Hg-00 Unable to get interface configuration:
> 22 Invalid argument
> 1996-05-09 10:19:49 Unable to get interface configuration: 22 Invalid
> argument
> 1996-05-09 10:19:54 Unable to get interface configuration: 22 Invalid
> argument


This comes from the following bit of code:

char buf[MAXINTERFACES*sizeof(struct ifreq)];
struct ifconf ifc;
int vs;

/* We have to create a socket in order to do ioctls on it to find out
what we want to know. */

  if ((vs = socket(AF_INET, SOCK_DGRAM, 0)) < 0) 
    log_write(LOG_PANIC_DIE, "Unable to create socket to find interface "
        "addresses: %d %s", errno, strerror(errno)); 


/* Get the interface configuration. */

ifc.ifc_len = sizeof(buf);
ifc.ifc_buf = buf;

  if (ioctl(vs, SIOCGIFCONF, (char *)&ifc) < 0) 
    log_write(LOG_PANIC_DIE, "Unable to get interface configuration: %d %s",
      errno, strerror(errno)); 


  /* For each interface, check it is an IP interface, get its flags, and see if
  it is up; if not, skip */                              


The reason Exim is looking at the interfaces is to discover the IP
addresses of all of them so that it can tell if any MX records point to
the local host.

Are there any experts on the list who can comment on why the ioctl goes
wrong in this case? I didn't invent the code myself; it was copied from
another program.

--
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714