lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20070717.021153.74661454.yoshfuji@linux-ipv6.org>
Date:	Tue, 17 Jul 2007 02:11:53 +0900 (JST)
From:	YOSHIFUJI Hideaki / 吉藤英明 
	<yoshfuji@...ux-ipv6.org>
To:	bryan.wu@...log.com
Cc:	michael.hennerich@...log.com, mb@...sch.de, vapier.adi@...il.com,
	jeff@...zik.org, hch@...radead.org, dcbw@...hat.com,
	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, joe@...ches.com, yoshfuji@...ux-ipv6.org
Subject: Re: [PATCH try#5] Blackfin ethernet driver: on chip ethernet MAC
 controller driver

Hello.

In article <1184604542.6107.44.camel@...-laptop> (at Tue, 17 Jul 2007 00:49:02 +0800), Bryan Wu <bryan.wu@...log.com> says:

> +static void bf537mac_set_multicast_list(struct net_device *dev)
> +{
> +	u32 sysctl;
> +
> +	if (dev->flags & IFF_PROMISC) {
> +		printk(KERN_INFO "%s: set to promisc mode\n", dev->name);
> +		sysctl = bfin_read_EMAC_OPMODE();
> +		sysctl |= RAF;
> +		bfin_write_EMAC_OPMODE(sysctl);
> +	} else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) {
> +		/* accept all multicast */
> +		sysctl = bfin_read_EMAC_OPMODE();
> +		sysctl |= PAM;
> +		bfin_write_EMAC_OPMODE(sysctl);
> +	} else if (dev->mc_count) {
> +		/* set multicast */
> +	} else {
> +		/* clear promisc or multicast mode */
> +		sysctl = bfin_read_EMAC_OPMODE();
> +		sysctl &= ~(RAF | PAM);
> +		bfin_write_EMAC_OPMODE(sysctl);
> +	}
> +}
> +

Is this function really correct?

Please make sure to set up multicast list on device, or
set "all multi" on device if you do not know what to do; e.g.

static void bf537mac_set_multicast_list(struct net_device *dev)
{
     u32 sysctl;

     if (dev->flags & IFF_PROMISC) {
             printk(KERN_INFO "%s: set to promisc mode\n", dev->name);
             sysctl = bfin_read_EMAC_OPMODE();
             sysctl |= RAF;
             bfin_write_EMAC_OPMODE(sysctl);
     } else if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
             /* accept all multicast */
             sysctl = bfin_read_EMAC_OPMODE();
             sysctl |= PAM;
             bfin_write_EMAC_OPMODE(sysctl);
     } else {
             /* clear promisc or multicast mode */
             sysctl = bfin_read_EMAC_OPMODE();
             sysctl &= ~(RAF | PAM);
             bfin_write_EMAC_OPMODE(sysctl);
     }
}
--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