Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14637
b: refs/heads/master
c: 4b4a27d
h: refs/heads/master
i:
  14635: bcfb347
v: v3
  • Loading branch information
Linus Torvalds committed Nov 23, 2005
1 parent 0e59967 commit 09b268d
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9b1ef8ec7df544b236b19fb6cc42ed2591b65cd
refs/heads/master: 4b4a27dff4e2d4cc2eac1cde31aede834a966a48
9 changes: 1 addition & 8 deletions trunk/Documentation/networking/ifenslave.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,7 @@ static int enslave(char *master_ifname, char *slave_ifname)
/* Older bonding versions would panic if the slave has no IP
* address, so get the IP setting from the master.
*/
res = set_if_addr(master_ifname, slave_ifname);
if (res) {
fprintf(stderr,
"Slave '%s': Error: set address failed\n",
slave_ifname);
return res;
}
set_if_addr(master_ifname, slave_ifname);
} else {
res = clear_if_addr(slave_ifname);
if (res) {
Expand Down Expand Up @@ -1085,7 +1079,6 @@ static int set_if_addr(char *master_ifname, char *slave_ifname)
slave_ifname, ifra[i].req_name,
strerror(saved_errno));

return res;
}

ipaddr = ifr.ifr_addr.sa_data;
Expand Down
8 changes: 7 additions & 1 deletion trunk/include/linux/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ void smp_prepare_boot_cpu(void);
*/
#define raw_smp_processor_id() 0
#define hard_smp_processor_id() 0
#define smp_call_function(func,info,retry,wait) ({ 0; })

static inline int smp_call_function(void (*func) (void *info), void *info,
int retry, int wait)
{
return 0;
}

#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
static inline void smp_send_reschedule(int cpu) { }
#define num_booting_cpus() 1
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ extern int ip_rt_ioctl(unsigned int cmd, void __user *arg);
extern void ip_rt_get_source(u8 *src, struct rtable *rt);
extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb);

struct in_ifaddr;
extern void fib_add_ifaddr(struct in_ifaddr *);

