Parcourir la source

core: Update netlink policy structure

Newer versions of kernel require attribute structs
to define lengths exactly.

Change-Id: I7195b4974cf18ff3b3cbeb4d2ed863ff97ab7b92
Acked-by: Ryan Chapman <[email protected]>
Signed-off-by: Conner Huff <[email protected]>
Conner Huff il y a 5 ans
Parent
commit
609413920b
1 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 6 3
      core/rmnet_genl.c

+ 6 - 3
core/rmnet_genl.c

@@ -9,15 +9,18 @@
 #include <net/sock.h>
 #include <linux/skbuff.h>
 
+#define RMNET_CORE_GENL_MAX_STR_LEN	255
+
 /* Static Functions and Definitions */
 static struct nla_policy rmnet_genl_attr_policy[RMNET_CORE_GENL_ATTR_MAX +
 						1] = {
 	[RMNET_CORE_GENL_ATTR_INT]  = { .type = NLA_S32 },
-	[RMNET_CORE_GENL_ATTR_PID_BPS] = { .len =
+	[RMNET_CORE_GENL_ATTR_PID_BPS] = { .type = NLA_EXACT_LEN, .len =
 				sizeof(struct rmnet_core_pid_bps_resp) },
-	[RMNET_CORE_GENL_ATTR_PID_BOOST] = { .len =
+	[RMNET_CORE_GENL_ATTR_PID_BOOST] = { .type = NLA_EXACT_LEN, .len =
 				sizeof(struct rmnet_core_pid_boost_req) },
-	[RMNET_CORE_GENL_ATTR_STR]  = { .type = NLA_NUL_STRING },
+	[RMNET_CORE_GENL_ATTR_STR]  = { .type = NLA_NUL_STRING, .len =
+				RMNET_CORE_GENL_MAX_STR_LEN },
 };
 
 #define RMNET_CORE_GENL_OP(_cmd, _func)			\