Signed-off-by: Ruben Wisniewsi <[email protected]> --- net/batman-adv/gateway_common.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/net/batman-adv/gateway_common.c
b/net/batman-adv/gateway_common.c index 39cf44c..6b0f4d3 100644
--- a/net/batman-adv/gateway_common.c
+++ b/net/batman-adv/gateway_common.c
@@ -71,10 +71,16 @@ static bool batadv_parse_gw_bandwidth(struct
net_device *net_dev, char *buff,
switch (bw_unit_type) {
case BATADV_BW_UNIT_MBIT:
+ /* limit input to 100 GBit/s */
+ if (ldown > 100000)
+ ldown = 100000
*down = ldown * 10;
break;
case BATADV_BW_UNIT_KBIT:
default:
+ /* limit input to 100 GBit/s */
+ if (ldown > 100000000)
+ ldown = 100000000
*down = ldown / 100;
break;
}
--
2.4.0
pgpWk5T9FKpXD.pgp
Description: Digitale Signatur von OpenPGP
