summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2020-10-29 15:05:01 +0800
committerJakub Kicinski <kuba@kernel.org>2020-10-30 15:24:06 -0700
commite8a3001c2120c760017da81a307308572a3cdbbc (patch)
treea6770ee9418f7523fb534ced95ed9204ed1c2880 /include/net
parent89ba49171fb22c130be4786d5ada9dda33dd7801 (diff)
sctp: add encap_port for netns sock asoc and transport
encap_port is added as per netns/sock/assoc/transport, and the latter one's encap_port inherits the former one's by default. The transport's encap_port value would mostly decide if one packet should go out with udp encapsulated or not. This patch also allows users to set netns' encap_port by sysctl. v1->v2: - Change to define encap_port as __be16 for sctp_sock, asoc and transport. v2->v3: - No change. v3->v4: - Add 'encap_port' entry in ip-sysctl.rst. v4->v5: - Improve the description of encap_port in ip-sysctl.rst. Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netns/sctp.h2
-rw-r--r--include/net/sctp/structs.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h
index 247b401a0f52..a0f315effa94 100644
--- a/include/net/netns/sctp.h
+++ b/include/net/netns/sctp.h
@@ -27,6 +27,8 @@ struct netns_sctp {
struct sock *udp6_sock;
/* UDP tunneling listening port. */
int udp_port;
+ /* UDP tunneling remote encap port. */
+ int encap_port;
/* This is the global local address list.
* We actively maintain this complete list of addresses on
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0bdff38eb4bb..aa98e7e659ac 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -178,6 +178,8 @@ struct sctp_sock {
*/
__u32 hbinterval;
+ __be16 encap_port;
+
/* This is the max_retrans value for new associations. */
__u16 pathmaxrxt;
@@ -877,6 +879,8 @@ struct sctp_transport {
*/
unsigned long last_time_ecne_reduced;
+ __be16 encap_port;
+
/* This is the max_retrans value for the transport and will
* be initialized from the assocs value. This can be changed
* using the SCTP_SET_PEER_ADDR_PARAMS socket option.
@@ -1790,6 +1794,8 @@ struct sctp_association {
*/
unsigned long hbinterval;
+ __be16 encap_port;
+
/* This is the max_retrans value for new transports in the
* association.
*/