Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of webserverBlinky by
Revision 162:594729c0e5c1, committed 2017-09-02
- Comitter:
- nixnax
- Date:
- Sat Sep 02 18:14:26 2017 +0000
- Parent:
- 161:d59f778bc8ab
- Child:
- 163:d1b4328e9f08
- Commit message:
- swapIPAddresses()
Changed in this revision
| PPP-Blinky/ppp-blinky.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PPP-Blinky/ppp-blinky.cpp Sat Sep 02 17:58:39 2017 +0000
+++ b/PPP-Blinky/ppp-blinky.cpp Sat Sep 02 18:14:26 2017 +0000
@@ -155,7 +155,6 @@
// the standard hdlc frame start/end character. It's the tilde character "~"
#define FRAME_7E (0x7e)
-
/// a structure to keep all our ppp globals in
struct pppType {
pppHeaderType * ppp; // pointer to ppp struct
@@ -522,10 +521,10 @@
/// swap the IP source and destination addresses
void swapIpAddresses()
{
- char tempHold[4];
- memcpy(tempHold, ppp.pkt.buf+16,4); // tempHold <- source IP
- memcpy(ppp.pkt.buf+16, ppp.pkt.buf+20,4); // source <- dest
- memcpy(ppp.pkt.buf+20, tempHold,4); // dest <- tempHold
+ unsigned int tempHold;
+ tempHold = ppp.ip->srcAdrR; // tempHold <- source IP
+ ppp.ip->srcAdrR = ppp.ip->dstAdrR; // source <- dest
+ ppp.ip->dstAdrR = tempHold; // dest <- tempHold*/
}
/// swap the IP source and destination ports
