[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 <amsala...@gmail.com> --- The patch is

[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 <amsala...@gmail.com> --- net/ipv6/seg6_l

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 <david.leb...@uclouvain.be> 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 heade

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 <ec...@solarflare.com> wrote: > On 14/11/17 12:37, David Miller wrote: > > From: Ahmed Abdelsalam <amsala...@gmail.com> > > Date: Sun, 12 Nov 2017 21:37:01 +0100 > > > >> diff --git a/include/uapi/linux/seg

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 <da...@davemloft.net> wrote: > From: Ahmed Abdelsalam <amsala...@gmail.com> > Date: Tue, 14 Nov 2017 15:31:48 +0100 > > > Also it will not make sense to have the field name differnent from the > > draft. &g

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

2017-11-15 Thread Ahmed Abdelsalam
t "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 <amsala...@gmail.com> --- include/uapi/linux/seg6.h | 4 ++--

[PATCH] ipv6: sr: update the struct ipv6_sr_hdr

2017-11-12 Thread Ahmed Abdelsalam
raft. It also update the different parts of the kernel that were using the old fields names. Signed-off-by: Ahmed Abdelsalam <amsala...@gmail.com> --- 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-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 <amsala...@gmail.com> --- Documentation/networking/ip-sysctl.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/network

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 <rdun...@infradead.org> 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

[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 <amsala...@gmail.com> --- Documentation/networking/ip-sysctl.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/Documentation/network

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 <da...@davemloft.net> wrote: > From: Ahmed Abdelsalam <amsala...@gmail.com> > 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_

[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 <amsala...@gmail.com> --- net/ipv6/seg6_iptunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi

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 <da...@davemloft.net> wrote: > From: Ahmed Abdelsalam <amsala...@gmail.com> > Date: Tue, 24 Apr 2018 20:23:16 +0200 > > > ECMP (equal-cost multipath) hashes are typically computed on the packets' > > 5-tuple(s

[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 <amsala...@gmail.com> --- extensions/libip6t

[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 <amsala...@gmail.com> --- include/uapi/linux/netfilter_ipv6/ip6t_srh.h | 63 ++ net/ipv6/netfilter/Kconfig | 9 ++ net/ipv6/netfilter/Makefile | 1 + net/ipv6/netfilter/ip6t

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 <da...@davemloft.net> wrote: > From: Ahmed Abdelsalam <amsala...@gmail.com> > Date: Sat, 30 Dec 2017 00:08:32 +0100 > > > Some functions of seg6local are very useful to process SRv6 > > encapsulated packets

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 <pa...@netfilter.org> 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 im

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 <pa...@netfilter.org> 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

[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 <amsala...@gmail.com> --- include/uapi/linux/netfilter_ipv6/ip6t_inner6.h | 21 net/ipv6/netfilter/Kconfig | 10 ++ net/ipv6/netfilter/Makefile | 1 + ne

[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 <amsala...@gmail.com> --- extensions/libip6t_inner6.c| 111 + extensions/libip6t_inner6.t| 4 ++ include

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

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

[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 <amsala...@gmail.com> --- 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

[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 <amsala...@gmail.com> --- extensions/libip6t_SEG6.c| 122 +++ include/linux/netfilter_ipv6/ip6t_SEG6.h | 17 + 2

[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 <amsala...@gmail.com> --- 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

[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 <amsala...@gmail.com> --- net/ipv6/netfilter/Kconfig | 12 net/ipv6/netfilter/Makefile | 1 + 2 files changed, 13 insertions(+) diff

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 ver

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

2018-01-02 Thread Ahmed Abdelsalam
-off-by: Ahmed Abdelsalam <amsala...@gmail.com> --- 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 inse

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 <amsala...@gmail.com> 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

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 <dav.leb...@gmail.com> 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 ex

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

2018-01-02 Thread Ahmed Abdelsalam
) seg6_lookup_nexthop Signed-off-by: Ahmed Abdelsalam <amsala...@gmail.com> --- 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/i

[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 <amsala...@gmail.com> --- I tested the patch for IPv6 and IPv4 traffic net/ipv6/seg6_iptunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 de

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 <dav.leb...@gmail.com> 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. > > >

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 <da...@davemloft.net> wrote: > From: Ahmed Abdelsalam <amsala...@gmail.com> > Date: Mon, 23 Apr 2018 23:36:59 +0200 > > > This patch adds a per namespace sysctl, named 'seg6_flowlabel', to be used > >

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

2018-04-24 Thread Ahmed Abdelsalam
nd L2 traffic. Signed-off-by: Ahmed Abdelsalam <amsala...@gmail.com> --- 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.

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

2018-04-24 Thread Ahmed Abdelsalam
affic. Signed-off-by: Ahmed Abdelsalam <amsala...@gmail.com> --- 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/

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 <amsala...@gmail.com> wrote: > This patch has been tested for IPv6, IPv4, and L2 traffic. > > Signed-off-by: Ahmed Abdelsalam <amsala...@gmail.com> > --- > include/net/netns/ipv6.h | 1 + > n

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

2018-04-23 Thread Ahmed Abdelsalam
On Sun, 22 Apr 2018 21:06:04 -0400 (EDT) David Miller <da...@davemloft.net> wrote: > From: Ahmed Abdelsalam <amsala...@gmail.com> > 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

[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 <amsala...@gmail.com> --- include/uapi/linux/netfilter_ipv6/ip6t_srh.h | 22 +-- net/ipv6/netfilter/ip6t_srh.c| 41 +++- 2 files changed, 60 insertions(+), 3 deletions(-)

[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 <amsala...@gmail.com> --- extensions/libip6t_srh.t | 4 1 file changed, 4 insertions(+) diff --git a/extensions/libip6t_srh.t b/extensio

[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 <amsala...@gmail.com> --- extensions/libip6t_srh.c| 65 - include/linux/netfilter_ipv6/ip6t_srh.

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 <f...@strlen.de> wrote: > Ahmed Abdelsalam <amsala...@gmail.com> wrote: > > > > @@ -50,6 +62,12 @@ struct ip6t_srh { > > > > __u8segs_left; > > > > __u8

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

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

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

2018-04-23 Thread Ahmed Abdelsalam
IPv6 (0 for IPv4/L2) 1 Compute the flowlabel using seg6_make_flowlabel() Signed-off-by: Ahmed Abdelsalam <amsala...@gmail.com> --- 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/inclu

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 <pa...@netfilter.org> wrote: > On Mon, Apr 23, 2018 at 05:48:22AM -0500, Ahmed Abdelsalam wrote: > > Signed-off-by: Ahmed Abdelsalam <amsala...@gmail.com> > > --- > > include/uapi/linux/netfilter_ipv6/ip6t_sr

[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