/* Rename an interface to a specified new name.  */
static int process_rename(int skfd, char *ifname, char *newname)
/* Rename an interface to a specified new name.  */
static int process_rename(int skfd, char *ifname, char *newname)
{
  char		retname[IFNAMSIZ+1];
  int		len;
  char *	star;
  len = strlen(newname);
  star = strchr(newname, '*');
  if((len + (star != NULL)) > IFNAMSIZ)
    {
      fprintf(stderr, "Error: Interface name `%s' too long.\n",
	      newname);  
      return(-1);
    }
  if(if_set_name(skfd, ifname, newname, retname) < 0)
    {
      fprintf(stderr, "Error: cannot change name of %s to %s: %s\n",
	      ifname, newname, strerror(errno)); 
      return(-1);
    }
  printf("%s\n", retname);
  return(0);
}