Commit 5d7154f7 authored by David S. Miller's avatar David S. Miller

Merge nuts.ninka.net:/home/davem/src/BK/network-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents 5e163a89 9bfb0766
This diff is collapsed.
...@@ -41,6 +41,16 @@ ...@@ -41,6 +41,16 @@
* - 2002/02/18 Erik Habbinga <erik_habbinga @ hp dot com> : * - 2002/02/18 Erik Habbinga <erik_habbinga @ hp dot com> :
* - ifr2.ifr_flags was not initialized in the hwaddr_notset case, * - ifr2.ifr_flags was not initialized in the hwaddr_notset case,
* SIOCGIFFLAGS now called before hwaddr_notset test * SIOCGIFFLAGS now called before hwaddr_notset test
*
* - 2002/10/31 Tony Cureington <tony.cureington * hp_com> :
* - If the master does not have a hardware address when the first slave
* is enslaved, the master is assigned the hardware address of that
* slave - there is a comment in bonding.c stating "ifenslave takes
* care of this now." This corrects the problem of slaves having
* different hardware addresses in active-backup mode when
* multiple interfaces are specified on a single ifenslave command
* (ifenslave bond0 eth0 eth1).
*
*/ */
static char *version = static char *version =
...@@ -131,6 +141,7 @@ main(int argc, char **argv) ...@@ -131,6 +141,7 @@ main(int argc, char **argv)
sa_family_t master_family; sa_family_t master_family;
char **spp, *master_ifname, *slave_ifname; char **spp, *master_ifname, *slave_ifname;
int hwaddr_notset; int hwaddr_notset;
int master_up;
while ((c = getopt_long(argc, argv, "acdfrvV?h", longopts, 0)) != EOF) while ((c = getopt_long(argc, argv, "acdfrvV?h", longopts, 0)) != EOF)
switch (c) { switch (c) {
...@@ -300,10 +311,86 @@ main(int argc, char **argv) ...@@ -300,10 +311,86 @@ main(int argc, char **argv)
return 1; return 1;
} }
if (hwaddr_notset) { /* we do nothing */ if (hwaddr_notset) {
/* assign the slave hw address to the
* master since it currently does not
* have one; otherwise, slaves may
* have different hw addresses in
* active-backup mode as seen when enslaving
* using "ifenslave bond0 eth0 eth1" because
* hwaddr_notset is set outside this loop.
* TODO: put this and the "else" portion in
* a function.
*/
goterr = 0;
master_up = 0;
if (if_flags.ifr_flags & IFF_UP) {
if_flags.ifr_flags &= ~IFF_UP;
if (ioctl(skfd, SIOCSIFFLAGS,
&if_flags) < 0) {
goterr = 1;
fprintf(stderr,
"Shutting down "
"interface %s failed: "
"%s\n",
master_ifname,
strerror(errno));
} else {
/* we took the master down,
* so we must bring it up
*/
master_up = 1;
}
}
if (!goterr) {
/* get the slaves MAC address */
strncpy(if_hwaddr.ifr_name,
slave_ifname, IFNAMSIZ);
if (ioctl(skfd, SIOCGIFHWADDR,
&if_hwaddr) < 0) {
fprintf(stderr,
"Could not get MAC "
"address of %s: %s\n",
slave_ifname,
strerror(errno));
strncpy(if_hwaddr.ifr_name,
master_ifname,
IFNAMSIZ);
goterr=1;
}
}
if (!goterr) {
strncpy(if_hwaddr.ifr_name,
master_ifname, IFNAMSIZ);
if (ioctl(skfd, SIOCSIFHWADDR,
&if_hwaddr) < 0) {
fprintf(stderr,
"Could not set MAC "
"address of %s: %s\n",
master_ifname,
strerror(errno));
goterr=1;
} else {
hwaddr_notset = 0;
}
}
if (master_up) {
if_flags.ifr_flags |= IFF_UP;
if (ioctl(skfd, SIOCSIFFLAGS,
&if_flags) < 0) {
fprintf(stderr,
"Bringing up interface "
"%s failed: %s\n",
master_ifname,
strerror(errno));
} }
else { /* we'll assign master's hwaddr to this slave */ }
} else {
/* we'll assign master's hwaddr to this slave */
if (ifr2.ifr_flags & IFF_UP) { if (ifr2.ifr_flags & IFF_UP) {
ifr2.ifr_flags &= ~IFF_UP; ifr2.ifr_flags &= ~IFF_UP;
if (ioctl(skfd, SIOCSIFFLAGS, &ifr2) < 0) { if (ioctl(skfd, SIOCSIFFLAGS, &ifr2) < 0) {
......
...@@ -1521,6 +1521,12 @@ M: Kai.Makisara@metla.fi ...@@ -1521,6 +1521,12 @@ M: Kai.Makisara@metla.fi
L: linux-scsi@vger.kernel.org L: linux-scsi@vger.kernel.org
S: Maintained S: Maintained
SCTP PROTOCOL
P: Jon Grimm
M: jgrimm2@us.ibm.com
L: lksctp-developers@lists.sourceforge.net
S: Supported
SCx200 CPU SUPPORT SCx200 CPU SUPPORT
P: Christer Weinigel P: Christer Weinigel
M: christer@weinigel.se M: christer@weinigel.se
......
This diff is collapsed.
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define BOND_MODE_ROUNDROBIN 0 #define BOND_MODE_ROUNDROBIN 0
#define BOND_MODE_ACTIVEBACKUP 1 #define BOND_MODE_ACTIVEBACKUP 1
#define BOND_MODE_XOR 2 #define BOND_MODE_XOR 2
#define BOND_MODE_BROADCAST 3
/* each slave's link has 4 states */ /* each slave's link has 4 states */
#define BOND_LINK_UP 0 /* link is up and running */ #define BOND_LINK_UP 0 /* link is up and running */
...@@ -74,6 +75,7 @@ typedef struct slave { ...@@ -74,6 +75,7 @@ typedef struct slave {
struct slave *prev; struct slave *prev;
struct net_device *dev; struct net_device *dev;
short delay; short delay;
unsigned long jiffies;
char link; /* one of BOND_LINK_XXXX */ char link; /* one of BOND_LINK_XXXX */
char state; /* one of BOND_STATE_XXXX */ char state; /* one of BOND_STATE_XXXX */
unsigned short original_flags; unsigned short original_flags;
...@@ -93,6 +95,8 @@ typedef struct bonding { ...@@ -93,6 +95,8 @@ typedef struct bonding {
slave_t *next; slave_t *next;
slave_t *prev; slave_t *prev;
slave_t *current_slave; slave_t *current_slave;
slave_t *primary_slave;
slave_t *current_arp_slave;
__s32 slave_cnt; __s32 slave_cnt;
rwlock_t lock; rwlock_t lock;
rwlock_t ptrlock; rwlock_t ptrlock;
......
...@@ -207,13 +207,13 @@ static struct pktgen_info pginfos[MAX_PKTGEN]; ...@@ -207,13 +207,13 @@ static struct pktgen_info pginfos[MAX_PKTGEN];
/** Convert to miliseconds */ /** Convert to miliseconds */
inline __u64 tv_to_ms(const struct timeval* tv) { static inline __u64 tv_to_ms(const struct timeval* tv) {
__u64 ms = tv->tv_usec / 1000; __u64 ms = tv->tv_usec / 1000;
ms += (__u64)tv->tv_sec * (__u64)1000; ms += (__u64)tv->tv_sec * (__u64)1000;
return ms; return ms;
} }
inline __u64 getCurMs(void) { static inline __u64 getCurMs(void) {
struct timeval tv; struct timeval tv;
do_gettimeofday(&tv); do_gettimeofday(&tv);
return tv_to_ms(&tv); return tv_to_ms(&tv);
...@@ -1277,7 +1277,7 @@ static int proc_write(struct file *file, const char *user_buffer, ...@@ -1277,7 +1277,7 @@ static int proc_write(struct file *file, const char *user_buffer,
} }
int create_proc_dir(void) static int create_proc_dir(void)
{ {
int len; int len;
/* does proc_dir already exists */ /* does proc_dir already exists */
...@@ -1295,7 +1295,7 @@ int create_proc_dir(void) ...@@ -1295,7 +1295,7 @@ int create_proc_dir(void)
return 1; return 1;
} }
int remove_proc_dir(void) static int remove_proc_dir(void)
{ {
remove_proc_entry(PG_PROC_DIR, proc_net); remove_proc_entry(PG_PROC_DIR, proc_net);
return 1; return 1;
......
...@@ -871,6 +871,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) ...@@ -871,6 +871,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
} }
if (!ndisc_parse_options(opt, optlen, &ndopts)) { if (!ndisc_parse_options(opt, optlen, &ndopts)) {
in6_dev_put(in6_dev);
if (net_ratelimit()) if (net_ratelimit())
ND_PRINTK2(KERN_WARNING ND_PRINTK2(KERN_WARNING
"ICMP6 RA: invalid ND option, ignored.\n"); "ICMP6 RA: invalid ND option, ignored.\n");
......
/* /*
* net/key/pfkeyv2.c An implemenation of PF_KEYv2 sockets. * net/key/af_key.c An implementation of PF_KEYv2 sockets.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment