Displaying 20 results from an estimated 77 matches for "eth_p_ip".
Did you mean:
eth_p_arp
2007 Apr 18
4
[Bridge] [PATCH/RFC] Let {ip, arp}tables "see" bridged VLAN tagged {I, AR}P packets
...t;
@@ -40,6 +47,11 @@
#define has_bridge_parent(device) ((device)->br_port != NULL)
#define bridge_parent(device) ((device)->br_port->br->dev)
+#define IS_VLAN_IP (skb->protocol == __constant_htons(ETH_P_8021Q) && \
+ hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_IP))
+#define IS_VLAN_ARP (skb->protocol == __constant_htons(ETH_P_8021Q) && \
+ hdr->h_vlan_encapsulated_proto == __constant_htons(ETH_P_ARP))
+
/* We need these fake structures to make netfilter happy --
* lots of places assume that skb->dst != NULL, which isn't
* all that...
2005 Dec 10
10
Marking packets by mac addr using tc filter u32 match?
Hi
Is there a way of marking packets by mac address instead of ip or ports
using a "tc filter u32 match"?
I read somewhere that I could use the offset -8 and -14 to grab the mac
addresses but if I use anything lower than -8, for example -9, I get an
error.
I''m modifying the wondershaper script to cap the download speed by mac
address.
Any sugestions?
2002 Sep 13
0
tcng version 8w
...fields for skb meta-data (meta_protocol, etc.)
- if USE_META_PROTOCOL is #defined (tcc -D... or tcsim -Xc,-D...),
ip_hdr and ip6_hdr check the protocol number
- if_u32 generates distinct classifier branches for each protocol
- f_fw, f_tcindex, and f_u32 now default to ETH_P_ALL instead of
ETH_P_IP
The latter change affects how u32 classification works !
tests/protu32 illustrates how protocol-aware classification
is used.
What''s missing:
- C and tcc-ext-match need to support meta_protocol too
- if_u32 does a few ugly things, and can also generate redundant
filter stubs
- rem...
2013 Aug 26
0
[PATCH] bridge: separate querier and query timer into IGMP/IPv4 and MLD/IPv6 ones
...@@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry)
if (!netif_running(br->dev) || br->multicast_disabled)
return -EINVAL;
- if (timer_pending(&br->multicast_querier_timer))
- return -EBUSY;
-
ip.proto = entry->addr.proto;
- if (ip.proto == htons(ETH_P_IP))
+ if (ip.proto == htons(ETH_P_IP)) {
+ if (timer_pending(&br->ip4_multicast_querier_timer))
+ return -EBUSY;
+
ip.u.ip4 = entry->addr.u.ip4;
#if IS_ENABLED(CONFIG_IPV6)
- else
+ } else {
+ if (timer_pending(&br->ip6_multicast_querier_timer))
+ return -EBUSY;
+
ip.u.i...
2003 Jan 02
7
Can I Classify Non-IP Traffic?
Background: Thanks to the LARTC howto, this list and Stef Coene''s and
devik''s excellent web sites I now have an ethernet bridge (patch
bridge-nf.0.0.7) happily prioritising traffic (12Mbit) into 10 queues
(9 for IP and 1 for non-IP) using a combination of iptables (fwmark)
and htb3 and sfq. Many thanks.
At the moment I''m filtering all non-IP traffic by setting the
2006 May 09
4
[PATCH] Fix checksum errors when firewalling in domU
...;
}
return 0;
out:
@@ -1315,9 +1314,11 @@
if (skb->ip_summed == CHECKSUM_HW &&
(!(dev->features & (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)) &&
(!(dev->features & NETIF_F_IP_CSUM) ||
- skb->protocol != htons(ETH_P_IP))))
+ skb->protocol != htons(ETH_P_IP)))) {
if (skb_checksum_help(skb, 0))
goto out_kfree_skb;
+ reset_proto_csum_blank(skb);
+ }
spin_lock_prefetch(&dev->queue_lock);
diff -r 1e3977e029fd patches/linux-2.6....
2003 Jan 10
7
HTB and ARP
Hi,
I discover recently that the arp traffic is managed like any other flow.
So you get hang after a moment if you don''t use a default class.
Is the any means to avoid this ? Not to have a default class is a way to
filter traffic ...
One would be to managed to class ARP request with tc but I don''t know if
it is possible.
Thanks in advance,
--
Éric Leblond
courriel :
2012 Dec 20
3
[Bridge] [PATCH 1/3] iproute2: distinguish permanent and temporary mdb entries
...| del } dev DEV port PORT grp GROUP [permanent | temp]\n");
fprintf(stderr, " bridge mdb {show} [ dev DEV ]\n");
exit(-1);
}
@@ -53,13 +53,15 @@ static void print_mdb_entry(FILE *f, int ifindex, struct br_mdb_entry *e)
SPRINT_BUF(abuf);
if (e->addr.proto == htons(ETH_P_IP))
- fprintf(f, "bridge %s port %s group %s\n", ll_index_to_name(ifindex),
+ fprintf(f, "bridge %s port %s group %s %s\n", ll_index_to_name(ifindex),
ll_index_to_name(e->ifindex),
- inet_ntop(AF_INET, &e->addr.u.ip4, abuf, sizeof(abuf)));
+ inet_ntop(AF_INET,...
2003 Jun 12
9
HTB and TC on MAC addresses
...y get their IP from dhcp.
> Why not, just use negative offsets with U32 to access
>the 14-byte eth frame header before the IP header:
>
>Decimal Ofs Description
>-----------------------------------
>-14: DST MAC, 6 bytes
>-8: SRC MAC, 6 bytes
>-2: Eth PROTO, 2 bytes, eg. ETH_P_IP
>0: Protocol header (IP Header)
>
Is the above true? If so, can you give me an example with MAC address 00:04:e2:5f:eb:e4.
And, is it possible to shape so everyone gets 256kbit each?
Thx,
Joachim
2006 Jul 06
12
kernel BUG at net/core/dev.c:1133!
Looks like the GSO is involved?
I got this while running Dom0 only (no guests), with a
BOINC/Rosetta@home application running on all 4 cores.
changeset: 10649:8e55c5c11475
Build: x86_32p (pae).
------------[ cut here ]------------
kernel BUG at net/core/dev.c:1133!
invalid opcode: 0000 [#1]
SMP
CPU: 0
EIP: 0061:[<c04dceb0>] Not tainted VLI
EFLAGS: 00210297 (2.6.16.13-xen
2010 Jun 28
3
[PATCHv2] vhost-net: add dhclient work-around from userspace
...b_headlen(skb) >= skb_transport_offset(skb) +
+ sizeof(struct udphdr) &&
+ udp_hdr(skb)->dest == htons(68) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPROTO_UDP &&
+ skb->protocol == htons(ETH_P_IP)) {
+ skb_checksum_help(skb);
+ /* Restore ip_summed value: tun passes it to user. */
+ skb->ip_summed = CHECKSUM_PARTIAL;
+ }
+ release_sock(sk);
+ return 1;
+}
+
/* Expects to be always run from workqueue - which acts as
* read-size critical section for our kind of RCU. */
static void h...
2010 Jun 28
3
[PATCHv2] vhost-net: add dhclient work-around from userspace
...b_headlen(skb) >= skb_transport_offset(skb) +
+ sizeof(struct udphdr) &&
+ udp_hdr(skb)->dest == htons(68) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPROTO_UDP &&
+ skb->protocol == htons(ETH_P_IP)) {
+ skb_checksum_help(skb);
+ /* Restore ip_summed value: tun passes it to user. */
+ skb->ip_summed = CHECKSUM_PARTIAL;
+ }
+ release_sock(sk);
+ return 1;
+}
+
/* Expects to be always run from workqueue - which acts as
* read-size critical section for our kind of RCU. */
static void h...
2007 Sep 23
0
Add U32 Filter with libnl
...match 00160000/ffff0000 at 20
To create a filter with libnl I do the following things:
rtnl_cls * pFilter = rtnl_cls_alloc();
rtnl_cls_set_ifindex(pFilter, m_networkDeviceIdx); /* eth0 */
rtnl_cls_set_kind(pFilter, "u32"); rtnl_cls_set_prio(pFilter, 100);
rtnl_cls_set_protocol(pFilter, ETH_P_IP);
// setting parent class id
rtnl_tc_str2handle("1:", &handle);
rtnl_cls_set_parent(pFilter, handle);
// source port filter
rtnl_u32_add_key_uint16(pFilter, 22, 0xffff, U32_SPORT, 0);
// setting flowid
sprintf(pBuffer, "1:%i", parentId); /* flowid 1:20 */...
2010 Jun 27
0
[PATCH RFC] vhost-net: add dhclient work-around from userspace
...cc,
+ * and older userspace does not use it.
+ * One important user of recvmsg with AF_PACKET is dhclient,
+ * so we add a work-around just for DHCP. */
+ /* We use source port to detect DHCP packets. */
+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ skb->protocol == htons(ETH_P_IP) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPRODO_UDP &&
+ skb_headlen(skb) >= skb_transport_offset(skb) + sizeof(struct udphdr) &&
+ udp_hdr(skb)->source == htons(0x67)) {
+ skb_checksum...
2010 Jun 27
0
[PATCH RFC] vhost-net: add dhclient work-around from userspace
...cc,
+ * and older userspace does not use it.
+ * One important user of recvmsg with AF_PACKET is dhclient,
+ * so we add a work-around just for DHCP. */
+ /* We use source port to detect DHCP packets. */
+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ skb->protocol == htons(ETH_P_IP) &&
+ skb_network_header_len(skb) >= sizeof(struct iphdr) &&
+ ip_hdr(skb)->protocol == IPPRODO_UDP &&
+ skb_headlen(skb) >= skb_transport_offset(skb) + sizeof(struct udphdr) &&
+ udp_hdr(skb)->source == htons(0x67)) {
+ skb_checksum...
2016 Dec 30
0
[PATCH net-next V3 3/3] tun: rx batching
...(skb);
+ local_bh_enable();
+ }
+}
+
/* Get packet from user space buffer */
static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
void *msg_control, struct iov_iter *from,
- int noblock)
+ int noblock, bool more)
{
struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) };
struct sk_buff *skb;
@@ -1283,10 +1314,15 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
skb_probe_transport_header(skb, 0);
rxhash = skb_get_hash(skb);
+
#ifndef CONFIG_4KSTACKS
- local_bh_disable();
- netif_receive_skb(skb);
- local_bh_enable();
+ if (...
2016 Dec 28
0
[PATCH net-next V2 3/3] tun: rx batching
...free_skb(skb);
+ return -EFAULT;
+}
+
/* Get packet from user space buffer */
static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
void *msg_control, struct iov_iter *from,
- int noblock)
+ int noblock, bool more)
{
struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) };
struct sk_buff *skb;
@@ -1283,18 +1322,27 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
skb_probe_transport_header(skb, 0);
rxhash = skb_get_hash(skb);
+
#ifndef CONFIG_4KSTACKS
- local_bh_disable();
- netif_receive_skb(skb);
- local_bh_enable();
+ if (...
2014 Oct 11
0
[PATCH net-next RFC 3/3] virtio-net: conditionally enable tx interrupt
...ow_dissect() for encapsulated
traffic.
struct flow_keys keys;
if (!skb_flow_dissect(skb, &keys))
return false;
if (keys.ip_proto != IPPROTO_TCP)
return false;
then check __skb_get_poff() how to get th, and check if there is some
payload...
> + if ((skb->protocol == htons(ETH_P_IP)) &&
> + hdr.ipv4->protocol == IPPROTO_TCP) {
> + payload_len = ntohs(hdr.ipv4->tot_len) - hdr.ipv4->ihl * 4 -
> + th->doff * 4;
> + } else if ((skb->protocol == htons(ETH_P_IPV6) ||
> + hdr.ipv6->nexthdr == IPPROTO_TCP)) {
> + payload_l...
2007 Apr 18
2
[Bridge] Bridge and PACKET-socket
Ahoy,
I've encountered some confusing semantics with using PACKET(7) sockets
on bridge-enslaved interfaces. Specifically, if my socket accepts all
types of frame (bind() to ETH_P_ALL) then it gets all packets; but if
it accepts any specific type (e.g. ETH_P_IP), then it receives no
packets at all.
That is how it's coded in net/core/dev.c's netif_receive_skb(). First
ETH_P_ALL handlers are called, then the bridge, and then -- only if
the bridge declines the packet -- the protocol-specific handlers are
called.
My interpretation is that ETH_P_ALL...
2017 Jan 18
0
[PATCH net-next V5 3/3] tun: rx batching
...(skb);
+ local_bh_enable();
+ }
+}
+
/* Get packet from user space buffer */
static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
void *msg_control, struct iov_iter *from,
- int noblock)
+ int noblock, bool more)
{
struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) };
struct sk_buff *skb;
@@ -1283,9 +1321,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
rxhash = skb_get_hash(skb);
#ifndef CONFIG_4KSTACKS
- local_bh_disable();
- netif_receive_skb(skb);
- local_bh_enable();
+ tun_rx_batched(tun, tfile, skb, more);
#else...