Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213887
b: refs/heads/master
c: 3d04ebb
h: refs/heads/master
i:
  213885: 21bf831
  213883: dce27a5
  213879: 18ad95f
  213871: 258e528
  213855: 14e1cd7
  213823: 074bdce
  213759: 63195d2
v: v3
  • Loading branch information
Changli Gao authored and David S. Miller committed Aug 20, 2010
1 parent a76d165 commit 24e2dda
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 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: 78d3307eded853f01c5e9aaa8c0768c2f75825a3
refs/heads/master: 3d04ebb6ab2ac9a3bea7644f0d13cdf65002b870
31 changes: 15 additions & 16 deletions trunk/net/ipv4/netfilter/ipt_CLUSTERIP.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <net/netfilter/nf_conntrack.h>
#include <net/net_namespace.h>
#include <net/checksum.h>
#include <net/ip.h>

#define CLUSTERIP_VERSION "0.8"

Expand Down Expand Up @@ -231,24 +232,22 @@ clusterip_hashfn(const struct sk_buff *skb,
{
const struct iphdr *iph = ip_hdr(skb);
unsigned long hashval;
u_int16_t sport, dport;
const u_int16_t *ports;

switch (iph->protocol) {
case IPPROTO_TCP:
case IPPROTO_UDP:
case IPPROTO_UDPLITE:
case IPPROTO_SCTP:
case IPPROTO_DCCP:
case IPPROTO_ICMP:
ports = (const void *)iph+iph->ihl*4;
sport = ports[0];
dport = ports[1];
break;
default:
u_int16_t sport = 0, dport = 0;
int poff;

poff = proto_ports_offset(iph->protocol);
if (poff >= 0) {
const u_int16_t *ports;
u16 _ports[2];

ports = skb_header_pointer(skb, iph->ihl * 4 + poff, 4, _ports);
if (ports) {
sport = ports[0];
dport = ports[1];
}
} else {
if (net_ratelimit())
pr_info("unknown protocol %u\n", iph->protocol);
sport = dport = 0;
}

switch (config->hash_mode) {
Expand Down

0 comments on commit 24e2dda

Please sign in to comment.