lwIP - A Lightweight TCP/IP stack - Bugs: bug #54253, same LCP magic number after...
You are not allowed to post comments on this tracker with your current authentication level.
bug #54253: same LCP magic number after power-up.
Submitter: | Sergey A. Borshch <dushevny> | ||
Submitted: | Thu 05 Jul 2018 09:23:13 PM UTC | ||
Category: | PPP | Severity: | 3 - Normal |
Item Group: | Change Request | Status: | Fixed |
Privacy: | Public | Assigned to: | gradator |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | git head |
Jump to the original submission
Fri 31 Aug 2018 08:24:10 AM UTC, comment #7: |
Sylvain Rochet <gradator> |
Mon 23 Jul 2018 06:11:31 PM UTC, comment #6: Reading the code again, LWIP_RAND is used if it is available. Given that magic_randomize() is called from ppp_input(), I see no harm calling it from ppp_connect(), too.
|
Simon Goldschmidt <goldsimon> |
Tue 10 Jul 2018 08:02:49 PM UTC, comment #5: I'd rather use LWIP_RAND() in places where random numbers are needed. You can of course add random seed via modem startup time, but implicitly thinking sys_now() is randomized on connect is not portable enough for us, I think. |
Simon Goldschmidt <goldsimon> |
Thu 05 Jul 2018 11:20:36 PM UTC, comment #4:
|
Sergey A. Borshch <dushevny> |
Thu 05 Jul 2018 11:14:21 PM UTC, comment #3: sys_jiffies() actually mapped to sys_now() in my system. But lwip_init() always takes the same fixed time to execute and first sys_jiffies() call from ppp_init() always return the same value, which leads to same magic number in LCP packets all the time. |
Sergey A. Borshch <dushevny> |
Thu 05 Jul 2018 11:09:50 PM UTC, comment #2: Erm, my bad, this is the same issue with sys_now() if sys_now() is not randomized at boot time. Adding one call to magic_randomize() in ppp_connect might help a little bit to improve that. As long as ppp_connect() is not called right after booting up.
|
Sylvain Rochet <gradator> |
Thu 05 Jul 2018 11:02:07 PM UTC, comment #1: I don't think that's necessary. sys_now() is a mandatory function for quite a while, what prevent you to aliase sys_jiffies() to sys_now() ?
|
Sylvain Rochet <gradator> |
Thu 05 Jul 2018 09:23:13 PM UTC, original submission:
magic_init() first time called from ppp_init(), which is called from lwip_init(). If system has no RTC, sys_jiffies() returns same value in this moment after every power-up or system reset. This value used in LCP magic number generation after ppp_connect(), which leads to same magic number after every restart. Subsequent magic_randomize() calls takes place in ppp_input(), after magic number generation.
|
Sergey A. Borshch <dushevny> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 5 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2018-08-31 | gradator | Status | Confirmed | Fixed | |
Open/Closed | Open | Closed | |||
2018-07-05 | gradator | Status | Need Info | Confirmed | |
2018-07-05 | gradator | Status | None | Need Info | |
Assigned to | None | gradator |
Powered by Savane 3.13-4448.
Corresponding source code
Improved in fa3826a1d3.