lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] simhost linux-bridge


From: Andreas Becker
Subject: Re: [lwip-users] simhost linux-bridge
Date: Thu, 5 Aug 2004 11:55:20 +0200

Solved!
Replying on my own mail

Setup the Bridge like the example in the previous mail.
I had to set the name of the device that I use in the function
/contrib../unix/netif/tapif.c  low_level_init

With name[0] = '\0' it won't work with a bridge!

I hope it is usefull for somebody else.

#ifdef linux
  {
    struct ifreq ifr;
    memset(&ifr, 0, sizeof(ifr));
    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
    ifr.ifr_name[0] = 't';
    ifr.ifr_name[1] = 'a';
    ifr.ifr_name[2] = 'p';
    ifr.ifr_name[3] = '0';
    ifr.ifr_name[4] = '\0';
    if (ioctl(tapif->fd, TUNSETIFF, (void *) &ifr) < 0) {
      perror("tapif_init: "DEVTAP" ioctl TUNSETIFF");
      exit(1);
    }
  }
#endif /* Linux */

#if 0
  snprintf(buf, sizeof(buf), "ifconfig tap0 %d.%d.%d.%d",
           ip4_addr1(&(netif->gw)),
           ip4_addr2(&(netif->gw)),
           ip4_addr3(&(netif->gw)),
           ip4_addr4(&(netif->gw)));
#else
  snprintf(buf, sizeof(buf), "ifconfig tap0 0.0.0.0 promisc up");
#endif

  
  LWIP_DEBUGF(TAPIF_DEBUG, ("tapif_init: system(\"%s\");\n", buf));
  system(buf);

  snprintf(buf, sizeof(buf), "brctl addif br0 tap0");
  LWIP_DEBUGF(TAPIF_DEBUG, ("tapif_init: system(\"%s\");\n", buf));
  system(buf);

-- 
Dipl.-Ing.(FH) Andreas Becker
Entwicklung

dSys e.K.
Soeflinger Str. 100
D-89077 Ulm
Tel:  +49.731.151579-1
Fax: +49.731.151579-9
web: www.dsys.de




reply via email to

[Prev in Thread] Current Thread [Next in Thread]