net,man - IP_NODEFRAG option for IPv4 socket
Subsystems (5)
cover net,man - IP_NODEFRAG option for IPv4 socket
hi,
this series contains patch for IP_NODEFRAG option for RAW sockets, and changes for man pages.
I'm sending this together, hope it's ok.
1/2 - net - IP_NODEFRAG option for IPv4 socket
2/2 - man - IP_NODEFRAG option for IPv4 socket
wbr,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1276600052-16499-1-git-send-email-jolsa-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
PATCH 1/2 net - IP_NODEFRAG option for IPv4 socket
hi,
this patch is implementing IP_NODEFRAG option for IPv4 socket. The reason is, there's no other way to send out the packet with user customized header of the reassembly part.
wbr,
jirka
--- include/linux/in.h | 1 + include/net/inet_sock.h | 3 ++- net/ipv4/af_inet.c | 2 ++ net/ipv4/ip_sockglue.c | 9 ++++++++- net/ipv4/netfilter/nf_defrag_ipv4.c | 5 +++++ 5 files changed, 18 insertions(+), 2 deletions(-)
include/linux/in.h +1 -0
@@ -85,6 +85,7 @@ struct in_addr {#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR#define IP_MINTTL 21 +#define IP_NODEFRAG 22/* IP_MTU_DISCOVER values */ #define IP_PMTUDISC_DONT 0/* Never send DF frames */
include/net/inet_sock.h +2 -1
@@ -137,7 +137,8 @@ struct inet_sock { hdrincl:1, mc_loop:1, transparent:1, - mc_all:1; + mc_all:1, + nodefrag:1;int mc_index;__be32 mc_addr;struct ip_mc_socklist *mc_list;
net/ipv4/af_inet.c +2 -0
@@ -355,6 +355,8 @@ lookup_protocol: inet =inet_sk (sk); inet->is_icsk = (INET_PROTOSW_ICSK & answer_flags) !=0 ; + inet->nodefrag =0 ; +if (SOCK_RAW == sock->type) { inet->inet_num = protocol;if (IPPROTO_RAW == protocol)
net/ipv4/ip_sockglue.c +8 -1
@@ -449,7 +449,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, (1 <<IP_MTU_DISCOVER ) | (1 <<IP_RECVERR ) | (1 <<IP_ROUTER_ALERT ) | (1 <<IP_FREEBIND ) | (1 <<IP_PASSSEC ) | (1 <<IP_TRANSPARENT ) | - (1<<IP_MINTTL))) || + (1<<IP_MINTTL) | (1<<IP_NODEFRAG))) || optname ==IP_MULTICAST_TTL || optname ==IP_MULTICAST_ALL || optname == IP_MULTICAST_LOOP ||
@@ -572,6 +572,13 @@ static int do_ip_setsockopt(struct sock *sk, int level, } inet->hdrincl = val ?1 :0 ;break ; +case IP_NODEFRAG : +if (sk->sk_type !=SOCK_RAW ) { + err = -ENOPROTOOPT ; +break ; + } + inet->nodefrag = val ?1 :0 ; +break ;case IP_MTU_DISCOVER :if (val <IP_PMTUDISC_DONT || val >IP_PMTUDISC_PROBE ) goto e_inval;
net/ipv4/netfilter/nf_defrag_ipv4.c +5 -0
@@ -66,6 +66,11 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum,const struct net_device *out, int (*okfn)(struct sk_buff *)) { + struct inet_sock *inet = inet_sk(skb->sk); + +if (inet && inet->nodefrag) +return NF_ACCEPT ; +#if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )#if !defined(CONFIG_NF_NAT ) && !defined(CONFIG_NF_NAT_MODULE )/* Previously seen (loopback)? Ignore. Do this before
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] net - IP_NODEFRAG option for IPv4 socket
From: Jiri Olsa <[email protected]>
Date: Tue, 15 Jun 2010 13:07:31 +0200
Quoted 5 lines
this patch is implementing
IP_NODEFRAGoption for IPv4 socket. The reason is, there's no other way to send out the packet with user customized header of the reassembly part.Signed-off-by Jiri Olsa <[email protected]>
Applied to net-next-2.6, thanks!
PATCH 2/2 man - IP_NODEFRAG option for IPv4 socket
In reply to Jiri Olsahi,
this patch adds description for IP_NODEFRAG option for IPv4 socket.
wbr,
jirka
--- man7/ip.7 | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
man7/ip.7 +6 -0
@@ -705,6 +705,12 @@ socket option (see .BR IP_TTL " (since Linux 1.0)" Set or retrieve the current time-to-live field that is used in every packet sent from this socket. +.TP +.BR IP_NODEFRAG " (since Linux 2.6)" +If enabled, the reassembly of outgoing packets is disabled in the netfilter layer. +Only valid for +.B SOCK_RAW +sockets. .\" FIXME Document IP_XFRM_POLICY .\" Since Linux 2.5.48 .\" Needs CAP_NET_ADMIN
Re: [PATCH 2/2] man - IP_NODEFRAG option for IPv4 socket
Hi Jiri,
Thanks for this patch. See below.
Quoted 18 lines · Jiri Olsa
hi,
this patch adds description for
IP_NODEFRAGoption for IPv4 socket.wbr,
jirkaSigned-off-by Jiri Olsa <[email protected]>---
man7/ip.7 | 6 ++++++1 files changed, 6 insertions(+), 0 deletions(-)man7/ip.7 +0
-0@@ -705,6 +705,12 @@ socket option (see
Quoted 5 lines
.BR
IP_TTL" (since Linux 1.0)"
Set or retrieve the current time-to-live field that is used in every packet sent from this socket.
+.TP
+.BRIP_NODEFRAG" (since Linux 2.6)"
here, we'd write the exact version in which the flag is added. It looks like that might be 2.36, right?
Otherwise, this patch looks fine.
Cheers,
Michael
Quoted 12 lines
man7/ip.7 +4
-0+If enabled, the reassembly of outgoing packets is disabled in the netfilter layer. +Only valid for +.B SOCK_RAW +sockets..\" FIXME Document
IP_XFRM_POLICY
.\" Since Linux 2.5.48
.\" NeedsCAP_NET_ADMIN
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface" http://blog.man7.org/ -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): AANLkTim4N5rc8Sn_uo5bXsb9vjvKd3GTQD3p-1uApbB8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 2/2] man - IP_NODEFRAG option for IPv4 socket
From: Michael Kerrisk <[email protected]>
Date: Sat, 26 Jun 2010 15:01:03 +0200
Quoted 6 lines
Quoted 3 lines
sent from this socket.
+.TP
+.BRIP_NODEFRAG" (since Linux 2.6)"here, we'd write the exact version in which the flag is added. It looks like that might be 2.36, right?
It'll show up in 2.6.36
I doubt I'll be alive when we make it to 2.36 :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 2/2 man - IP_NODEFRAG option for IPv4 socket
Quoted 7 lines · David Miller
From: Michael Kerrisk <[email protected]>
Date: Sat, 26 Jun 2010 15:01:03 +0200Quoted 4 lines
Quoted 3 lines
sent from this socket.
+.TP
+.BRIP_NODEFRAG" (since Linux 2.6)"
Quoted 6 lines
Quoted 2 lines
here, we'd write the exact version in which the flag is added. It looks like that might be 2.36, right?
It'll show up in 2.6.36
I doubt I'll be alive when we make it to 2.36 :-)
:) ok, attaching changed patch
thanks,
jirka
---
hi,
this patch adds description for IP_NODEFRAG option for IPv4 socket.
wbr,
jirka
--- man7/ip.7 | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
man7/ip.7 +6 -0
@@ -705,6 +705,12 @@ socket option (see .BR IP_TTL " (since Linux 1.0)" Set or retrieve the current time-to-live field that is used in every packet sent from this socket. +.TP +.BR IP_NODEFRAG " (since Linux 2.6.36)" +If enabled, the reassembly of outgoing packets is disabled in the netfilter layer. +Only valid for +.B SOCK_RAW +sockets. .\" FIXME Document IP_XFRM_POLICY .\" Since Linux 2.5.48 .\" Needs CAP_NET_ADMIN
A message that is not in the archive (sent off-list or not yet received): 20100626191315.GA2076-Wm2NNL2RFAC1BuvyT83C0lrZeV2/+9ztveTR/[email protected]
Re: [PATCH 2/2 v2] man - IP_NODEFRAG option for IPv4 socket
Hello Jiri
Quoted 8 lines · Jiri Olsa
Quoted 7 lines · David Miller
From: Michael Kerrisk <[email protected]>
Date: Sat, 26 Jun 2010 15:01:03 +0200Quoted 4 lines
Quoted 3 lines
sent from this socket.
+.TP
+.BRIP_NODEFRAG" (since Linux 2.6)"
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
here, we'd write the exact version in which the flag is added. It looks like that might be 2.36, right?
It'll show up in 2.6.36
I doubt I'll be alive when we make it to 2.36 :-)
:) ok, attaching changed patch
I tweaked that slightly, and applied the below for man-pages-3.27.
Thanks,
Michael
man7/ip.7 +0 -0
@@ -399,6 +399,14 @@ The default is 1 which means that multicast
packets don't leave the local
network unless the user program explicitly requests it. Argument is an integer.
.TP
+.BR IP_NODEFRAG " (since Linux 2.6.36)"
+If enabled (argument is nonzero),
+the reassembly of outgoing packets is disabled in the netfilter layer. +This option is only valid for
+.B SOCK_RAW
+sockets.
+The argument is an integer.
+.TP
.BR IP_OPTIONS " (since Linux 2.0)"
.\" Precisely: 1.3.30
Set or get the IP options to be sent with every packet from this socket.
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
hi,
any feedback?
thanks,
jirka
Quoted 16 lines · Jiri Olsa
hi,
this series contains patch for
IP_NODEFRAGoption for RAW sockets, and changes for man pages.I'm sending this together, hope it's ok.
1/2 - net -
IP_NODEFRAGoption for IPv4 socket
2/2 - man -IP_NODEFRAGoption for IPv4 socketwbr,
jirka
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Patrick McHardy
Acked-byQuoted 3 lines · Jiri Olsa
hi,
any feedback?
Your patch seems fine to me.
Quoted 15 lines
thanks,
jirkaQuoted 10 lines · Jiri Olsa
hi,
this series contains patch for
IP_NODEFRAGoption for RAW sockets, and changes for man pages.I'm sending this together, hope it's ok.
1/2 - net -
IP_NODEFRAGoption for IPv4 socket
2/2 - man -IP_NODEFRAGoption for IPv4 socket