Re: [PATCH] NET: SRv6: seg6_local: Fixed SRH processing when segments left is 0

2021-02-03 Thread Ahmed Abdelsalam
and 4.3 of [1] > respectively. > > Packets processed by End, End.X and End.T behaviors can have a Segment Left > Value > of zero. > > [1]https://tools.ietf.org/html/draft-ietf-spring-srv6-network-programming-28 > > Thanks, > Suprit J > > On Tue, Feb 2,

Re: [PATCH] NET: SRv6: seg6_local: Fixed SRH processing when segments left is 0

2021-02-02 Thread Ahmed Abdelsalam
uct sk_buff *skb, > > struct seg6_local_lwt *slwt) > > { > > struct ipv6_sr_hdr *srh; > > > > - srh = get_and_validate_srh(skb); > > + srh = get_srh(skb); > > if (!srh) > > goto drop; > > > > - advance_nextseg(srh, &ipv6

Re: [PATCH v2] IPv6: sr: Fix End.X nexthop to use oif.

2020-10-21 Thread Ahmed Abdelsalam
Tue, 20 Oct 2020 18:05:47 +0530 Reji Thomas wrote: > Hi Ahmed, > > > On Tue, Oct 20, 2020 at 3:04 PM Ahmed Abdelsalam > wrote: > > > > We are submitting the patch for End.DT4. End.DX4 is already there. > > > > So the optional parameter and OIF applies direc

Re: [PATCH v2] IPv6: sr: Fix End.X nexthop to use oif.

2020-10-20 Thread Ahmed Abdelsalam
We are submitting the patch for End.DT4. End.DX4 is already there. So the optional parameter and OIF applies directly to End.X/End.DX6/End.DX4. On Tue, 20 Oct 2020 11:28:29 +0200 Ahmed Abdelsalam wrote: > Jakub, Reji, > > Andrea (CC'ed) and I have been working on a patch th

Re: [PATCH v2] IPv6: sr: Fix End.X nexthop to use oif.

2020-10-20 Thread Ahmed Abdelsalam
gt; > As you say the OIF is only required for using link local addresses, > > so this change breaks perfectly legitimate configurations. > > > > Can we instead only warn about the missing OIF, and only do that when > > nh is link local? > > > End.X is defined as an adjacency-sid and is used to select a specific link to > a > neighbor for both global and link-local addresses. The intention was > to drop the > packet even for global addresses if the route via the specific > interface is not found. > Alternatively(believe semantically correct for End.X definition) I > could do a neighbor lookup > for nexthop address over specific interface and send the packet out. > > > Also doesn't SEG6_LOCAL_ACTION_END_DX6 need a similar treatment? > > Yes. I will update the patch for End.DX6 based on the patch finalized for > End.X. -- Ahmed Abdelsalam

Re: [net-next v5 1/2] seg6: inherit DSCP of inner IPv4 packets

2020-08-27 Thread Ahmed Abdelsalam
On 26/08/2020 21:41, David Ahern wrote: On 8/26/20 6:12 AM, Ahmed Abdelsalam wrote: On 26/08/2020 02:45, David Ahern wrote: On 8/25/20 5:45 PM, Ahmed Abdelsalam wrote: Hi David The seg6 encap is implemented through the seg6_lwt rather than seg6_local_lwt. ok. I don't know the

Re: [net-next v5 1/2] seg6: inherit DSCP of inner IPv4 packets

2020-08-26 Thread Ahmed Abdelsalam
On 26/08/2020 02:45, David Ahern wrote: On 8/25/20 5:45 PM, Ahmed Abdelsalam wrote: Hi David The seg6 encap is implemented through the seg6_lwt rather than seg6_local_lwt. ok. I don't know the seg6 code; just taking a guess from a quick look. We can add a flag(SEG6_IPTUNNEL_DSC

Re: [net-next v5 1/2] seg6: inherit DSCP of inner IPv4 packets

2020-08-25 Thread Ahmed Abdelsalam
On 25/08/2020 18:45, David Ahern wrote: On 8/25/20 10:02 AM, Ahmed Abdelsalam wrote: This patch allows SRv6 encapsulation to inherit the DSCP value of the inner IPv4 packet. This allows forwarding packet across the SRv6 fabric based on their original traffic class. The option is controlled

[net-next v5 1/2] seg6: inherit DSCP of inner IPv4 packets

2020-08-25 Thread Ahmed Abdelsalam
this feature. Signed-off-by: Ahmed Abdelsalam --- include/net/netns/ipv6.h | 1 + net/ipv6/seg6_iptunnel.c | 37 - net/ipv6/sysctl_net_ipv6.c | 9 + 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/include/net/netns/ipv6.h b/include

Re: [net-next v5 2/2] seg6: Add documentation for seg6_inherit_inner_ipv4_dscp sysctl

2020-08-25 Thread Ahmed Abdelsalam
On 25/08/2020 17:51, Jakub Kicinski wrote: On Tue, 25 Aug 2020 12:18:44 + Ahmed Abdelsalam wrote: + Enable the SRv6 encapsulation to inherit the DSCP value of the inner IPv4 packet. + + Default: FALSE (Do not inherit DSCP) + ``conf/default/*``: Change the interface

[net-next v5 2/2] seg6: Add documentation for seg6_inherit_inner_ipv4_dscp sysctl

2020-08-25 Thread Ahmed Abdelsalam
This patch adds a documentation for seg6_inherit_inner_ipv4_dscp sysctl into Documentation/networking/ip-sysctl.rst Signed-off-by: Ahmed Abdelsalam --- Documentation/networking/ip-sysctl.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/networking/ip-sysctl.rst b

[net-next v5 2/2] seg6: Add documentation for seg6_inherit_inner_ipv4_dscp sysctl

2020-08-25 Thread Ahmed Abdelsalam
This patch adds a documentation for seg6_inherit_inner_ipv4_dscp sysctl into Documentation/networking/ip-sysctl.rst Signed-off-by: Ahmed Abdelsalam --- Documentation/networking/ip-sysctl.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/networking/ip-sysctl.rst b

[net-next v5 1/2] seg6: inherit DSCP of inner IPv4 packets

2020-08-25 Thread Ahmed Abdelsalam
this feature. Signed-off-by: Ahmed Abdelsalam --- include/net/netns/ipv6.h | 1 + net/ipv6/seg6_iptunnel.c | 37 - net/ipv6/sysctl_net_ipv6.c | 9 + 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/include/net/netns/ipv6.h b/include

Re: [net-next v4] seg6: using DSCP of inner IPv4 packets

2020-08-25 Thread Ahmed Abdelsalam
On 25/08/2020 03:11, David Miller wrote: From: Ahmed Abdelsalam Date: Mon, 24 Aug 2020 08:51:24 + This patch allows copying the DSCP from inner IPv4 header to the outer IPv6 header, when doing SRv6 Encapsulation. This allows forwarding packet across the SRv6 fabric based on their

[net-next v4] seg6: using DSCP of inner IPv4 packets

2020-08-24 Thread Ahmed Abdelsalam
This patch allows copying the DSCP from inner IPv4 header to the outer IPv6 header, when doing SRv6 Encapsulation. This allows forwarding packet across the SRv6 fabric based on their original traffic class. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6_iptunnel.c | 36

Re: [PATCH] seg6: using DSCP of inner IPv4 packets

2020-08-15 Thread Ahmed Abdelsalam
Hi David, Sorry for the late reply. I'm on PTO with limited email access. I will revise the patch in the next weeks and make outer IPv6 header inherit Hop limit from Inner packet for the IPv6 case. Ahmed On 08/08/2020 02:43, David Miller wrote: From: Ahmed Abdelsalam Date: Thu,

Re: [PATCH] seg6: using DSCP of inner IPv4 packets

2020-08-05 Thread Ahmed Abdelsalam
] https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r6-6/segment-routing/configuration/guide/b-segment-routing-cg-asr9000-66x/b-segment-routing-cg-asr9000-66x_chapter_011.html#id_94209 On 06/08/2020 02:40, David Miller wrote: From: Ahmed Abdelsalam Date: Tue, 4 Aug 2020 07:40

Re: [net-next v2] seg6: using DSCP of inner IPv4 packets

2020-08-04 Thread Ahmed Abdelsalam
The problem was the declaration of tos. Fixed and new patch is sent. On 03/08/2020 21:48, Jakub Kicinski wrote: On Mon, 3 Aug 2020 18:14:17 + Ahmed Abdelsalam wrote: This patch allows copying the DSCP from inner IPv4 header to the outer IPv6 header, when doing SRv6 Encapsulation. This

[PATCH] seg6: using DSCP of inner IPv4 packets

2020-08-04 Thread Ahmed Abdelsalam
This patch allows copying the DSCP from inner IPv4 header to the outer IPv6 header, when doing SRv6 Encapsulation. This allows forwarding packet across the SRv6 fabric based on their original traffic class. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6_iptunnel.c | 36

[net-next v2] seg6: using DSCP of inner IPv4 packets

2020-08-03 Thread Ahmed Abdelsalam
This patch allows copying the DSCP from inner IPv4 header to the outer IPv6 header, when doing SRv6 Encapsulation. This allows forwarding packet across the SRv6 fabric based on their original traffic class. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6_iptunnel.c | 37

Re: [net-next] seg6: using DSCP of inner IPv4 packets

2020-07-31 Thread Ahmed Abdelsalam
I will refactor the code of this function and submit a new patch. Ahmed On 31/07/2020 01:44, David Miller wrote: From: Ahmed Abdelsalam Date: Tue, 28 Jul 2020 12:20:44 + This patch allows copying the DSCP from inner IPv4 header to the outer IPv6 header, when doing SRv6 Encapsulation

[net-next] seg6: using DSCP of inner IPv4 packets

2020-07-28 Thread Ahmed Abdelsalam
This patch allows copying the DSCP from inner IPv4 header to the outer IPv6 header, when doing SRv6 Encapsulation. This allows forwarding packet across the SRv6 fabric based on their original traffic class. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6_iptunnel.c | 11 ++- 1 file

[net] seg6: fix seg6_validate_srh() to avoid slab-out-of-bounds

2020-06-02 Thread Ahmed Abdelsalam
: syzbot+e8c028b62439eac42...@syzkaller.appspotmail.com Reported-by: YueHaibing Fixes: 0cb7498f234e ("seg6: fix SRH processing to comply with RFC8754") Signed-off-by: Ahmed Abdelsalam --- include/net/seg6.h | 2 +- net/core/filter.c| 2 +- net/ipv6/ipv6_sockglue.c | 2 +-

Re: [PATCH] seg6: Fix slab-out-of-bounds in fl6_update_dst()

2020-06-02 Thread Ahmed Abdelsalam
I’m already working on a fix for this bug. This patch leads to a bigger semantic problem as it will send SRv6 packets to the second segment not the first segment (as is does not exist in the SRH). Please see my explanation below. The main issue is the seg6_validate_srh() which is used to val

[net] seg6: fix SRH processing to comply with RFC8754

2020-05-04 Thread Ahmed Abdelsalam
validate the SRH as per RFC8754. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c index 4c7e0a27fa9c..e37d2b34cacc 100644 --- a/net/ipv6/seg6.c +++ b/net/ipv6/seg6.c @@ -28,6 +28,7 @@ bool

Re: [RFC PATCH 6/6] seg6: Add support to rearrange SRH for AH ICV calculation

2019-06-02 Thread Ahmed Abdelsalam
On Fri, 31 May 2019 10:34:03 -0700 Tom Herbert wrote: > On Fri, May 31, 2019 at 10:07 AM Ahmed Abdelsalam > wrote: > > > > On Fri, 31 May 2019 09:48:40 -0700 > > Tom Herbert wrote: > > > > > Mutable fields related to segment routing are: destination addre

Re: [RFC PATCH 6/6] seg6: Add support to rearrange SRH for AH ICV calculation

2019-05-31 Thread Ahmed Abdelsalam
consensus. For new features that still need to be reviewed we can have them outside the kernel tree for community to use. This way the community does not get blocked by IETF process but also keep the kernel tree stable. Thanks, Ahmed -- Ahmed Abdelsalam

Re: [PATCH net-next 6/6] seg6: Add support to rearrange SRH for AH ICV calculation

2019-05-31 Thread Ahmed Abdelsalam
should give the IETF community the time to review and reach a consensus on this draft. Thanks, Ahmed -- Ahmed Abdelsalam

[net-next v2] ipv6: sr: extract the right key values for "seg6_make_flowlabel"

2018-04-28 Thread Ahmed Abdelsalam
00 00 00 00 00 00 00 00 00 00 b2 00 00 0020: 00 00 00 00 00 00 00 00 00 00 00 02 fc 00 00 a1 0030: 00 00 00 00 00 00 00 00 00 00 00 0a Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6_iptunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/seg6_iptunnel.c

Re: [net-next] ipv6: sr: Extract the right key values for "seg6_make_flowlabel"

2018-04-28 Thread Ahmed Abdelsalam
On Fri, 27 Apr 2018 13:59:07 -0400 (EDT) David Miller wrote: > From: Ahmed Abdelsalam > Date: Thu, 26 Apr 2018 16:11:11 +0200 > > > @@ -119,6 +119,9 @@ int seg6_do_srh_encap(struct sk_buff *skb, struct > > ipv6_sr_hdr *osrh, int proto) > > int hdrlen, t

Re: [net-next] ipv6: sr: Add documentation for seg_flowlabel sysctl

2018-04-27 Thread Ahmed Abdelsalam
On Fri, 27 Apr 2018 08:47:14 -0700 Randy Dunlap wrote: > On 04/27/2018 03:35 AM, Ahmed Abdelsalam wrote: > > This patch adds a documentation for seg_flowlabel sysctl into > > Documentation/networking/ip-sysctl.txt > > > > Signed-off-by: Ahmed Abdelsalam > > ---

[net-next v2] ipv6: sr: Add documentation for seg_flowlabel sysctl

2018-04-27 Thread Ahmed Abdelsalam
This patch adds a documentation for seg_flowlabel sysctl into Documentation/networking/ip-sysctl.txt Signed-off-by: Ahmed Abdelsalam --- Documentation/networking/ip-sysctl.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/networking/ip-sysctl.txt b

[net-next] ipv6: sr: Add documentation for seg_flowlabel sysctl

2018-04-27 Thread Ahmed Abdelsalam
This patch adds a documentation for seg_flowlabel sysctl into Documentation/networking/ip-sysctl.txt Signed-off-by: Ahmed Abdelsalam --- Documentation/networking/ip-sysctl.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/networking/ip-sysctl.txt b

[net-next] ipv6: sr: Extract the right key values for "seg6_make_flowlabel"

2018-04-26 Thread Ahmed Abdelsalam
) IPv6 traffic: src_IP, dst_IP, L4 proto, and flowlabel of inner packet. 2) IPv4 traffic: src_IP, dst_IP, L4 proto, src_port, and dst_port 3) L2 traffic: depends on what kind of traffic carried into the L2 frame. IPv6 and IPv4 traffic works as discussed 1) and 2) Signed-off-by: Ahmed Abdelsalam

Re: [net-next v3] ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode

2018-04-26 Thread Ahmed Abdelsalam
On Wed, 25 Apr 2018 13:03:04 -0400 (EDT) David Miller wrote: > From: Ahmed Abdelsalam > Date: Tue, 24 Apr 2018 20:23:16 +0200 > > > ECMP (equal-cost multipath) hashes are typically computed on the packets' > > 5-tuple(src IP, dst IP, src port, dst port, L4 proto).

Re: [net-next v2] ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode

2018-04-24 Thread Ahmed Abdelsalam
On Tue, 24 Apr 2018 19:59:55 +0200 Ahmed Abdelsalam wrote: > This patch has been tested for IPv6, IPv4, and L2 traffic. > > Signed-off-by: Ahmed Abdelsalam > --- > include/net/netns/ipv6.h | 1 + > net/ipv6/seg6_iptunnel.c | 24 ++-- > net/ipv6/s

[net-next v3] ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode

2018-04-24 Thread Ahmed Abdelsalam
IPv4, and L2 traffic. Signed-off-by: Ahmed Abdelsalam --- include/net/netns/ipv6.h | 1 + net/ipv6/seg6_iptunnel.c | 24 ++-- net/ipv6/sysctl_net_ipv6.c | 8 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/include/net/netns/ipv6.h b/include/ne

[net-next v2] ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode

2018-04-24 Thread Ahmed Abdelsalam
r IPv6, IPv4, and L2 traffic. Signed-off-by: Ahmed Abdelsalam --- include/net/netns/ipv6.h | 1 + net/ipv6/seg6_iptunnel.c | 24 ++-- net/ipv6/sysctl_net_ipv6.c | 8 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/include/net/netns/ipv6.h b/include/ne

Re: [net-next 1/2] ipv6: sr: add a per namespace sysctl to control seg6 flowlabel

2018-04-24 Thread Ahmed Abdelsalam
On Tue, 24 Apr 2018 13:16:50 -0400 (EDT) David Miller wrote: > From: Ahmed Abdelsalam > Date: Mon, 23 Apr 2018 23:36:59 +0200 > > > This patch adds a per namespace sysctl, named 'seg6_flowlabel', to be used > > by seg6_do_srh_encap() to control the behaviour of

[net-next 2/2] ipv6: sr: Compute flowlabel of outer IPv6 header for seg6 encap mode

2018-04-23 Thread Ahmed Abdelsalam
namespace "seg6_flowlabel" sysctl value. This patch has been tested for IPv6, IPv4, and L2 traffic. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6_iptunnel.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/s

[net-next 1/2] ipv6: sr: add a per namespace sysctl to control seg6 flowlabel

2018-04-23 Thread Ahmed Abdelsalam
e of Inner IPv6 (0 for IPv4/L2) 1 Compute the flowlabel using seg6_make_flowlabel() Signed-off-by: Ahmed Abdelsalam --- include/net/netns/ipv6.h | 1 + net/ipv6/sysctl_net_ipv6.c | 8 2 files changed, 9 insertions(+) diff --git a/include/net/netns/ipv6.h b/include/net/netns/ip

Re: [nf-next] netfilter: extend SRH match to support matching previous, next and last SID

2018-04-23 Thread Ahmed Abdelsalam
On Mon, 23 Apr 2018 22:08:44 +0200 Florian Westphal wrote: > Ahmed Abdelsalam wrote: > > > > @@ -50,6 +62,12 @@ struct ip6t_srh { > > > > __u8segs_left; > > > > __u8last_entry; >

Re: [nf-next] netfilter: extend SRH match to support matching previous, next and last SID

2018-04-23 Thread Ahmed Abdelsalam
On Mon, 23 Apr 2018 19:30:47 +0200 Pablo Neira Ayuso wrote: > On Mon, Apr 23, 2018 at 05:48:22AM -0500, Ahmed Abdelsalam wrote: > > Signed-off-by: Ahmed Abdelsalam > > --- > > include/uapi/linux/netfilter_ipv6/ip6t_srh.h | 22 +-- > > ne

[nf-next] netfilter: extend SRH match to support matching previous, next and last SID

2018-04-23 Thread Ahmed Abdelsalam
previous SID, next SID, and last SID. Signed-off-by: Ahmed Abdelsalam --- include/uapi/linux/netfilter_ipv6/ip6t_srh.h | 22 +-- net/ipv6/netfilter/ip6t_srh.c| 41 +++- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/include/uapi

[iptables 2/2] extensions: libip6t_srh: add test-cases for matching previous, next and last SID

2018-04-23 Thread Ahmed Abdelsalam
This patch adds some test-cases to "libip6t_srh.t" for matching previous SID, next SID, and last SID. Signed-off-by: Ahmed Abdelsalam --- extensions/libip6t_srh.t | 4 1 file changed, 4 insertions(+) diff --git a/extensions/libip6t_srh.t b/extensions/libip6t_srh.t index 08897d

[iptables 1/2] extensions: libip6t_srh: support matching previous, next and last SID

2018-04-23 Thread Ahmed Abdelsalam
This patch extends the libip6t_srh shared library to support matching previous SID, next SID, and last SID. Signed-off-by: Ahmed Abdelsalam --- extensions/libip6t_srh.c| 65 - include/linux/netfilter_ipv6/ip6t_srh.h | 22 ++- 2 files

Re: [PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts

2018-04-22 Thread Ahmed Abdelsalam
On Sun, 22 Apr 2018 21:06:04 -0400 (EDT) David Miller wrote: > From: Ahmed Abdelsalam > Date: Fri, 20 Apr 2018 15:58:05 +0200 > > > In case of seg6 in encap mode, seg6_do_srh_encap() calls set_tun_src() > > in order to set the src addr of outer IPv6 header. > > >

Re: [PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts

2018-04-20 Thread Ahmed Abdelsalam
On Fri, 20 Apr 2018 15:38:08 +0100 David Lebrun wrote: > On 04/20/2018 02:58 PM, Ahmed Abdelsalam wrote: > > In case of seg6 in encap mode, seg6_do_srh_encap() calls set_tun_src() > > in order to set the src addr of outer IPv6 header. > > > > The net_device

[PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts

2018-04-20 Thread Ahmed Abdelsalam
end trace 71af7d093603885c ]--- Fixes: 8936ef7604c11 ipv6: sr: fix NULL pointer dereference when setting encap source address Signed-off-by: Ahmed Abdelsalam --- I tested the patch for IPv6 and IPv4 traffic net/ipv6/seg6_iptunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [nf-next] netfilter: Add support for inner IPv6 packet match

2018-01-26 Thread Ahmed Abdelsalam
Hi Pablo, > Hi Ahmed, > > On Thu, Jan 18, 2018 at 04:13:25PM +0100, Ahmed Abdelsalam wrote: > [...] > > diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_inner6.h > > b/include/uapi/linux/netfilter_ipv6/ip6t_inner6.h > Matching at inner headers is a very useful

[nf-next] netfilter: Add support for inner IPv6 packet match

2018-01-18 Thread Ahmed Abdelsalam
://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 Signed-off-by: Ahmed Abdelsalam --- include/uapi/linux/netfilter_ipv6/ip6t_inner6.h | 21 net/ipv6/netfilter/Kconfig | 10 ++ net/ipv6/netfilter/Makefile | 1 + net/ipv6/netfilter/ip6t_inner6.c

[iptables] extensions: add support for inner IPv6 packet 'inner6' match

2018-01-18 Thread Ahmed Abdelsalam
This patch adds a new exetension to iptables to inner IPv6 packet 'inner6' match. Signed-off-by: Ahmed Abdelsalam --- extensions/libip6t_inner6.c| 111 + extensions/libip6t_inner6.t| 4 ++ include/linux/netfilter_ipv6/ip6

[nf-next 1/3] netfilter: export SRH processing functions from seg6local

2018-01-15 Thread Ahmed Abdelsalam
() (3) seg6_lookup_nexthop Signed-off-by: Ahmed Abdelsalam --- include/net/seg6.h| 5 + net/ipv6/seg6_local.c | 37 - 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/include/net/seg6.h b/include/net/seg6.h index 099bad5..b637778 100644

[nf-next 2/3] netfilter: add an option to control iptables SEG6 target support

2018-01-15 Thread Ahmed Abdelsalam
This patch adds a new option CONFIG_IP6_NF_TARGET_SEG6 to enable/disable support of iptables SEG6 target. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/netfilter/Kconfig | 12 net/ipv6/netfilter/Makefile | 1 + 2 files changed, 13 insertions(+) diff --git a/net/ipv6/netfilter

[iptables 2/2] extensions: add some test cases for 'SEG6' target

2018-01-15 Thread Ahmed Abdelsalam
This patch adds some test cases for 'SEG6' target. Signed-off-by: Ahmed Abdelsalam --- extensions/libip6t_SEG6.t | 5 + 1 file changed, 5 insertions(+) create mode 100644 extensions/libip6t_SEG6.t diff --git a/extensions/libip6t_SEG6.t b/extensions/libip6t_SEG6.t new file m

[iptables 1/2] extensions: add support for 'SEG6' target

2018-01-15 Thread Ahmed Abdelsalam
This patch adds a new exetension to iptables to supprt IPv6 segment routing 'SEG6' target. Signed-off-by: Ahmed Abdelsalam --- extensions/libip6t_SEG6.c| 122 +++ include/linux/netfilter_ipv6/ip6t_SEG6.h | 17 + 2 files changed, 139

[nf-next 3/3] netfilter: Add support for IPv6 segment routing 'SEG6' target

2018-01-15 Thread Ahmed Abdelsalam
html/draft-clad-spring-segment-routing-service-chaining-00 Signed-off-by: Ahmed Abdelsalam --- include/uapi/linux/netfilter_ipv6/ip6t_SEG6.h | 18 net/ipv6/netfilter/ip6t_SEG6.c| 113 ++ 2 files changed, 131 insertions(+) create mode 100644 include/

Re: [iptables] extensions: add support for 'srh' match

2018-01-11 Thread Ahmed Abdelsalam
On Wed, 10 Jan 2018 16:32:24 +0100 Pablo Neira Ayuso wrote: > On Fri, Dec 29, 2017 at 12:08:25PM +0100, Ahmed Abdelsalam wrote: > > This patch adds a new exetension to iptables to supprt 'srh' match > > The implementation considers revision 7 of the SRH draft. > &

Re: [net-next] netfilter: add segment routing header 'srh' match

2018-01-07 Thread Ahmed Abdelsalam
On Sun, 7 Jan 2018 00:40:03 +0100 Pablo Neira Ayuso wrote: > Hi Ahmed, > > On Fri, Dec 29, 2017 at 12:07:52PM +0100, Ahmed Abdelsalam wrote: > > It allows matching packets based on Segment Routing Header > > (SRH) information. > > The implementation considers

Re: [net-next v2] ipv6: sr: export some functions of seg6local

2018-01-06 Thread Ahmed Abdelsalam
On Thu, 04 Jan 2018 13:37:33 -0500 (EST) David Miller wrote: > From: Ahmed Abdelsalam > Date: Sat, 30 Dec 2017 00:08:32 +0100 > > > Some functions of seg6local are very useful to process SRv6 > > encapsulated packets > > > > This patch exports some functions

[net-next v2] ipv6: sr: export some functions of seg6local

2018-01-02 Thread Ahmed Abdelsalam
) seg6_lookup_nexthop Signed-off-by: Ahmed Abdelsalam --- Functions names are prefixed with seg6_ include/net/seg6.h| 5 + net/ipv6/seg6_local.c | 37 - 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/include/net/seg6.h b/include/net/seg6.h index

Re: [net-next] netfilter: add segment routing header 'srh' match

2018-01-02 Thread Ahmed Abdelsalam
On Fri, 29 Dec 2017 12:07:52 +0100 Ahmed Abdelsalam wrote: > It allows matching packets based on Segment Routing Header > (SRH) information. > The implementation considers revision 7 of the SRH draft. > https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 &g

Re: [net-next] ipv6: sr: export some functions of seg6local

2018-01-02 Thread Ahmed Abdelsalam
Ok! Thanks David On Tue, 2 Jan 2018 20:11:48 + David Lebrun wrote: > On 12/29/2017 09:09 PM, Ahmed Abdelsalam wrote: > > Some functions of seg6local are very useful to process SRv6 > > encapsulated packets. > > > > This patch exports some functions of seg6local

[net-next] ipv6: sr: export some functions of seg6local

2018-01-02 Thread Ahmed Abdelsalam
-off-by: Ahmed Abdelsalam --- I'm writing some extensions to netfilter framework to support Segment Routing. These function are useful to process SR-encapsulated packets include/net/seg6.h| 4 net/ipv6/seg6_local.c | 11 +++ 2 files changed, 11 insertions(+), 4 deletions(-)

[iptables] extensions: add support for 'srh' match

2017-12-29 Thread Ahmed Abdelsalam
This patch adds a new exetension to iptables to supprt 'srh' match The implementation considers revision 7 of the SRH draft. https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 Signed-off-by: Ahmed Abdelsalam --- extensions/libip6t_srh.c

[net-next] netfilter: add segment routing header 'srh' match

2017-12-29 Thread Ahmed Abdelsalam
Left (4) Last Entry (5) Tag value of SRH Signed-off-by: Ahmed Abdelsalam --- include/uapi/linux/netfilter_ipv6/ip6t_srh.h | 63 ++ net/ipv6/netfilter/Kconfig | 9 ++ net/ipv6/netfilter/Makefile | 1 + net/ipv6/netfilter/ip6t_srh.c| 165

[net-next v2] ipv6: sr: update the struct ipv6_sr_hdr

2017-11-15 Thread Ahmed Abdelsalam
ot;reserved" field is changed to be "tag", In addition a comment is added to the "first_segment" field, showing that it represents the "Last Entry" field of the SRH. Signed-off-by: Ahmed Abdelsalam --- include/uapi/linux/seg6.h | 4 ++-- 1 file changed, 2 inse

Re: [PATCH] ipv6: sr: update the struct ipv6_sr_hdr

2017-11-15 Thread Ahmed Abdelsalam
On Wed, 15 Nov 2017 09:55:32 +0900 (KST) David Miller wrote: > From: Ahmed Abdelsalam > Date: Tue, 14 Nov 2017 15:31:48 +0100 > > > Also it will not make sense to have the field name differnent from the > > draft. > > That is the danger of defining user facing t

Re: [PATCH] ipv6: sr: update the struct ipv6_sr_hdr

2017-11-14 Thread Ahmed Abdelsalam
On Tue, 14 Nov 2017 14:14:01 + Edward Cree wrote: > On 14/11/17 12:37, David Miller wrote: > > From: Ahmed Abdelsalam > > Date: Sun, 12 Nov 2017 21:37:01 +0100 > > > >> diff --git a/include/uapi/linux/seg6.h b/include/uapi/linux/seg6.h > >> index 2f6

[PATCH] ipv6: sr: update the struct ipv6_sr_hdr

2017-11-12 Thread Ahmed Abdelsalam
t also update the different parts of the kernel that were using the old fields names. Signed-off-by: Ahmed Abdelsalam --- This patch is tested by re-compiling the whole kernel after the changes. include/uapi/linux/seg6.h | 4 ++-- net/ipv6/exthdrs.c| 2 +- net/ipv6/seg6.c |

[PATCH v2] ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"

2017-08-30 Thread Ahmed Abdelsalam
). This patch fixes the get_srh(), so it gets the segment routing header regardless of its position in the chain of the extension headers in IPv6 packet, and makes sure that the IPv6 routing extension header is of Type 4. Signed-off-by: Ahmed Abdelsalam --- The patch is tested for IPv6 packets that

Re: [PATCH] ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"

2017-08-28 Thread Ahmed Abdelsalam
On Mon, 28 Aug 2017 19:48:15 +0100 David Lebrun wrote: > On 08/28/2017 07:20 PM, Ahmed Abdelsalam wrote: > > This patch fixes the get_srh(), so it gets the segment routing header > > regardless of its position in the chain of the extension headers in IPv6 > > packet, and mak

[PATCH] ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"

2017-08-28 Thread Ahmed Abdelsalam
). This patch fixes the get_srh(), so it gets the segment routing header regardless of its position in the chain of the extension headers in IPv6 packet, and makes sure that the IPv6 routing extension header is of Type 4. Signed-off-by: Ahmed Abdelsalam --- net/ipv6/seg6_local.c | 16