static inline void ip_rt_put(struct rtable * rt)
{
if (rt)
Expand Down
40 changes: 30 additions & 10 deletions trunk/net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
int destroy)
{
struct in_ifaddr *promote = NULL;
struct in_ifaddr *ifa1 = *ifap;
struct in_ifaddr *ifa, *ifa1 = *ifap;
struct in_ifaddr *last_prim = in_dev->ifa_list;
struct in_ifaddr *prev_prom = NULL;
int do_promote = IN_DEV_PROMOTE_SECONDARIES(in_dev);

ASSERT_RTNL();

Expand All @@ -243,18 +246,22 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
**/

if (!(ifa1->ifa_flags & IFA_F_SECONDARY)) {
struct in_ifaddr *ifa;
struct in_ifaddr **ifap1 = &ifa1->ifa_next;

while ((ifa = *ifap1) != NULL) {
if (!(ifa->ifa_flags & IFA_F_SECONDARY) &&
ifa1->ifa_scope <= ifa->ifa_scope)
last_prim = ifa;

if (!(ifa->ifa_flags & IFA_F_SECONDARY) ||
ifa1->ifa_mask != ifa->ifa_mask ||
!inet_ifa_match(ifa1->ifa_address, ifa)) {
ifap1 = &ifa->ifa_next;
prev_prom = ifa;
continue;
}

if (!IN_DEV_PROMOTE_SECONDARIES(in_dev)) {
if (!do_promote) {
*ifap1 = ifa->ifa_next;

rtmsg_ifa(RTM_DELADDR, ifa);
Expand Down Expand Up @@ -283,18 +290,31 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
*/
rtmsg_ifa(RTM_DELADDR, ifa1);
notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa1);
if (destroy) {
inet_free_ifa(ifa1);

if (!in_dev->ifa_list)
inetdev_destroy(in_dev);
}
if (promote) {

if (prev_prom) {
prev_prom->ifa_next = promote->ifa_next;
promote->ifa_next = last_prim->ifa_next;
last_prim->ifa_next = promote;
}

if (promote && IN_DEV_PROMOTE_SECONDARIES(in_dev)) {
/* not sure if we should send a delete notify first? */
promote->ifa_flags &= ~IFA_F_SECONDARY;
rtmsg_ifa(RTM_NEWADDR, promote);
notifier_call_chain(&inetaddr_chain, NETDEV_UP, promote);
for (ifa = promote->ifa_next; ifa; ifa = ifa->ifa_next) {
if (ifa1->ifa_mask != ifa->ifa_mask ||
!inet_ifa_match(ifa1->ifa_address, ifa))
continue;
fib_add_ifaddr(ifa);
}

}
if (destroy) {
inet_free_ifa(ifa1);

if (!in_dev->ifa_list)
inetdev_destroy(in_dev);
}
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static void fib_magic(int cmd, int type, u32 dst, int dst_len, struct in_ifaddr
tb->tb_delete(tb, &req.rtm, &rta, &req.nlh, NULL);
}

static void fib_add_ifaddr(struct in_ifaddr *ifa)
void fib_add_ifaddr(struct in_ifaddr *ifa)
{
struct in_device *in_dev = ifa->ifa_dev;
struct net_device *dev = in_dev->dev;
Expand Down
24 changes: 12 additions & 12 deletions trunk/net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ ctnetlink_dump_tuples_proto(struct sk_buff *skb,

NFA_PUT(skb, CTA_PROTO_NUM, sizeof(u_int8_t), &tuple->dst.protonum);

/* If no protocol helper is found, this function will return the
* generic protocol helper, so proto won't *ever* be NULL */
proto = ip_conntrack_proto_find_get(tuple->dst.protonum);
if (likely(proto && proto->tuple_to_nfattr)) {
if (likely(proto->tuple_to_nfattr))
ret = proto->tuple_to_nfattr(skb, tuple);
ip_conntrack_proto_put(proto);
}

ip_conntrack_proto_put(proto);

return ret;

Expand Down Expand Up @@ -128,9 +130,11 @@ ctnetlink_dump_protoinfo(struct sk_buff *skb, const struct ip_conntrack *ct)

struct nfattr *nest_proto;
int ret;

if (!proto || !proto->to_nfattr)

if (!proto->to_nfattr) {
ip_conntrack_proto_put(proto);
return 0;
}

nest_proto = NFA_NEST(skb, CTA_PROTOINFO);

Expand Down Expand Up @@ -527,10 +531,10 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr,

proto = ip_conntrack_proto_find_get(tuple->dst.protonum);

if (likely(proto && proto->nfattr_to_tuple)) {
if (likely(proto->nfattr_to_tuple))
ret = proto->nfattr_to_tuple(tb, tuple);
ip_conntrack_proto_put(proto);
}

ip_conntrack_proto_put(proto);

return ret;
}
Expand Down Expand Up @@ -596,8 +600,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
return -EINVAL;

npt = ip_nat_proto_find_get(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum);
if (!npt)
return 0;

if (!npt->nfattr_to_range) {
ip_nat_proto_put(npt);
Expand Down Expand Up @@ -957,8 +959,6 @@ ctnetlink_change_protoinfo(struct ip_conntrack *ct, struct nfattr *cda[])
nfattr_parse_nested(tb, CTA_PROTOINFO_MAX, attr);

proto = ip_conntrack_proto_find_get(npt);
if (!proto)
return -EINVAL;

if (proto->from_nfattr)
err = proto->from_nfattr(tb, ct);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static int netlink_autobind(struct socket *sock)
struct hlist_head *head;
struct sock *osk;
struct hlist_node *node;
s32 pid = current->pid;
s32 pid = current->tgid;
int err;
static s32 rover = -4097;

Expand Down

0 comments on commit 09b268d

Please sign in to comment.