aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/amazon
Commit message (Expand)AuthorAgeFilesLines
* amazon: readd wrongly removed fileHauke Mehrtens2010-01-031-0/+52
* amazon: work on pci controllerHauke Mehrtens2010-01-026-101/+54
* mazon: use platform_device for most drivers and fix some printk'sHauke Mehrtens2010-01-017-39/+197
* work on pci.Hauke Mehrtens2009-12-262-52/+25
* update to 2.6.30, refresh patchesFlorian Fainelli2009-12-041-1/+1
* Update to kernel 2.6.30Hauke Mehrtens2009-11-291-1/+1
* Read the size of the available memory from parameters passed to the kernel by...Hauke Mehrtens2009-11-292-7/+23
* kernel: move CONFIG_MIPS_FPU_EMU to generic kernel configFelix Fietkau2009-11-292-2/+0
* Add kernel 2.6.30 supportHauke Mehrtens2009-11-2816-0/+585
* Some general changes for amazon drivers.Hauke Mehrtens2009-11-284-42/+43
* some more Kconfig symbol move..Imre Kaloz2009-11-111-1/+0
* another round of kernel config cleanupsImre Kaloz2009-11-111-1/+0
* -36/+41
* upgrade & standardize kernel versionsImre Kaloz2008-02-111-1/+1
* make the image filenames a bit shorterFelix Fietkau2007-11-101-3/+3
* get rid of per-profile base-filesGabor Juhos2007-09-291-0/+0
* clean up jffs2 config optionsFelix Fietkau2007-09-191-1/+0
* adapt profiles for subtarget changesFelix Fietkau2007-09-081-3/+0
* major target cleanup. it is now possible to have subtargets that can override...Felix Fietkau2007-09-082-3/+4
* strip the kernel version suffix from target directories, except for brcm-2.4 ...Felix Fietkau2007-09-0648-0/+25896
an class="gi">+ if (!(po->pkt_type & (1 << skb->pkt_type))) + goto drop; + if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; @@ -2866,6 +2868,7 @@ static int packet_create(struct net *net spin_lock_init(&po->bind_lock); mutex_init(&po->pg_vec_lock); po->prot_hook.func = packet_rcv; + po->pkt_type = PACKET_MASK_ANY & ~(1 << PACKET_LOOPBACK); if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; @@ -3472,6 +3475,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } + case PACKET_RECV_TYPE: + { + unsigned int val; + if (optlen != sizeof(val)) + return -EINVAL; + if (copy_from_user(&val, optval, sizeof(val))) + return -EFAULT; + po->pkt_type = val & ~BIT(PACKET_LOOPBACK); + return 0; + } default: return -ENOPROTOOPT; } @@ -3523,6 +3536,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; + case PACKET_RECV_TYPE: + if (len > sizeof(unsigned int)) + len = sizeof(unsigned int); + val = po->pkt_type; + + data = &val; + break; case PACKET_VERSION: val = po->tp_version; break; --- a/net/packet/internal.h +++ b/net/packet/internal.h @@ -115,6 +115,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; + unsigned int pkt_type; }; static struct packet_sock *pkt_sk(struct sock *sk)