several questions...

Tiago Jorge tjpj at lasige.di.fc.ul.pt
Mon Mar 21 12:36:17 CET 2005


> Maybe it is not transported correctly by l4vfs, please check
> l4/pkg/l4vfs/lib/libc_backends/io/ioctl.c.
>
yep... thats true... it wasn't there. So i added and worked.

just add in the switch statement that handles the the ifreq calls the 
following lines:

   case SIOCSIFBRDADDR:
   case SIOCGIFBRDADDR:

and add in mini_ifconfig:

if (!inet_aton("YOUR_BROADCAST_ADDR", &sa.sin_addr))
    ERR_EXIT("no valid IP broadcast %s", "YOUR_BROADCAST_ADDR");
  sa.sin_family = AF_INET;
  memcpy(&ifr.ifr_broadaddr, &sa, sizeof(struct sockaddr));

  if ((err=ioctl(s, SIOCSIFBRDADDR, &ifr)) < 0)
    ERR_EXIT("ioctl(SIOCSIFBRDADDR) returns %d", err);

now i'm having another problem...

i've set those lines and he changed the broadcast addr in the NIC but 
refuses to send through broadcast adress again.

i'm setting the broadcast like this:

/* And build BROADCAST address */
  destinationAddr.sin_family = AF_INET;
  destinationAddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
  destinationAddr.sin_port = htons(PORTNUMBER);

  // Set the socket to permit multicasts on the local LAN
  if (setsockopt(socketDesc, SOL_SOCKET, SO_BROADCAST, &trueFlag,
                 sizeof(trueFlag)) != 0) {
      LOG("setsockopt error");
      exit(1);
  }

is there a similar "problem" with the setsockopt function? is it doing 
an empty call like ioctl was doing? beacause he returns me no error at all.

thanks

Tiago




More information about the l4-hackers mailing list