All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] bareudp: Fixed multiproto mode configuration
@ 2020-06-15  5:39 Martin Varghese
  2020-06-15 19:55 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Varghese @ 2020-06-15  5:39 UTC (permalink / raw)
  To: netdev, davem; +Cc: Martin

From: Martin <martin.varghese@nokia.com>

Code to handle multiproto configuration is missing.

Fixes: 4b5f67232d95 ("net: Special handling for IP & MPLS")
Signed-off-by: Martin <martin.varghese@nokia.com>
---
 drivers/net/bareudp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index efd1a1d..3dd46cd 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -552,6 +552,8 @@ static int bareudp_validate(struct nlattr *tb[], struct nlattr *data[],
 static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf,
 			struct netlink_ext_ack *extack)
 {
+	memset(conf, 0, sizeof(*conf));
+
 	if (!data[IFLA_BAREUDP_PORT]) {
 		NL_SET_ERR_MSG(extack, "port not specified");
 		return -EINVAL;
@@ -570,6 +572,9 @@ static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf,
 	if (data[IFLA_BAREUDP_SRCPORT_MIN])
 		conf->sport_min =  nla_get_u16(data[IFLA_BAREUDP_SRCPORT_MIN]);
 
+	if (data[IFLA_BAREUDP_MULTIPROTO_MODE])
+		conf->multi_proto_mode = true;
+
 	return 0;
 }
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] bareudp: Fixed multiproto mode configuration
  2020-06-15  5:39 [PATCH net] bareudp: Fixed multiproto mode configuration Martin Varghese
@ 2020-06-15 19:55 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-06-15 19:55 UTC (permalink / raw)
  To: martinvarghesenokia; +Cc: netdev, martin.varghese

From: Martin Varghese <martinvarghesenokia@gmail.com>
Date: Mon, 15 Jun 2020 11:09:29 +0530

> From: Martin <martin.varghese@nokia.com>
> 
> Code to handle multiproto configuration is missing.
> 
> Fixes: 4b5f67232d95 ("net: Special handling for IP & MPLS")
> Signed-off-by: Martin <martin.varghese@nokia.com>

There are two bugs here.

'conf' is not initialized and can contain garbage, for all fields
not just the multiproto mode configuration.

And also the multiproto mode configuration is not looked at.

So there should be two patches, one for each bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-15 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15  5:39 [PATCH net] bareudp: Fixed multiproto mode configuration Martin Varghese
2020-06-15 19:55 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.