UAPI errors handling
This commit is contained in:
@@ -61,7 +61,7 @@ diff --color -urN -x uapi -x compat -x crypto -x .idea -x tests -x Kbuild -x Kco
|
|||||||
+
|
+
|
||||||
+ if (asc->junk_packet_count < 0) {
|
+ if (asc->junk_packet_count < 0) {
|
||||||
+ net_dbg_ratelimited("%s: JunkPacketCount should be non negative\n", dev->name);
|
+ net_dbg_ratelimited("%s: JunkPacketCount should be non negative\n", dev->name);
|
||||||
+ ret = -1;
|
+ ret = -EINVAL;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ wg->advanced_security_config.junk_packet_count = asc->junk_packet_count;
|
+ wg->advanced_security_config.junk_packet_count = asc->junk_packet_count;
|
||||||
@@ -82,12 +82,12 @@ diff --color -urN -x uapi -x compat -x crypto -x .idea -x tests -x Kbuild -x Kco
|
|||||||
+ net_dbg_ratelimited("%s: JunkPacketMaxSize: %d; should be smaller than maxSegmentSize: %d\n",
|
+ net_dbg_ratelimited("%s: JunkPacketMaxSize: %d; should be smaller than maxSegmentSize: %d\n",
|
||||||
+ dev->name, asc->junk_packet_max_size,
|
+ dev->name, asc->junk_packet_max_size,
|
||||||
+ MESSAGE_MAX_SIZE);
|
+ MESSAGE_MAX_SIZE);
|
||||||
+ ret = -1;
|
+ ret = -EINVAL;
|
||||||
+ } else if (asc->junk_packet_max_size < asc->junk_packet_min_size) {
|
+ } else if (asc->junk_packet_max_size < asc->junk_packet_min_size) {
|
||||||
+ net_dbg_ratelimited("%s: maxSize: %d; should be greater than minSize: %d\n",
|
+ net_dbg_ratelimited("%s: maxSize: %d; should be greater than minSize: %d\n",
|
||||||
+ dev->name, asc->junk_packet_max_size,
|
+ dev->name, asc->junk_packet_max_size,
|
||||||
+ asc->junk_packet_min_size);
|
+ asc->junk_packet_min_size);
|
||||||
+ ret = -1;
|
+ ret = -EINVAL;
|
||||||
+ } else
|
+ } else
|
||||||
+ wg->advanced_security_config.junk_packet_max_size = asc->junk_packet_max_size;
|
+ wg->advanced_security_config.junk_packet_max_size = asc->junk_packet_max_size;
|
||||||
+
|
+
|
||||||
@@ -98,7 +98,7 @@ diff --color -urN -x uapi -x compat -x crypto -x .idea -x tests -x Kbuild -x Kco
|
|||||||
+ net_dbg_ratelimited("%s: init header size (%d) + junkSize (%d) should be smaller than maxSegmentSize: %d\n",
|
+ net_dbg_ratelimited("%s: init header size (%d) + junkSize (%d) should be smaller than maxSegmentSize: %d\n",
|
||||||
+ dev->name, MESSAGE_INITIATION_SIZE,
|
+ dev->name, MESSAGE_INITIATION_SIZE,
|
||||||
+ asc->init_packet_junk_size, MESSAGE_MAX_SIZE);
|
+ asc->init_packet_junk_size, MESSAGE_MAX_SIZE);
|
||||||
+ ret = -1;
|
+ ret = -EINVAL;
|
||||||
+ } else
|
+ } else
|
||||||
+ wg->advanced_security_config.init_packet_junk_size = asc->init_packet_junk_size;
|
+ wg->advanced_security_config.init_packet_junk_size = asc->init_packet_junk_size;
|
||||||
+
|
+
|
||||||
@@ -109,7 +109,7 @@ diff --color -urN -x uapi -x compat -x crypto -x .idea -x tests -x Kbuild -x Kco
|
|||||||
+ net_dbg_ratelimited("%s: response header size (%d) + junkSize (%d) should be smaller than maxSegmentSize: %d\n",
|
+ net_dbg_ratelimited("%s: response header size (%d) + junkSize (%d) should be smaller than maxSegmentSize: %d\n",
|
||||||
+ dev->name, MESSAGE_RESPONSE_SIZE,
|
+ dev->name, MESSAGE_RESPONSE_SIZE,
|
||||||
+ asc->response_packet_junk_size, MESSAGE_MAX_SIZE);
|
+ asc->response_packet_junk_size, MESSAGE_MAX_SIZE);
|
||||||
+ ret = -1;
|
+ ret = -EINVAL;
|
||||||
+ } else
|
+ } else
|
||||||
+ wg->advanced_security_config.response_packet_junk_size = asc->response_packet_junk_size;
|
+ wg->advanced_security_config.response_packet_junk_size = asc->response_packet_junk_size;
|
||||||
+
|
+
|
||||||
@@ -148,7 +148,7 @@ diff --color -urN -x uapi -x compat -x crypto -x .idea -x tests -x Kbuild -x Kco
|
|||||||
+ asc->response_packet_magic_header,
|
+ asc->response_packet_magic_header,
|
||||||
+ asc->cookie_packet_magic_header,
|
+ asc->cookie_packet_magic_header,
|
||||||
+ asc->transport_packet_magic_header);
|
+ asc->transport_packet_magic_header);
|
||||||
+ ret = -1;
|
+ ret = -EINVAL;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (MESSAGE_INITIATION_SIZE + asc->init_packet_junk_size == MESSAGE_RESPONSE_SIZE + asc->response_packet_junk_size) {
|
+ if (MESSAGE_INITIATION_SIZE + asc->init_packet_junk_size == MESSAGE_RESPONSE_SIZE + asc->response_packet_junk_size) {
|
||||||
@@ -156,7 +156,7 @@ diff --color -urN -x uapi -x compat -x crypto -x .idea -x tests -x Kbuild -x Kco
|
|||||||
+ dev->name,
|
+ dev->name,
|
||||||
+ MESSAGE_INITIATION_SIZE + asc->init_packet_junk_size,
|
+ MESSAGE_INITIATION_SIZE + asc->init_packet_junk_size,
|
||||||
+ MESSAGE_RESPONSE_SIZE + asc->response_packet_junk_size);
|
+ MESSAGE_RESPONSE_SIZE + asc->response_packet_junk_size);
|
||||||
+ ret = -1;
|
+ ret = -EINVAL;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ wg->advanced_security_config.advanced_security_enabled = a_sec_on;
|
+ wg->advanced_security_config.advanced_security_enabled = a_sec_on;
|
||||||
|
|||||||
Reference in New Issue
Block a user