Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22aba383 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller
Browse files

[IPV4]: Always pass ip_options pointer into ip_options_compile.



This makes code a bit more uniform and straigthforward.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ef722495
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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) {
+7 −10
Original line number Diff line number Diff line
@@ -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);
	}

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