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

Commit 2918cd81 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NETFILTER] arp_tables: Fix unaligned accesses.
  [IPV6] SNMP: Fix {In,Out}NoRoutes statistics.
  [IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE
  [VLAN]: Allow VLAN interface on top of bridge interface
  [PKTGEN]: Add try_to_freeze()
  [NETFILTER]: ipt_ULOG: use put_unaligned
parents 8a065975 49688c84
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -380,6 +380,9 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
		} else {
			vhdr->h_vlan_encapsulated_proto = htons(len);
		}

		skb->protocol = htons(ETH_P_8021Q);
		skb->nh.raw = skb->data;
	}

	/* Before delegating work to the lower layer, enter our MAC-address */
+3 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/capability.h>
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/list.h>
@@ -3333,6 +3334,8 @@ static int pktgen_thread_worker(void *arg)
			t->control &= ~(T_REMDEV);
		}

		try_to_freeze();

		set_current_state(TASK_INTERRUPTIBLE);
	}

+3 −7
Original line number Diff line number Diff line
@@ -166,13 +166,9 @@ static inline int arp_packet_match(const struct arphdr *arphdr,
		return 0;
	}

	for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
		unsigned long odev;
		memcpy(&odev, outdev + i*sizeof(unsigned long),
		       sizeof(unsigned long));
		ret |= (odev
			^ ((const unsigned long *)arpinfo->outiface)[i])
			& ((const unsigned long *)arpinfo->outiface_mask)[i];
	for (i = 0, ret = 0; i < IFNAMSIZ; i++) {
		ret |= (outdev[i] ^ arpinfo->outiface[i])
			& arpinfo->outiface_mask[i];
	}

	if (FWINV(ret != 0, ARPT_INV_VIA_OUT)) {
+4 −3
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@
#include <linux/netfilter_ipv4/ipt_ULOG.h>
#include <net/sock.h>
#include <linux/bitops.h>
#include <asm/unaligned.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
@@ -236,9 +237,9 @@ static void ipt_ulog_packet(unsigned int hooknum,

	/* copy hook, prefix, timestamp, payload, etc. */
	pm->data_len = copy_len;
	pm->timestamp_sec = skb->tstamp.off_sec;
	pm->timestamp_usec = skb->tstamp.off_usec;
	pm->mark = skb->mark;
	put_unaligned(skb->tstamp.off_sec, &pm->timestamp_sec);
	put_unaligned(skb->tstamp.off_usec, &pm->timestamp_usec);
	put_unaligned(skb->mark, &pm->mark);
	pm->hook = hooknum;
	if (prefix != NULL)
		strncpy(pm->prefix, prefix, sizeof(pm->prefix));
+20 −11
Original line number Diff line number Diff line
@@ -1766,13 +1766,22 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
 *	Drop the packet on the floor
 */

static inline int ip6_pkt_drop(struct sk_buff *skb, int code)
{
	int type = ipv6_addr_type(&skb->nh.ipv6h->daddr);
	if (type == IPV6_ADDR_ANY || type == IPV6_ADDR_RESERVED)
static inline int ip6_pkt_drop(struct sk_buff *skb, int code,
			       int ipstats_mib_noroutes)
{
	int type;
	switch (ipstats_mib_noroutes) {
	case IPSTATS_MIB_INNOROUTES:
		type = ipv6_addr_type(&skb->nh.ipv6h->daddr);
		if (type == IPV6_ADDR_ANY || type == IPV6_ADDR_RESERVED) {
			IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_INADDRERRORS);

	IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_OUTNOROUTES);
			break;
		}
		/* FALLTHROUGH */
	case IPSTATS_MIB_OUTNOROUTES:
		IP6_INC_STATS(ip6_dst_idev(skb->dst), ipstats_mib_noroutes);
		break;
	}
	icmpv6_send(skb, ICMPV6_DEST_UNREACH, code, 0, skb->dev);
	kfree_skb(skb);
	return 0;
@@ -1780,26 +1789,26 @@ static inline int ip6_pkt_drop(struct sk_buff *skb, int code)

static int ip6_pkt_discard(struct sk_buff *skb)
{
	return ip6_pkt_drop(skb, ICMPV6_NOROUTE);
	return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_INNOROUTES);
}

static int ip6_pkt_discard_out(struct sk_buff *skb)
{
	skb->dev = skb->dst->dev;
	return ip6_pkt_discard(skb);
	return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_OUTNOROUTES);
}

#ifdef CONFIG_IPV6_MULTIPLE_TABLES

static int ip6_pkt_prohibit(struct sk_buff *skb)
{
	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED);
	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_INNOROUTES);
}

static int ip6_pkt_prohibit_out(struct sk_buff *skb)
{
	skb->dev = skb->dst->dev;
	return ip6_pkt_prohibit(skb);
	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}

static int ip6_pkt_blk_hole(struct sk_buff *skb)
Loading