[Bridge] [PATCH 2.4] (1/2) bridge - backport of API checking

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

 



This adds the checks in 2.6 for invalid ether 
and deleting wrong bridge port to 2.4.27 (from Erich Schubert)

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxx>

diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c
--- a/net/bridge/br_if.c	2004-06-21 07:47:10 -07:00
+++ b/net/bridge/br_if.c	2004-06-21 07:47:10 -07:00
@@ -19,6 +19,7 @@
 #include <linux/inetdevice.h>
 #include <linux/rtnetlink.h>
 #include <linux/brlock.h>
+#include <linux/etherdevice.h>
 #include <asm/uaccess.h>
 #include "br_private.h"
 
@@ -44,7 +45,7 @@
 	struct net_bridge_port *p;
 	struct net_bridge_port **pptr;
 
-	if ((p = dev->br_port) == NULL)
+	if ((p = dev->br_port) == NULL || p->br != br)
 		return -EINVAL;
 
 	br_stp_disable_port(p);
@@ -231,6 +232,9 @@
 
 	if (dev->hard_start_xmit == br_dev_xmit)
 		return -ELOOP;
+
+	if (!is_valid_ether_addr(dev->dev_addr))
+		return -EADDRNOTAVAIL;
 
 	dev_hold(dev);
 	write_lock_bh(&br->lock);


[Index of Archives]     [Netdev]     [AoE Tools]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux