0001-nameif-fix-parsing-proc-net-dev.patch 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. From ea80044062500c7473cf214010576ea2681d8d2e Mon Sep 17 00:00:00 2001
  2. From: Phil Sutter <phil.sutter@viprinet.com>
  3. Date: Thu, 3 Mar 2011 15:13:57 +0100
  4. Subject: [PATCH 1/2] nameif: fix parsing /proc/net/dev
  5. The parser field lineno is initially zero and incremented upon each
  6. call to config_read(). So lineno is effectively a "real" line number,
  7. not an index. Fix the off-by-one bug here, which led to parsing for an
  8. interface named "face".
  9. Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
  10. ---
  11. networking/nameif.c | 2 +-
  12. 1 files changed, 1 insertions(+), 1 deletions(-)
  13. diff --git a/networking/nameif.c b/networking/nameif.c
  14. index 6cf1c50..8e325e7 100644
  15. --- a/networking/nameif.c
  16. +++ b/networking/nameif.c
  17. @@ -174,7 +174,7 @@ int nameif_main(int argc, char **argv)
  18. #if ENABLE_FEATURE_NAMEIF_EXTENDED
  19. struct ethtool_drvinfo drvinfo;
  20. #endif
  21. - if (parser->lineno < 2)
  22. + if (parser->lineno < 3)
  23. continue; /* Skip the first two lines */
  24. /* Find the current interface name and copy it to ifr.ifr_name */
  25. --
  26. 1.7.3.4