Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314561
b: refs/heads/master
c: 6648bd7
h: refs/heads/master
i:
  314559: 61a7574
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Jun 23, 2012
1 parent de32541 commit b793f84
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 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: 8e27628ecf883b9e5825103e40e6f86bf8225f1a
refs/heads/master: 6648bd7e0e62c0c8c03b15e00c9e7015e232feff
1 change: 1 addition & 0 deletions trunk/include/linux/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ enum
NET_TCP_ALLOWED_CONG_CONTROL=123,
NET_TCP_MAX_SSTHRESH=124,
NET_TCP_FRTO_RESPONSE=125,
NET_IPV4_EARLY_DEMUX=126,
};

enum {
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ extern int inet_peer_threshold;
extern int inet_peer_minttl;
extern int inet_peer_maxttl;

/* From ip_input.c */
extern int sysctl_ip_early_demux;

/* From ip_output.c */
extern int sysctl_ip_dynaddr;

Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/sysctl_binary.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ static const struct bin_table bin_net_ipv4_table[] = {
{ CTL_INT, NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval" },
/* NET_IPV4_IPFRAG_MAX_DIST "ipfrag_max_dist" no longer used */

{ CTL_INT, NET_IPV4_EARLY_DEMUX, "ip_early_demux" },

{ CTL_INT, 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" },

/* NET_TCP_DEFAULT_WIN_SCALE unused */
Expand Down
22 changes: 13 additions & 9 deletions trunk/net/ipv4/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ static inline bool ip_rcv_options(struct sk_buff *skb)
return true;
}

int sysctl_ip_early_demux __read_mostly = 1;

static int ip_rcv_finish(struct sk_buff *skb)
{
const struct iphdr *iph = ip_hdr(skb);
Expand All @@ -323,16 +325,18 @@ static int ip_rcv_finish(struct sk_buff *skb)
* how the packet travels inside Linux networking.
*/
if (skb_dst(skb) == NULL) {
const struct net_protocol *ipprot;
int protocol = iph->protocol;
int err;
int err = -ENOENT;

rcu_read_lock();
ipprot = rcu_dereference(inet_protos[protocol]);
err = -ENOENT;
if (ipprot && ipprot->early_demux)
err = ipprot->early_demux(skb);
rcu_read_unlock();
if (sysctl_ip_early_demux) {
const struct net_protocol *ipprot;
int protocol = iph->protocol;

rcu_read_lock();
ipprot = rcu_dereference(inet_protos[protocol]);
if (ipprot && ipprot->early_demux)
err = ipprot->early_demux(skb);
rcu_read_unlock();
}

if (err) {
err = ip_route_input_noref(skb, iph->daddr, iph->saddr,
Expand Down
7 changes: 7 additions & 0 deletions trunk/net/ipv4/sysctl_net_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ static struct ctl_table ipv4_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.procname = "ip_early_demux",
.data = &sysctl_ip_early_demux,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
},
{
.procname = "ip_dynaddr",
.data = &sysctl_ip_dynaddr,
Expand Down

0 comments on commit b793f84

Please sign in to comment.