Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8963
b: refs/heads/master
c: 4a805e8
h: refs/heads/master
i:
  8961: 6a65454
  8959: 854e93c
v: v3
  • Loading branch information
David S. Miller committed Sep 15, 2005
1 parent 7faa54f commit 409a5c2
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 86 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: 40796c5e8f2a93008e9034b3110a7e7b1fa0fba0
refs/heads/master: 4a805e863d6b9466baf7084e1d6fdbe6e0628d8e
4 changes: 4 additions & 0 deletions trunk/fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include <linux/nfsd/syscall.h>
#include <linux/personality.h>
#include <linux/rwsem.h>
#include <linux/acct.h>
#include <linux/mm.h>

#include <net/sock.h> /* siocdevprivate_ioctl */

Expand Down Expand Up @@ -1487,6 +1489,8 @@ int compat_do_execve(char * filename,

/* execve success */
security_bprm_free(bprm);
acct_update_integrals(current);
update_mem_hiwater(current);
kfree(bprm);
return retval;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define NETLINK_IP6_FW 13
#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
#define NETLINK_GENERIC 16

#define MAX_LINKS 32

Expand Down
3 changes: 0 additions & 3 deletions trunk/include/net/ip_vs.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
#define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */
#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */
#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */
#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */

/* Move it to better place one day, for now keep it unique */
#define NFC_IPVS_PROPERTY 0x10000
Expand Down Expand Up @@ -740,8 +739,6 @@ enum {

extern struct ip_vs_conn *ip_vs_conn_in_get
(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port);
extern struct ip_vs_conn *ip_vs_ct_in_get
(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port);
extern struct ip_vs_conn *ip_vs_conn_out_get
(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port);

Expand Down
8 changes: 3 additions & 5 deletions trunk/net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,9 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
.tos = RT_TOS(iph->tos)} }, .proto = 0};

if (!ip_route_output_key(&rt, &fl)) {
/* - Bridged-and-DNAT'ed traffic doesn't
* require ip_forwarding.
* - Deal with redirected traffic. */
if (((struct dst_entry *)rt)->dev == dev ||
rt->rt_type == RTN_LOCAL) {
/* Bridged-and-DNAT'ed traffic doesn't
* require ip_forwarding. */
if (((struct dst_entry *)rt)->dev == dev) {
skb->dst = (struct dst_entry *)rt;
goto bridged_dnat;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ static void ip_mc_clear_src(struct ip_mc_list *pmc)
}
pmc->sources = NULL;
pmc->sfmode = MCAST_EXCLUDE;
pmc->sfcount[MCAST_INCLUDE] = 0;
pmc->sfcount[MCAST_EXCLUDE] = 0;
pmc->sfcount[MCAST_EXCLUDE] = 1;
}

Expand Down
43 changes: 4 additions & 39 deletions trunk/net/ipv4/ipvs/ip_vs_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ static inline struct ip_vs_conn *__ip_vs_conn_in_get
list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (s_addr==cp->caddr && s_port==cp->cport &&
d_port==cp->vport && d_addr==cp->vaddr &&
((!s_port) ^ (!(cp->flags & IP_VS_CONN_F_NO_CPORT))) &&
protocol==cp->protocol) {
/* HIT */
atomic_inc(&cp->refcnt);
Expand Down Expand Up @@ -228,40 +227,6 @@ struct ip_vs_conn *ip_vs_conn_in_get
return cp;
}

/* Get reference to connection template */
struct ip_vs_conn *ip_vs_ct_in_get
(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port)
{
unsigned hash;
struct ip_vs_conn *cp;

hash = ip_vs_conn_hashkey(protocol, s_addr, s_port);

ct_read_lock(hash);

list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (s_addr==cp->caddr && s_port==cp->cport &&
d_port==cp->vport && d_addr==cp->vaddr &&
cp->flags & IP_VS_CONN_F_TEMPLATE &&
protocol==cp->protocol) {
/* HIT */
atomic_inc(&cp->refcnt);
goto out;
}
}
cp = NULL;

out:
ct_read_unlock(hash);

IP_VS_DBG(7, "template lookup/in %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n",
ip_vs_proto_name(protocol),
NIPQUAD(s_addr), ntohs(s_port),
NIPQUAD(d_addr), ntohs(d_port),
cp?"hit":"not hit");

return cp;
}

