summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2018-07-27 04:59:57 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-27 16:34:53 -0400
commit3ae5536b808dced0af5b2e6768a41862620c779d (patch)
tree122db2a2d3e5fa68e84035dfb3c63fdf00d2e58d
parent3e4e36436047155f67eafffe3062a09db1dff8df (diff)
l2tp: ignore L2TP_ATTR_DATA_SEQ netlink attribute
The value of this attribute is never used. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/uapi/linux/l2tp.h7
-rw-r--r--net/l2tp/l2tp_core.h8
-rw-r--r--net/l2tp/l2tp_debugfs.c4
-rw-r--r--net/l2tp/l2tp_netlink.c6
4 files changed, 5 insertions, 20 deletions
diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h
index 7d570c7bd117..ae888606b3ec 100644
--- a/include/uapi/linux/l2tp.h
+++ b/include/uapi/linux/l2tp.h
@@ -65,9 +65,9 @@ struct sockaddr_l2tpip6 {
65 * TUNNEL_MODIFY - CONN_ID, udpcsum 65 * TUNNEL_MODIFY - CONN_ID, udpcsum
66 * TUNNEL_GETSTATS - CONN_ID, (stats) 66 * TUNNEL_GETSTATS - CONN_ID, (stats)
67 * TUNNEL_GET - CONN_ID, (...) 67 * TUNNEL_GET - CONN_ID, (...)
68 * SESSION_CREATE - SESSION_ID, PW_TYPE, data_seq, cookie, peer_cookie, l2spec 68 * SESSION_CREATE - SESSION_ID, PW_TYPE, cookie, peer_cookie, l2spec
69 * SESSION_DELETE - SESSION_ID 69 * SESSION_DELETE - SESSION_ID
70 * SESSION_MODIFY - SESSION_ID, data_seq 70 * SESSION_MODIFY - SESSION_ID
71 * SESSION_GET - SESSION_ID, (...) 71 * SESSION_GET - SESSION_ID, (...)
72 * SESSION_GETSTATS - SESSION_ID, (stats) 72 * SESSION_GETSTATS - SESSION_ID, (stats)
73 * 73 *
@@ -95,7 +95,7 @@ enum {
95 L2TP_ATTR_PW_TYPE, /* u16, enum l2tp_pwtype */ 95 L2TP_ATTR_PW_TYPE, /* u16, enum l2tp_pwtype */
96 L2TP_ATTR_ENCAP_TYPE, /* u16, enum l2tp_encap_type */ 96 L2TP_ATTR_ENCAP_TYPE, /* u16, enum l2tp_encap_type */
97 L2TP_ATTR_OFFSET, /* u16 (not used) */ 97 L2TP_ATTR_OFFSET, /* u16 (not used) */
98 L2TP_ATTR_DATA_SEQ, /* u16 */ 98 L2TP_ATTR_DATA_SEQ, /* u16 (not used) */
99 L2TP_ATTR_L2SPEC_TYPE, /* u8, enum l2tp_l2spec_type */ 99 L2TP_ATTR_L2SPEC_TYPE, /* u8, enum l2tp_l2spec_type */
100 L2TP_ATTR_L2SPEC_LEN, /* u8 (not used) */ 100 L2TP_ATTR_L2SPEC_LEN, /* u8 (not used) */
101 L2TP_ATTR_PROTO_VERSION, /* u8 */ 101 L2TP_ATTR_PROTO_VERSION, /* u8 */
@@ -169,6 +169,7 @@ enum l2tp_encap_type {
169 L2TP_ENCAPTYPE_IP, 169 L2TP_ENCAPTYPE_IP,
170}; 170};
171 171
172/* For L2TP_ATTR_DATA_SEQ. Unused. */
172enum l2tp_seqmode { 173enum l2tp_seqmode {
173 L2TP_SEQ_NONE = 0, 174 L2TP_SEQ_NONE = 0,
174 L2TP_SEQ_IP = 1, 175 L2TP_SEQ_IP = 1,
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index d85fde793a8c..7dbfb55ab3b5 100644
--- a/net/l2tp/l2tp_core.h
+++ b/net/l2tp/l2tp_core.h
@@ -45,10 +45,6 @@ struct l2tp_tunnel;
45 */ 45 */
46struct l2tp_session_cfg { 46struct l2tp_session_cfg {
47 enum l2tp_pwtype pw_type; 47 enum l2tp_pwtype pw_type;
48 unsigned int data_seq:2; /* data sequencing level
49 * 0 => none, 1 => IP only,
50 * 2 => all
51 */
52 unsigned int recv_seq:1; /* expect receive packets with 48 unsigned int recv_seq:1; /* expect receive packets with
53 * sequence numbers? */ 49 * sequence numbers? */
54 unsigned int send_seq:1; /* send packets with sequence 50 unsigned int send_seq:1; /* send packets with sequence
@@ -99,10 +95,6 @@ struct l2tp_session {
99 95
100 char name[32]; /* for logging */ 96 char name[32]; /* for logging */
101 char ifname[IFNAMSIZ]; 97 char ifname[IFNAMSIZ];
102 unsigned int data_seq:2; /* data sequencing level
103 * 0 => none, 1 => IP only,
104 * 2 => all
105 */
106 unsigned int recv_seq:1; /* expect receive packets with 98 unsigned int recv_seq:1; /* expect receive packets with
107 * sequence numbers? */ 99 * sequence numbers? */
108 unsigned int send_seq:1; /* send packets with sequence 100 unsigned int send_seq:1; /* send packets with sequence
diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
index b5d7dde003ef..91b9248610f0 100644
--- a/net/l2tp/l2tp_debugfs.c
+++ b/net/l2tp/l2tp_debugfs.c
@@ -191,12 +191,10 @@ static void l2tp_dfs_seq_session_show(struct seq_file *m, void *v)
191 if (session->send_seq || session->recv_seq) 191 if (session->send_seq || session->recv_seq)
192 seq_printf(m, " nr %hu, ns %hu\n", session->nr, session->ns); 192 seq_printf(m, " nr %hu, ns %hu\n", session->nr, session->ns);
193 seq_printf(m, " refcnt %d\n", refcount_read(&session->ref_count)); 193 seq_printf(m, " refcnt %d\n", refcount_read(&session->ref_count));
194 seq_printf(m, " config %d/%d/%c/%c/%s/%s %08x %u\n", 194 seq_printf(m, " config %d/%d/%c/%c/-/%s %08x %u\n",
195 session->mtu, session->mru, 195 session->mtu, session->mru,
196 session->recv_seq ? 'R' : '-', 196 session->recv_seq ? 'R' : '-',
197 session->send_seq ? 'S' : '-', 197 session->send_seq ? 'S' : '-',
198 session->data_seq == 1 ? "IPSEQ" :
199 session->data_seq == 2 ? "DATASEQ" : "-",
200 session->lns_mode ? "LNS" : "LAC", 198 session->lns_mode ? "LNS" : "LAC",
201 session->debug, 199 session->debug,
202 jiffies_to_msecs(session->reorder_timeout)); 200 jiffies_to_msecs(session->reorder_timeout));
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index 5b9900889e31..e4785f6966f6 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -560,9 +560,6 @@ static int l2tp_nl_cmd_session_create(struct sk_buff *skb, struct genl_info *inf
560 } 560 }
561 561
562 if (tunnel->version > 2) { 562 if (tunnel->version > 2) {
563 if (info->attrs[L2TP_ATTR_DATA_SEQ])
564 cfg.data_seq = nla_get_u8(info->attrs[L2TP_ATTR_DATA_SEQ]);
565
566 if (info->attrs[L2TP_ATTR_L2SPEC_TYPE]) { 563 if (info->attrs[L2TP_ATTR_L2SPEC_TYPE]) {
567 cfg.l2specific_type = nla_get_u8(info->attrs[L2TP_ATTR_L2SPEC_TYPE]); 564 cfg.l2specific_type = nla_get_u8(info->attrs[L2TP_ATTR_L2SPEC_TYPE]);
568 if (cfg.l2specific_type != L2TP_L2SPECTYPE_DEFAULT && 565 if (cfg.l2specific_type != L2TP_L2SPECTYPE_DEFAULT &&
@@ -693,9 +690,6 @@ static int l2tp_nl_cmd_session_modify(struct sk_buff *skb, struct genl_info *inf
693 if (info->attrs[L2TP_ATTR_DEBUG]) 690 if (info->attrs[L2TP_ATTR_DEBUG])
694 session->debug = nla_get_u32(info->attrs[L2TP_ATTR_DEBUG]); 691 session->debug = nla_get_u32(info->attrs[L2TP_ATTR_DEBUG]);
695 692
696 if (info->attrs[L2TP_ATTR_DATA_SEQ])
697 session->data_seq = nla_get_u8(info->attrs[L2TP_ATTR_DATA_SEQ]);
698
699 if (info->attrs[L2TP_ATTR_RECV_SEQ]) 693 if (info->attrs[L2TP_ATTR_RECV_SEQ])
700 session->recv_seq = nla_get_u8(info->attrs[L2TP_ATTR_RECV_SEQ]); 694 session->recv_seq = nla_get_u8(info->attrs[L2TP_ATTR_RECV_SEQ]);
701 695