summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_options.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-03-22 16:36:20 -0700
committerDavid S. Miller <davem@davemloft.net>2008-03-22 16:36:20 -0700
commit22aba383ce52f8ca8740f9a74dc66b1b68138813 (patch)
treec9616eb776a515cac03e20eee11fed1ed84c6999 /net/ipv4/ip_options.c
parentef722495c8867aacc1db0675a6737e5cf1e72e07 (diff)
downloadop-kernel-dev-22aba383ce52f8ca8740f9a74dc66b1b68138813.zip
op-kernel-dev-22aba383ce52f8ca8740f9a74dc66b1b68138813.tar.gz
[IPV4]: Always pass ip_options pointer into ip_options_compile.
This makes code a bit more uniform and straigthforward. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_options.c')
-rw-r--r--net/ipv4/ip_options.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 2fa4113..aeed4e5 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -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) {
OpenPOWER on IntegriCloud