[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>
This commit is contained in:

committed by
David S. Miller

parent
ef722495c8
commit
22aba383ce
@@ -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;
|
||||
struct rtable *rt = 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 {
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user