Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90203
b: refs/heads/master
c: 22aba38
h: refs/heads/master
i:
  90201: 066dbc5
  90199: e26bc40
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Mar 22, 2008
1 parent 2577044 commit 10e2867
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 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: ef722495c8867aacc1db0675a6737e5cf1e72e07
refs/heads/master: 22aba383ce52f8ca8740f9a74dc66b1b68138813
5 changes: 3 additions & 2 deletions trunk/net/ipv4/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,14 @@ static inline int ip_rcv_options(struct sk_buff *skb)
}

iph = ip_hdr(skb);
opt = &(IPCB(skb)->opt);
opt->optlen = iph->ihl*4 - sizeof(struct iphdr);

if (ip_options_compile(NULL, skb)) {
if (ip_options_compile(opt, skb)) {
IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
goto drop;
}

opt = &(IPCB(skb)->opt);
if (unlikely(opt->srr)) {
struct in_device *in_dev = in_dev_get(dev);
if (in_dev) {
Expand Down
17 changes: 7 additions & 10 deletions trunk/net/ipv4/ip_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,14 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
unsigned char * optptr;
int optlen;
unsigned char * pp_ptr = NULL;
struct rtable *rt = skb ? skb->rtable : NULL;

if (!opt) {
opt = &(IPCB(skb)->opt);
iph = skb_network_header(skb);
opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr);
optptr = iph + sizeof(struct iphdr);
} else {
struct rtable *rt = NULL;

if (skb != NULL) {
rt = skb->rtable;
optptr = (unsigned char *)&(ip_hdr(skb)[1]);
} else
optptr = opt->__data;
iph = optptr - sizeof(struct iphdr);
}
iph = optptr - sizeof(struct iphdr);

for (l = opt->optlen; l > 0; ) {
switch (*optptr) {
Expand Down

0 comments on commit 10e2867

Please sign in to comment.