Use uint32_t buffer instead of uint8_t one.
authorBenjamin Cama <benoar@dolka.fr>
Sun, 25 Sep 2011 12:31:25 +0000 (14:31 +0200)
committerBenjamin Cama <benoar@dolka.fr>
Sun, 25 Sep 2011 12:31:25 +0000 (14:31 +0200)
Make it easier to use, and pleases gcc.

Signed-off-by: Benjamin Cama <benoar@dolka.fr>
ppp.c

diff --git a/ppp.c b/ppp.c
index 7be79ce..1c97b0c 100644 (file)
--- a/ppp.c
+++ b/ppp.c
@@ -1540,7 +1540,7 @@ void processipv6cp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
                uint8_t *o = p + 4;
                int length = l - 4;
                int gotip = 0;
                uint8_t *o = p + 4;
                int length = l - 4;
                int gotip = 0;
-               uint8_t ident[8];
+               uint32_t ident[2];
 
                while (length > 2)
                {
 
                while (length > 2)
                {
@@ -1552,12 +1552,12 @@ void processipv6cp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
                                gotip++; // seen address
                                if (o[1] != 10) return;
 
                                gotip++; // seen address
                                if (o[1] != 10) return;
 
-                               *(uint32_t *) ident = htonl(session[s].ip);
-                               *(uint32_t *) (ident + 4) = 0;
+                               ident[0] = htonl(session[s].ip);
+                               ident[1] = 0;
 
                                if (memcmp(o + 2, ident, sizeof(ident)))
                                {
 
                                if (memcmp(o + 2, ident, sizeof(ident)))
                                {
-                                       q = ppp_conf_nak(s, b, sizeof(b), PPPIPV6CP, &response, q, p, o, ident, sizeof(ident));
+                                       q = ppp_conf_nak(s, b, sizeof(b), PPPIPV6CP, &response, q, p, o, (uint8_t *)ident, sizeof(ident));
                                        if (!q) return;
                                }
 
                                        if (!q) return;
                                }