[lkml]   [2003]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Impossible to turn BROADCAST mode off on ethernet device?
On Mon, 19 May 2003, Denis Zaitsev wrote:

> Kernel 2.4.20. I do:
> ifconfig eth0 -broadcast
> And BROADCAST isn't turned off... The ethernet modules are: eepro100,
> tulip, 3c59x. So, what does it mean?
> Thanks in advance.

Your `ifconfig` might not allow broadcast to be turned off as
long a eth0 is `up`. So I just made a little program to get the flags,
and reset the flags. This shows that your observation is, indeed,

If you mess around with this, I think you will find that you can't
set broadcast OFF as long at the IFF_UP flag is set. This may be
the required behavior because an interface without broadcast
capability will not work on ethernet because ARP requires it.

#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <string.h>
#include <net/if.h>

int main()
struct ifreq ifr;
int s, status;
if((s = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)) == -1)
fprintf(stderr, "socket() failed (%s)\n", strerror(errno));
return s;
memset(&ifr, 0x00, sizeof(ifr));
ifr.ifr_netmask.sa_family = AF_INET;
strcpy(ifr.ifr_name, "eth0");
status = ioctl(s, SIOCGIFFLAGS, &ifr);
ifr.ifr_flags &= ~IFF_BROADCAST;
status = ioctl(s, SIOCGIFFLAGS, &ifr);

return status;

Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:35    [W:0.031 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site