/*
* Gets ip_vs_conn associated with supplied parameters in the ip_vs_conn_tab.
Expand Down Expand Up @@ -402,7 +367,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
atomic_read(&dest->refcnt));

/* Update the connection counters */
if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) {
if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) {
/* It is a normal connection, so increase the inactive
connection counter because it is in TCP SYNRECV
state (inactive) or other protocol inacive state */
Expand Down Expand Up @@ -441,7 +406,7 @@ static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp)
atomic_read(&dest->refcnt));

/* Update the connection counters */
if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) {
if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) {
/* It is a normal connection, so decrease the inactconns
or activeconns counter */
if (cp->flags & IP_VS_CONN_F_INACTIVE) {
Expand Down Expand Up @@ -502,7 +467,7 @@ int ip_vs_check_template(struct ip_vs_conn *ct)
/*
* Invalidate the connection template
*/
if (ct->vport != 65535) {
if (ct->cport) {
if (ip_vs_conn_unhash(ct)) {
ct->dport = 65535;
ct->vport = 65535;
Expand Down Expand Up @@ -811,7 +776,7 @@ void ip_vs_random_dropentry(void)
ct_write_lock_bh(hash);

list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (cp->flags & IP_VS_CONN_F_TEMPLATE)
if (!cp->cport && !(cp->flags & IP_VS_CONN_F_NO_CPORT))
/* connection template */
continue;

Expand Down
16 changes: 8 additions & 8 deletions trunk/net/ipv4/ipvs/ip_vs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
if (ports[1] == svc->port) {
/* Check if a template already exists */
if (svc->port != FTPPORT)
ct = ip_vs_ct_in_get(iph->protocol, snet, 0,
ct = ip_vs_conn_in_get(iph->protocol, snet, 0,
iph->daddr, ports[1]);
else
ct = ip_vs_ct_in_get(iph->protocol, snet, 0,
ct = ip_vs_conn_in_get(iph->protocol, snet, 0,
iph->daddr, 0);

if (!ct || !ip_vs_check_template(ct)) {
Expand All @@ -272,14 +272,14 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
iph->daddr,
ports[1],
dest->addr, dest->port,
IP_VS_CONN_F_TEMPLATE,
0,
dest);
else
ct = ip_vs_conn_new(iph->protocol,
snet, 0,
iph->daddr, 0,
dest->addr, 0,
IP_VS_CONN_F_TEMPLATE,
0,
dest);
if (ct == NULL)
return NULL;
Expand All @@ -298,10 +298,10 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
* port zero template: <protocol,caddr,0,vaddr,0,daddr,0>
*/
if (svc->fwmark)
ct = ip_vs_ct_in_get(IPPROTO_IP, snet, 0,
ct = ip_vs_conn_in_get(IPPROTO_IP, snet, 0,
htonl(svc->fwmark), 0);
else
ct = ip_vs_ct_in_get(iph->protocol, snet, 0,
ct = ip_vs_conn_in_get(iph->protocol, snet, 0,
iph->daddr, 0);

if (!ct || !ip_vs_check_template(ct)) {
Expand All @@ -326,14 +326,14 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
snet, 0,
htonl(svc->fwmark), 0,
dest->addr, 0,
IP_VS_CONN_F_TEMPLATE,
0,
dest);
else
ct = ip_vs_conn_new(iph->protocol,
snet, 0,
iph->daddr, 0,
dest->addr, 0,
IP_VS_CONN_F_TEMPLATE,
0,
dest);
if (ct == NULL)
return NULL;
Expand Down
20 changes: 6 additions & 14 deletions trunk/net/ipv4/ipvs/ip_vs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,16 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)

p = (char *)buffer + sizeof(struct ip_vs_sync_mesg);
for (i=0; i<m->nr_conns; i++) {
unsigned flags;

s = (struct ip_vs_sync_conn *)p;
flags = ntohs(s->flags);
if (!(flags & IP_VS_CONN_F_TEMPLATE))
cp = ip_vs_conn_in_get(s->protocol,
s->caddr, s->cport,
s->vaddr, s->vport);
else
cp = ip_vs_ct_in_get(s->protocol,
s->caddr, s->cport,
s->vaddr, s->vport);
cp = ip_vs_conn_in_get(s->protocol,
s->caddr, s->cport,
s->vaddr, s->vport);
if (!cp) {
cp = ip_vs_conn_new(s->protocol,
s->caddr, s->cport,
s->vaddr, s->vport,
s->daddr, s->dport,
flags, NULL);
ntohs(s->flags), NULL);
if (!cp) {
IP_VS_ERR("ip_vs_conn_new failed\n");
return;
Expand All @@ -323,11 +315,11 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
} else if (!cp->dest) {
/* it is an entry created by the synchronization */
cp->state = ntohs(s->state);
cp->flags = flags | IP_VS_CONN_F_HASHED;
cp->flags = ntohs(s->flags) | IP_VS_CONN_F_HASHED;
} /* Note that we don't touch its state and flags
if it is a normal entry. */

if (flags & IP_VS_CONN_F_SEQ_MASK) {
if (ntohs(s->flags) & IP_VS_CONN_F_SEQ_MASK) {
opt = (struct ip_vs_sync_conn_options *)&s[1];
memcpy(&cp->in_seq, opt, sizeof(*opt));
p += FULL_CONN_SIZE;
Expand Down
16 changes: 7 additions & 9 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,19 +979,14 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
if (!before(TCP_SKB_CB(skb)->seq, end_seq))
break;

in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) &&
!before(end_seq, TCP_SKB_CB(skb)->end_seq);

pcount = tcp_skb_pcount(skb);

if (pcount > 1 && !in_sack &&
after(TCP_SKB_CB(skb)->end_seq, start_seq)) {
if (pcount > 1 &&
(after(start_seq, TCP_SKB_CB(skb)->seq) ||
before(end_seq, TCP_SKB_CB(skb)->end_seq))) {
unsigned int pkt_len;

in_sack = !after(start_seq,
TCP_SKB_CB(skb)->seq);

if (!in_sack)
if (after(start_seq, TCP_SKB_CB(skb)->seq))
pkt_len = (start_seq -
TCP_SKB_CB(skb)->seq);
else
Expand All @@ -1004,6 +999,9 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_

fack_count += pcount;

in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) &&
!before(end_seq, TCP_SKB_CB(skb)->end_seq);

sacked = TCP_SKB_CB(skb)->sacked;

/* Account D-SACK for retransmitted packet. */
Expand Down
2 changes: 0 additions & 2 deletions trunk/net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,6 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
int nsize, old_factor;
u16 flags;

BUG_ON(len >= skb->len);

nsize = skb_headlen(skb) - len;
if (nsize < 0)
nsize = 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ static void ip6_mc_clear_src(struct ifmcaddr6 *pmc)
}
pmc->mca_sources = NULL;
pmc->mca_sfmode = MCAST_EXCLUDE;
pmc->mca_sfcount[MCAST_INCLUDE] = 0;
pmc->mca_sfcount[MCAST_EXCLUDE] = 0;
pmc->mca_sfcount[MCAST_EXCLUDE] = 1;
}

Expand Down
5 changes: 3 additions & 2 deletions trunk/net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,9 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
continue;

if (!ipv6_addr_any(&np->rcv_saddr)) {
if (!ipv6_addr_equal(&np->rcv_saddr, loc_addr))
continue;
if (ipv6_addr_equal(&np->rcv_saddr, loc_addr))
return s;
continue;
}
if(!inet6_mc_check(s, loc_addr, rmt_addr))
continue;
Expand Down

0 comments on commit 409a5c2

Please sign in to comment.